ipochto / stratagus

The Stratagus strategy game engine
GNU General Public License v2.0
0 stars 0 forks source link

With StandGround command, catapults trying to attack units in the distances < MinAttackRange #4

Open ipochto opened 4 years ago

ipochto commented 4 years ago

Attack animation is played, but missile didn't throw. It makes sense if missile will be thrown and fly MinAttackRange, after that we have to calculate damage for resulting tile, and splash.

ipochto commented 4 years ago

Partly fixed (only prevent to play animation) in this https://github.com/ipochto/stratagus/commit/019c2d3551e06aa17baad57f84bd64729e3403d1 commit.

Still needed to implement for units with StandGround command (or bunkered):

if current automaticaly selected target is closer than MinAttackRange, calculate groundPos for attack ground in MinAttackRange distance. Only for units which can attack-ground && has a splash attack && can hit current target with splash. Else do not attack at all.

Also, think about: if target is building and it closer than MinAttackRange, attacker will "throw missile" not to the center of the building, but to a tile which is belong to this building and in MinAttackRange distance.