From 3e2bd6feb6c0e3bc73a3cc4e44df13a8c9f2b718 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Sun, 14 Jan 2024 17:42:20 -0600 Subject: [PATCH] Add bear sprite and bear strategy framework. --- .../Adventures in Lestoria.vcxproj | 4 ++ .../Adventures in Lestoria.vcxproj.filters | 3 + Adventures in Lestoria/Bear.cpp | 57 ++++++++++++++++++ Adventures in Lestoria/Monster.h | 1 + Adventures in Lestoria/RUN_STRATEGY.cpp | 1 + .../assets/config/MonsterStrategies.txt | 4 ++ .../assets/config/Monsters.txt | 34 +++++++++++ .../assets/monsters/Bear.png | Bin 0 -> 3501 bytes 8 files changed, 104 insertions(+) create mode 100644 Adventures in Lestoria/Bear.cpp create mode 100644 Adventures in Lestoria/assets/monsters/Bear.png diff --git a/Adventures in Lestoria/Adventures in Lestoria.vcxproj b/Adventures in Lestoria/Adventures in Lestoria.vcxproj index c5fa7bb2..58a95323 100644 --- a/Adventures in Lestoria/Adventures in Lestoria.vcxproj +++ b/Adventures in Lestoria/Adventures in Lestoria.vcxproj @@ -508,6 +508,10 @@ + + + + diff --git a/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters b/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters index 9e119809..e8cf19c9 100644 --- a/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters +++ b/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters @@ -722,6 +722,9 @@ Source Files\Monster Strategies + + Source Files\Monster Strategies + diff --git a/Adventures in Lestoria/Bear.cpp b/Adventures in Lestoria/Bear.cpp new file mode 100644 index 00000000..a7a2b776 --- /dev/null +++ b/Adventures in Lestoria/Bear.cpp @@ -0,0 +1,57 @@ +#pragma region License +/* +License (OLC-3) +~~~~~~~~~~~~~~~ + +Copyright 2024 Joshua Sigona + +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 © 2023 The FreeType +Project (www.freetype.org). Please see LICENSE_FT.txt for more information. +All rights reserved. +*/ +#pragma endregion + +#include "Monster.h" +#include "AdventuresInLestoria.h" +#include "MonsterStrategyHelpers.h" +#include "util.h" +#include "BulletTypes.h" +#include "SoundEffect.h" + +INCLUDE_game +INCLUDE_BULLET_LIST + +using A=Attribute; + +void Monster::STRATEGY::BEAR(Monster&m,float fElapsedTime,std::string strategy){ + switch(m.I(A::PHASE)){ + case 0:{ + + }break; + } +} \ No newline at end of file diff --git a/Adventures in Lestoria/Monster.h b/Adventures in Lestoria/Monster.h index e2681b38..5b544090 100644 --- a/Adventures in Lestoria/Monster.h +++ b/Adventures in Lestoria/Monster.h @@ -240,6 +240,7 @@ private: static void RUN_AWAY(Monster&m,float fElapsedTime,std::string strategy); static void FROG(Monster&m,float fElapsedTime,std::string strategy); static void WOLF(Monster&m,float fElapsedTime,std::string strategy); + static void BEAR(Monster&m,float fElapsedTime,std::string strategy); }; }; diff --git a/Adventures in Lestoria/RUN_STRATEGY.cpp b/Adventures in Lestoria/RUN_STRATEGY.cpp index 74efb48f..3a9a9b55 100644 --- a/Adventures in Lestoria/RUN_STRATEGY.cpp +++ b/Adventures in Lestoria/RUN_STRATEGY.cpp @@ -50,6 +50,7 @@ void Monster::InitializeStrategies(){ STRATEGY_DATA.insert("Run Away",Monster::STRATEGY::RUN_AWAY); STRATEGY_DATA.insert("Frog",Monster::STRATEGY::FROG); STRATEGY_DATA.insert("Wolf",Monster::STRATEGY::WOLF); + STRATEGY_DATA.insert("Bear",Monster::STRATEGY::BEAR); STRATEGY_DATA.SetInitialized(); } diff --git a/Adventures in Lestoria/assets/config/MonsterStrategies.txt b/Adventures in Lestoria/assets/config/MonsterStrategies.txt index 75ee3ed0..a58664e6 100644 --- a/Adventures in Lestoria/assets/config/MonsterStrategies.txt +++ b/Adventures in Lestoria/assets/config/MonsterStrategies.txt @@ -210,4 +210,8 @@ MonsterStrategy # The amount of time to spend disengaged. Disengage Duration = 3.0s } + Bear + { + + } } \ No newline at end of file diff --git a/Adventures in Lestoria/assets/config/Monsters.txt b/Adventures in Lestoria/assets/config/Monsters.txt index 9ac4b8eb..0de08163 100644 --- a/Adventures in Lestoria/assets/config/Monsters.txt +++ b/Adventures in Lestoria/assets/config/Monsters.txt @@ -277,4 +277,38 @@ Monsters # Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse) #ANIMATION[0] = 6, 0.1, Repeat } + Bear + { + Health = 210 + Attack = 45 + + CollisionDmg = 10 + + MoveSpd = 60% + Size = 200% + + XP = 27 + + Strategy = Run Towards + + #Size of each animation frame + SheetFrameSize = 24,24 + + # Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse) + IdleAnimation = 3, 0.3, PingPong + JumpAnimation = 9, 0.2, Repeat + ShootAnimation = 3, 0.2, OneShot + DeathAnimation = 4, 0.15, OneShot + + # Drop Item Name, Drop Percentage(0-100%), Drop Min Quantity, Drop Max Quantity + DROP[0] = Frog Skin,35%,1,2 + + Hurt Sound = Monster Hurt + Death Sound = Slime Dead + Walk Sound = Slime Walk + + #Additional custom animations go down below. Start with ANIMATION[0]. Order is: + # Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse) + ANIMATION[0] = 4, 0.2, OneShot + } } \ No newline at end of file diff --git a/Adventures in Lestoria/assets/monsters/Bear.png b/Adventures in Lestoria/assets/monsters/Bear.png new file mode 100644 index 0000000000000000000000000000000000000000..c8fb1ecf2232f47a93a237a772bd1dfc209b86da GIT binary patch literal 3501 zcmY*bXH*l)5)MtSAiV^XDj-c16qQH>jc_RQLJSB7h~&lhe!O$%oY~zoJ7;G1eDm#W;!Rr%5uu|(002P5%F+zV zohP^&@y8+Vh(GTd3IOoL`&_+x)9UI~6;w!&myf?E0HBo_lX=PV{Y~lk8+PWI_!o+1 zif8OKTkR#N(C*`oS^@F56>aY930^;nl?GaL66WRxk)xg6P7Z<&SH#&o!4W8ESf(W7 znvfpy?e{2U`gCX%!{oBJeZFsmIS;Hc#U6aZE3_IpsEd~C5T}S|=KrlZk}MxJHhwAG zZaV&cZsaU(v~KD8A(q*K)+dqVsK-$epGH6oDM2SI=(EAZ$|G-7m}=vmd9y}9McF8? zp`Mp3iI2OG4Ud;ay)>?BJXaOf#{ans8S{+alD$WOy4OT+0uOD{tP8(2Q6#96l9rGs zDMvq4bwKhXQl+J|FQ(sTStw$#@H3-;Odw#MNYJpIdLt*U`J5>Im zMq$Hm#9uM~lLJy6oFj0b01SbrKL&dz$gfllfjZXG66m+7gd*{!fY-39AS^ETrWSy4 z@5glzf+f4^5=tMtNL}O0D0R}C1qeRv@W^~UeraZU64Z=|cHY|O8L|oKcQ!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