Generalized FallingStone into FallingBullet to supply a custom image. Prepare graphics and add extra map items and basic AI structure for Chapter 3 boss. Release Build 11936.
parent
e893d3a54e
commit
9732c57983
@ -0,0 +1,116 @@ |
||||
#pragma region License |
||||
/*
|
||||
License (OLC-3) |
||||
~~~~~~~~~~~~~~~ |
||||
|
||||
Copyright 2024 Joshua Sigona <sigonasr2@gmail.com> |
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, |
||||
are permitted provided that the following conditions are met: |
||||
|
||||
1. Redistributions or derivations of source code must retain the above copyright |
||||
notice, this list of conditions and the following disclaimer. |
||||
|
||||
2. Redistributions or derivative works in binary form must reproduce the above |
||||
copyright notice. This list of conditions and the following disclaimer must be |
||||
reproduced in the documentation and/or other materials provided with the distribution. |
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors may |
||||
be used to endorse or promote products derived from this software without specific |
||||
prior written permission. |
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY |
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT |
||||
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED |
||||
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
||||
SUCH DAMAGE. |
||||
|
||||
Portions of this software are copyright © 2024 The FreeType |
||||
Project (www.freetype.org). Please see LICENSE_FT.txt for more information. |
||||
All rights reserved. |
||||
*/ |
||||
#pragma endregion |
||||
|
||||
#include "MonsterStrategyHelpers.h" |
||||
#include "util.h" |
||||
#include "AdventuresInLestoria.h" |
||||
#include "SoundEffect.h" |
||||
#include "BulletTypes.h" |
||||
|
||||
using A=Attribute; |
||||
|
||||
INCLUDE_game |
||||
INCLUDE_MONSTER_LIST |
||||
|
||||
void Monster::STRATEGY::GHOST_OF_PIRATE_CAPTAIN(Monster&m,float fElapsedTime,std::string strategy){ |
||||
enum PhaseName{ |
||||
INIT, |
||||
NORMAL, |
||||
}; |
||||
|
||||
static const uint8_t PHASE_COUNT{DATA.GetProperty("MonsterStrategy.Ghost of Pirate Captain").GetValueCount()}; |
||||
static std::vector<uint8_t>PHASES{}; |
||||
|
||||
const auto AdvanceCannonPhase{[&m,&strategy](){ |
||||
m.GetFloat(A::CANNON_TIMER)=0.f; |
||||
if(m.GetInt(A::CANNON_PHASE)+1>=PHASE_COUNT)m.GetInt(A::CANNON_SHOT_TYPE)=util::random()%5; |
||||
m.GetInt(A::CANNON_PHASE)=(m.GetInt(A::CANNON_PHASE)+1)%PHASE_COUNT; |
||||
}}; |
||||
|
||||
switch(PHASE()){ |
||||
case INIT:{ |
||||
for(int i:std::ranges::iota_view(PHASE_COUNT)){ |
||||
PHASES.emplace_back(DATA.GetProperty("MonsterStrategy.Ghost of Pirate Captain").GetInt(i)); |
||||
} |
||||
m.I(A::CANNON_SHOT_TYPE)=util::random()%5; |
||||
}break; |
||||
case NORMAL:{ |
||||
m.F(A::CANNON_TIMER)+=fElapsedTime; |
||||
switch(PHASES[m.I(A::CANNON_PHASE)]){ |
||||
enum CannonPhaseType{ |
||||
CANNON_SHOT, |
||||
SILENCE, |
||||
SHRAPNEL_SHOT, |
||||
}; |
||||
case CANNON_SHOT:{//Normal Cannon Shot. Takes on one of five varieties.
|
||||
enum CannonShotType{ |
||||
BOMBARDMENT,//every shot is at a random location within 900 Range of the player. (This is also the move during hide and seek.)
|
||||
PRECISE_BOMBARDMENT,//same as before but within 700 range of the player.
|
||||
LINE,//the 4th or 5th hit would hit the player if the player doesnt move at all.
|
||||
SHARPSHOOTER,//aiming directly at the player, skipping every 2nd shot. (only 4 instead of 8 shots)
|
||||
PREDICTION,//shoots in the direction of the current or last players movement and predicts where the player would be in 2.8 seconds. (slightly further then where the player would be at impact. thats why 2.8 instead of 2.5 seconds)
|
||||
}; |
||||
switch(m.I(A::CANNON_SHOT_TYPE)){ |
||||
case BOMBARDMENT:{ |
||||
|
||||
}break; |
||||
case PRECISE_BOMBARDMENT:{ |
||||
|
||||
}break; |
||||
case LINE:{ |
||||
|
||||
}break; |
||||
case SHARPSHOOTER:{ |
||||
|
||||
}break; |
||||
case PREDICTION:{ |
||||
|
||||
}break; |
||||
} |
||||
if(m.F(A::CANNON_TIMER)>=ConfigFloat("Cannon Shot Delay"))AdvanceCannonPhase(); |
||||
}break; |
||||
case SILENCE:{ |
||||
if(m.F(A::CANNON_TIMER)>=ConfigFloat("Silence Time"))AdvanceCannonPhase(); |
||||
}break; |
||||
case SHRAPNEL_SHOT:{ |
||||
if(m.F(A::CANNON_TIMER)>=ConfigFloat("Shrapnel Shot Delay"))AdvanceCannonPhase(); |
||||
}break; |
||||
} |
||||
}break; |
||||
} |
||||
} |
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue