Fix up warnings (mostly loss of data cast warnings). When an ability gets interrupted, the key is required to be depressed before another cast attempt can be made. Added collision layer tiles to a few tiles in 1-1 due to ability to walk out-of-bounds.
This commit is contained in:
@@ -47,7 +47,7 @@ void Monster::STRATEGY::SHOOT_AFAR(Monster&m,float fElapsedTime,int strategyNumb
|
||||
if(m.queueShotTimer<0){
|
||||
m.queueShotTimer=0;
|
||||
{
|
||||
BULLET_LIST.push_back(std::make_unique<Bullet>(Bullet(m.pos + vf2d{ 0,-4 }, geom2d::line(m.pos + vf2d{ 0,-4 }, game->GetPlayer()->GetPos()).vector().norm() * 24 * ConfigInt("BulletSpeed")/100.f, 12.f*ConfigInt("BulletSize")/100.f, m.GetAttack(),m.upperLevel,false, { uint8_t(ConfigIntArr("BulletColor",0)),uint8_t(ConfigIntArr("BulletColor",1)),uint8_t(ConfigIntArr("BulletColor",2)),uint8_t(ConfigIntArr("BulletColor",3) )},{ConfigInt("BulletSize")/100.f*8,ConfigInt("BulletSize")/100.f*8})));
|
||||
BULLET_LIST.push_back(std::make_unique<Bullet>(Bullet(m.pos + vf2d{ 0,-4 }, geom2d::line(m.pos + vf2d{ 0,-4 }, game->GetPlayer()->GetPos()).vector().norm() * 24.f * float(ConfigInt("BulletSpeed"))/100.f, 12.f*ConfigInt("BulletSize")/100.f, m.GetAttack(),m.upperLevel,false, { uint8_t(ConfigIntArr("BulletColor",0)),uint8_t(ConfigIntArr("BulletColor",1)),uint8_t(ConfigIntArr("BulletColor",2)),uint8_t(ConfigIntArr("BulletColor",3) )},{ConfigInt("BulletSize")/100.f*8,ConfigInt("BulletSize")/100.f*8})));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ void Monster::STRATEGY::SHOOT_AFAR(Monster&m,float fElapsedTime,int strategyNumb
|
||||
if(m.targetAcquireTimer==0&&m.queueShotTimer==0){
|
||||
m.targetAcquireTimer=1;
|
||||
if(line.length()<24.f*ConfigInt("Range")/100.f){
|
||||
m.target=line.upoint(-1.2);
|
||||
m.target=line.upoint(-1.2f);
|
||||
if(m.canMove){
|
||||
m.SetState(State::MOVE_AWAY);
|
||||
} else {
|
||||
@@ -63,7 +63,7 @@ void Monster::STRATEGY::SHOOT_AFAR(Monster&m,float fElapsedTime,int strategyNumb
|
||||
}
|
||||
} else
|
||||
if(line.length()>24.f*ConfigInt("CloseInRange")/100.0f){
|
||||
m.target=line.upoint(1.2);
|
||||
m.target=line.upoint(1.2f);
|
||||
m.SetState(State::MOVE_TOWARDS);
|
||||
} else {
|
||||
m.SetState(State::NORMAL);
|
||||
@@ -78,7 +78,7 @@ void Monster::STRATEGY::SHOOT_AFAR(Monster&m,float fElapsedTime,int strategyNumb
|
||||
vf2d newPos=m.pos+moveTowardsLine.vector().norm()*100*fElapsedTime*m.GetMoveSpdMult();
|
||||
bool movedX=m.SetX(newPos.x);
|
||||
bool movedY=m.SetY(newPos.y);
|
||||
pathfindingDecision=movedX|movedY;
|
||||
pathfindingDecision=movedX||movedY;
|
||||
m.canMove=movedX&&movedY;
|
||||
}
|
||||
if(!pathfindingDecision){
|
||||
@@ -99,7 +99,7 @@ void Monster::STRATEGY::SHOOT_AFAR(Monster&m,float fElapsedTime,int strategyNumb
|
||||
vf2d newPos=m.pos+moveTowardsLine.vector().norm()*100*fElapsedTime*m.GetMoveSpdMult();
|
||||
bool movedX=m.SetX(newPos.x);
|
||||
bool movedY=m.SetY(newPos.y);
|
||||
pathfindingDecision=movedX|movedY;
|
||||
pathfindingDecision=movedX||movedY;
|
||||
m.canMove=movedX&&movedY;
|
||||
}
|
||||
if(!pathfindingDecision){
|
||||
@@ -121,7 +121,7 @@ void Monster::STRATEGY::SHOOT_AFAR(Monster&m,float fElapsedTime,int strategyNumb
|
||||
default:{
|
||||
if(m.attackCooldownTimer==0){
|
||||
m.attackCooldownTimer=ConfigFloat("ShootingSpeed");
|
||||
m.queueShotTimer=std::min(m.attackCooldownTimer-0.001,0.7);
|
||||
m.queueShotTimer=std::min(m.attackCooldownTimer-0.001f,0.7f);
|
||||
m.PerformShootAnimation();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user