@ -45,9 +45,12 @@ All rights reserved.
INCLUDE_game
INCLUDE_game
ChargedArrow : : ChargedArrow ( vf2d pos , vf2d vel , float radius , int damage , bool upperLevel , bool friendly , Pixel col )
ChargedArrow : : ChargedArrow ( vf2d pos , vf2d vel , float radius , int damage , bool upperLevel , bool friendly , Pixel col )
: lastLaserPos ( pos ) ,
: lastLaserPos ( pos ) , laserGraphic ( " laser.png " ) ,
Bullet ( pos , vel , radius , damage ,
Bullet ( pos , vel , radius , damage , " charged_shot_arrow.png " , upperLevel , true , INFINITE , true , friendly , col ) { }
" charged_shot_arrow.png " , upperLevel , true , INFINITE , true , friendly , col ) { }
ChargedArrow : : ChargedArrow ( const std : : string & shotArrowGraphic , const std : : string & laserGraphic , vf2d pos , vf2d vel , float radius , int damage , bool upperLevel , bool friendly , Pixel col )
: lastLaserPos ( pos ) , laserGraphic ( laserGraphic ) ,
Bullet ( pos , vel , radius , damage , shotArrowGraphic , upperLevel , true , INFINITE , true , friendly , col ) { }
void ChargedArrow : : Update ( float fElapsedTime ) {
void ChargedArrow : : Update ( float fElapsedTime ) {
geom2d : : line lineToCurrentPos ( geom2d : : line ( lastLaserPos , pos ) ) ;
geom2d : : line lineToCurrentPos ( geom2d : : line ( lastLaserPos , pos ) ) ;
@ -58,7 +61,7 @@ void ChargedArrow::Update(float fElapsedTime){
const float normalBeamRadius { 12 * " Ranger.Ability 2.Radius " _F / 100 / 5 } ;
const float normalBeamRadius { 12 * " Ranger.Ability 2.Radius " _F / 100 / 5 } ;
float laserWidth { radius / normalBeamRadius } ;
float laserWidth { radius / normalBeamRadius } ;
game - > AddEffect ( std : : make_unique < Effect > ( midpoint , 0.1f , " laser.png " , upperLevel , vf2d { laserWidth , dist * 2 } , 0.3f , vf2d { } , Pixel { 192 , 128 , 238 } , atan2 ( pos . y - lastLaserPos . y , pos . x - lastLaserPos . x ) + PI / 2 , 0 , true ) ) ;
game - > AddEffect ( std : : make_unique < Effect > ( midpoint , 0.1f , laserGraphic , upperLevel , vf2d { laserWidth , dist * 2 } , 0.3f , vf2d { } , Pixel { 192 , 128 , 238 } , atan2 ( pos . y - lastLaserPos . y , pos . x - lastLaserPos . x ) + PI / 2 , 0 , true ) ) ;
lastLaserPos = pos ;
lastLaserPos = pos ;
}
}
}
}