Define tornado bullet type and attack. Release Build 9451.
This commit is contained in:
parent
ad14544418
commit
b956a103df
@ -901,6 +901,10 @@
|
||||
<ClCompile Include="Test.cpp" />
|
||||
<ClCompile Include="Thief.cpp" />
|
||||
<ClCompile Include="TitleScreen.cpp" />
|
||||
<ClCompile Include="Tornado.cpp">
|
||||
<SubType>
|
||||
</SubType>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Trapper.cpp" />
|
||||
<ClCompile Include="Turret.cpp" />
|
||||
<ClCompile Include="Tutorial.cpp" />
|
||||
|
@ -239,6 +239,7 @@ void sig::Animation::InitializeAnimations(){
|
||||
CreateHorizontalAnimationSequence("goblin_bomb.png",4,{24,24},AnimationData{.frameDuration{0.2f},.style{Animate2D::Style::PingPong}});
|
||||
CreateHorizontalAnimationSequence("goblin_bomb_fuse.png",4,{24,24},AnimationData{.frameDuration{1.f},.style{Animate2D::Style::OneShot}});
|
||||
CreateHorizontalAnimationSequence("bomb_boom.png",5,{36,36},AnimationData{.frameDuration{0.2f},.style{Animate2D::Style::OneShot}});
|
||||
CreateHorizontalAnimationSequence("tornado2.png",4,{24,48},AnimationData{.frameDuration{0.1f},.style{Animate2D::Style::Repeat}});
|
||||
|
||||
CreateStillAnimation("meteor.png",{192,192});
|
||||
|
||||
|
@ -135,7 +135,6 @@ struct DaggerStab:public Bullet{
|
||||
};
|
||||
|
||||
struct DaggerSlash:public Bullet{
|
||||
|
||||
Monster&sourceMonster;
|
||||
Direction facingDir;
|
||||
float frameDuration;
|
||||
@ -184,4 +183,16 @@ struct LevitatingRock:public Bullet{
|
||||
void Draw()const override;
|
||||
void AssignMaster(LevitatingRock*masterRock);
|
||||
const bool IsMaster()const;
|
||||
};
|
||||
|
||||
struct Tornado:public Bullet{
|
||||
float rotatingSpd{};
|
||||
vf2d polarAngle{};
|
||||
vf2d centerPoint{};
|
||||
float knockupDuration{};
|
||||
float knockbackAmt{};
|
||||
Tornado(vf2d centerPoint,float distance,float initialRot,float rotSpd,float spd,int damage,const float knockupAmt,const float knockbackAmt,const float lifetime,bool upperLevel,bool friendly=false,Pixel col=WHITE,const vf2d scale={1,1});
|
||||
void Update(float fElapsedTime)override;
|
||||
bool PlayerHit(Player*player)override;//DO NOT CALL THIS DIRECTLY! INSTEAD USE _PlayerHit()!!
|
||||
bool MonsterHit(Monster&monster)override;//DO NOT CALL THIS DIRECTLY! INSTEAD USE _MonsterHit()!!
|
||||
};
|
70
Adventures in Lestoria/Tornado.cpp
Normal file
70
Adventures in Lestoria/Tornado.cpp
Normal file
@ -0,0 +1,70 @@
|
||||
#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 "BulletTypes.h"
|
||||
#include "Player.h"
|
||||
#include "util.h"
|
||||
|
||||
Tornado::Tornado(vf2d centerPoint,float distance,float initialRot,float rotSpd,float spd,int damage,const float knockupDuration,const float knockbackAmt,const float lifetime,bool upperLevel,bool friendly,Pixel col,const vf2d scale)
|
||||
:polarAngle({distance,initialRot}),rotatingSpd(rotSpd),knockupDuration(knockupDuration),knockbackAmt(knockbackAmt),Bullet(centerPoint+polarAngle.cart(),{},6.f,damage,"tornado2.png",upperLevel,true,lifetime,false,friendly,col,scale){}
|
||||
|
||||
void Tornado::Update(float fElapsedTime){
|
||||
rot+=rotatingSpd;
|
||||
|
||||
polarAngle={polarAngle.x,rot};
|
||||
|
||||
pos=centerPoint+polarAngle.cart();
|
||||
}
|
||||
|
||||
bool Tornado::PlayerHit(Player*player){
|
||||
player->Knockback(util::pointTo(centerPoint,player->GetPos())*knockbackAmt);
|
||||
player->Knockup(knockupDuration);
|
||||
|
||||
player->ApplyIframes(knockupDuration);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Tornado::MonsterHit(Monster&monster){
|
||||
if(monster.IgnoresTerrainCollision())return false; //All airborne enemy types won't care about this.
|
||||
|
||||
monster.Knockback(util::pointTo(centerPoint,monster.GetPos())*knockbackAmt);
|
||||
monster.Knockup(knockupDuration);
|
||||
|
||||
return true;
|
||||
}
|
@ -39,7 +39,7 @@ All rights reserved.
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 2
|
||||
#define VERSION_PATCH 3
|
||||
#define VERSION_BUILD 9447
|
||||
#define VERSION_BUILD 9451
|
||||
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
|
@ -53,6 +53,7 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
|
||||
IDLE,
|
||||
FLY_ACROSS_PREPARE,
|
||||
FLY_ACROSS,
|
||||
TORNADO_ATTACK_PREPARE,
|
||||
TORNADO_ATTACK,
|
||||
WIND_ATTACK,
|
||||
HALFHEALTH_PHASE,
|
||||
@ -76,7 +77,7 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
|
||||
m.phase=IDLE;
|
||||
}break;
|
||||
case IDLE:{
|
||||
const int randomAttackChoice=util::random()%1;
|
||||
const int randomAttackChoice=util::random()%2;
|
||||
|
||||
switch(randomAttackChoice){
|
||||
case 0:{
|
||||
@ -89,7 +90,8 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
|
||||
m.phase=FLY_ACROSS_PREPARE;
|
||||
}break;
|
||||
case 1:{
|
||||
m.phase=TORNADO_ATTACK;
|
||||
m.phase=TORNADO_ATTACK_PREPARE;
|
||||
m.target=ConfigVec("Tornado Attack.Arena Center");
|
||||
}break;
|
||||
case 2:{
|
||||
m.phase=WIND_ATTACK;
|
||||
@ -130,7 +132,7 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
|
||||
CreateBullet(Bullet)(m.GetPos()+vf2d{xOffset+util::random_range(-3.f,3.f),-util::random(10.f)-4.f},vf2d{0.f,ConfigFloat("Fly Across Attack.Attack Y Speed")},1,ConfigInt("Fly Across Attack.Poop Damage"),"birdpoop.png",m.OnUpperLevel(),false,INFINITY,false,false,WHITE,vf2d{util::random_range(0.2f,0.3f),util::random_range(0.2f,0.3f)},util::random(2*PI))
|
||||
.SetIframeTimeOnHit(0.25f)EndBullet;
|
||||
}
|
||||
m.F(A::SHOOT_TIMER)=ConfigFloat("Fly Across Attack.Attack Frequency");
|
||||
m.F(A::SHOOT_TIMER)=ConfigFloat("Fly Across Attack.Landing Area");
|
||||
}
|
||||
if(m.ReachedTargetPos()){
|
||||
m.phase=IDLE;
|
||||
@ -138,6 +140,15 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
|
||||
m.targetAcquireTimer=0.f;
|
||||
}
|
||||
}break;
|
||||
case TORNADO_ATTACK_PREPARE:{
|
||||
m.targetAcquireTimer=20.f;
|
||||
RUN_TOWARDS(m,fElapsedTime,"Run Towards");
|
||||
if(m.ReachedTargetPos()){
|
||||
m.phase=TORNADO_ATTACK;
|
||||
m.PerformAnimation("ATTACK",Direction::SOUTH);
|
||||
m.targetAcquireTimer=0.f;
|
||||
}
|
||||
}break;
|
||||
case TORNADO_ATTACK:{
|
||||
|
||||
}break;
|
||||
|
@ -795,5 +795,25 @@ MonsterStrategy
|
||||
# Defined in units/sec
|
||||
Attack Y Speed = 150
|
||||
}
|
||||
Tornado Attack
|
||||
{
|
||||
# Landing point for the attack. Defaults to Arena Center.
|
||||
Landing Area = 2040, 1752
|
||||
|
||||
Attack Duration = 9s
|
||||
|
||||
Knockup Duration = 0.7s
|
||||
Knockback Amount = 2.0
|
||||
|
||||
Tornados
|
||||
{
|
||||
# For each Ring: Distance from Boss in Units, # of tornados, Rotation Speed (degrees/sec).
|
||||
# Freely add/subtract rings to create or remove more tornados.
|
||||
Ring 1 = 100, 2, 120
|
||||
Ring 2 = 200, 3, -75
|
||||
Ring 3 = 300, 5, 60
|
||||
Ring 4 = 400, 8, -40
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -98,6 +98,7 @@ Images
|
||||
GFX_RockOutline = rock_outline.png
|
||||
GFX_BossIndicator = bossIndicator.png
|
||||
GFX_BirdPoop = birdpoop.png
|
||||
GFX_Tornado = tornado2.png
|
||||
|
||||
# Ability Icons
|
||||
GFX_Warrior_BattleCry_Icon = Ability Icons/battlecry.png
|
||||
|
Binary file not shown.
BIN
Adventures in Lestoria/assets/spr_spell_tornado_strip4.png
Normal file
BIN
Adventures in Lestoria/assets/spr_spell_tornado_strip4.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
BIN
Adventures in Lestoria/assets/tornado.png
Normal file
BIN
Adventures in Lestoria/assets/tornado.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
BIN
Adventures in Lestoria/assets/tornado2.png
Normal file
BIN
Adventures in Lestoria/assets/tornado2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.9 KiB |
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user