From 2095d32d8f247ef89956d4f57dd617c8873ddc5a Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Fri, 2 Sep 2022 18:54:12 -0500 Subject: [PATCH] Have a player state setup Co-authored-by: sigonasr2 --- A.A.png | Bin 0 -> 1569 bytes SeasonsOfLoneliness.cpp | 32 +++++++++++++++++++++++++++++++- Y.Y.png | Bin 0 -> 1321 bytes data.h | 9 +++++++++ 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 A.A.png create mode 100644 Y.Y.png diff --git a/A.A.png b/A.A.png new file mode 100644 index 0000000000000000000000000000000000000000..ef52948288a9e2ccc86982bdc986556257059075 GIT binary patch literal 1569 zcmV++2HyFJP)EX>4Tx04R}tkv&MmKpe$iQ>7{u2MdZgWT;LSMMWI73Pq?8YK2xEOfLNpnlvOS zE{=k0!NHHks)LKOt`4q(Aou~|=;Wm6A|?JWDYS_3;J6>}?mh0_0Ya_BG^=e4&~)2O zCE{WxyCQ~O(Fp;42xC-cmN6?yN%)Shdj$A;7vov}=l&esYR+OnKqQ`FhG`S86Hjg0 z2Iqa^2rJ4e@j3B`Nf#u3C_x?gjg)Ju+qY;Xllfh#8Fk#DPPEV zta9Gstd%OPaZmoja86%d;yTSiB(Q)*ND!f*f(?{lBSx!EiiH&I$9?<*u3sXTLaq%k za?GO)4YKP8|AXJ%TKS1_FDV=c+Fu;!V+aWC0`;ond>=bb{R9X;16O*}U#qS1RhC5K~#9!?OZ)*6hRc8Sx(Rt zrc_YmusXOp7WM%}3yUE51ODJoEEG+VoQEKY9G4VEuu-(I@CPKNf0)Kf#MB2@g(E0v z84DFG&f*+4na%9HnSHZ6yYs$g$n5OSoB7^*^XAQ57$Xn}1OkCTAP@)yLO|f54S3KV zvk|%;T+8_+aPoG%Xy@#>AkM}(pJC*bR zub#b}`2H>Pv~uzQ`RFg-x@2q=-N&WCotwAEK7L4kNv>DDpWZJook3MJ6)d)Q$tR6w zquFSx--Nx#D>HAk(DDZ=fM}i8GsoRe{j&?Z^h?O*{^0Tk8Uw%wUi2D0HQw)i`NP;$k1;lmFYhRr zG*tw5L1)c1!M+DwriAAmgu)cYUO{R_4UCX&UUl2qoMM1jGi8CW1T?dh>hxnaulBJ; z4NF6XV4{@kvw8^F#0yvGI@sb|=bEv`E6<~9-mOPsYxz*uWU2`11A?w~YWZ*!5H5$Q zVnB(LQzp~zDSM(>N#}8V|iANZTTue^Cj3950E{!G9}(rPP9Z&I`OVg z%koaNxb82WFX$5Bco%?gQCI|EX9A&$o}LNxW!tEi2R##r>nhEIsG|4j>1(|0e8jsB z?D5z9vV8U0=lgyg7NyII;Vzcg988LSll?`$Sw619>2B_rmiUTc=Lww00I}s4Wl03w z?YU}6jm%t$E;Y$HO?^K31r-mb`2nsAx?E+Tpg|vYBBomM+24H>{d3(1^Ud6;`!}t3 zr2u})2RB@~f9*EV^>HM@?e4>R8>k|f&i%^~{6TrE<+B|l`05GhT6o|f1t0|=kOB}$ z0SKf3rHX2O*`@d{A9(;mD!l!9xM`*_Z;SI?J~R(d)DIzaSG`oXkVBWxlsE8cpyo5q zPPJ46GHYLb`D}TMbgoMGx2uUYwU~4QY$wR}bX4CSN51U5@oXB!o&B;%H}Tot*U1e( z_JzuaeV-qTw weatherPowerCounts; + float x,y; +}; + class SeasonsOfLoneliness : public PixelGameEngine { public: @@ -616,6 +624,8 @@ public: float audioLevel=0.6; int SEED_COUNT=0; vf2d BATTLE_PLAYER_COORDS; + PlayerState*PREV_PLAYERSTATE=new PlayerState(); + int WALK_STEPS=0; Map*CURRENT_MAP=MAP_1; @@ -924,6 +934,10 @@ public: BASE_OBJECTS["NADO"]=new ObjectLoadInfo(NADO_DECAL,NADO_ANIMATION,Pixel(153, 137, 75,230)); BASE_OBJECTS["SILICON_PIECE"]=new ObjectLoadInfo(SILICON_ROCK_DECAL); + for (int i=0;iweatherPowerCounts.push_back(WEATHER_POWERS[i]->playerOwnCount); + } + Zone*SILICON_DEPOSIT_ZONE = new Zone({109,7},{26,9},{0,0},{WIDTH,HEIGHT},{0,0},{WIDTH,HEIGHT},{1,1},{3,3},{-30,-3},{30,3},Pixel(133, 98, 66,180),Pixel(220, 120, 90,230),300,Pixel(87, 78, 69,64)); ZONES.push_back(SILICON_DEPOSIT_ZONE); @@ -1226,12 +1240,14 @@ public: LoadMap(MAP_3); PLAYER_COORDS[0]=40.5; PLAYER_COORDS[1]=37.5; + updatePlayerState(); fadeIn(); EndCutscene(); } else { LoadMap(MAP_1); PLAYER_COORDS[0]=40.5; PLAYER_COORDS[1]=37.5; + updatePlayerState(); fadeIn(); EndCutscene(); } @@ -1253,6 +1269,7 @@ public: } LoadMap(MAP_2); TeleportToMapFileCoords(8,17); + updatePlayerState(); fadeIn(); EndCutscene(); if (GAME_FLAGS[gameflag::REST_IN_DOME]&&!GAME_FLAGS[gameflag::SLEEP]) { @@ -1331,6 +1348,7 @@ public: LoadMap(MAP_2); PLAYER_COORDS[0]=16; PLAYER_COORDS[1]=6; + updatePlayerState(); }break; case cutscene::RAINING_IN_DOME:{ applyPixelEffect(HURRICANE,GetMapFileCoords(7,11),1); @@ -2388,8 +2406,9 @@ public: StartCutscene(cutscene::CHECK_COORDS); CUTSCENE_OBJS[0]=CreateObject({PLAYER_COORDS[0],PLAYER_COORDS[1]},PLAYER_DECAL,playerAnim,true); } - if(rand()%60==0) { + if(WALK_STEPS++>60&&!IN_BATTLE_ENCOUNTER) { PLAYER_HP=std::clamp(PLAYER_HP+1,0,PLAYER_MAXHP); + updatePlayerState(); } } @@ -3327,6 +3346,17 @@ public: BATTLE_DISPLAY_NUMBERS.push_back(number); return number; } + + void updatePlayerState() { + PREV_PLAYERSTATE->x=PLAYER_COORDS[0]; + PREV_PLAYERSTATE->y=PLAYER_COORDS[1]; + PREV_PLAYERSTATE->foodCount=foodCount; + PREV_PLAYERSTATE->playerHP=PLAYER_HP; + PREV_PLAYERSTATE->playerMaxHP=PLAYER_MAXHP; + for (int i=0;iweatherPowerCounts[i]=WEATHER_POWERS[i]->playerOwnCount; + } + } }; diff --git a/Y.Y.png b/Y.Y.png new file mode 100644 index 0000000000000000000000000000000000000000..379000d17b85716d5f5dbdb0ab1e0d84140d8875 GIT binary patch literal 1321 zcmV+^1=jkBP)EX>4Tx04R}tkv&MmKpe$iQ>7{u2MdZgWT;LSMMWI73Pq?8YK2xEOfLNpnlvOS zE{=k0!NHHks)LKOt`4q(Aou~|=;Wm6A|?JWDYS_3;J6>}?mh0_0Ya_BG^=e4&~)2O zCE{WxyCQ~O(Fp;42xC-cmN6?yN%)Shdj$A;7vov}=l&esYR+OnKqQ`FhG`S86Hjg0 z2Iqa^2rJ4e@j3B`Nf#u3C_x?gjg)Ju+qY;Xllfh#8Fk#DPPEV zta9Gstd%OPaZmoja86%d;yTSiB(Q)*ND!f*f(?{lBSx!EiiH&I$9?<*u3sXTLaq%k za?GO)4YKP8|AXJ%TKS1_FDV=c+Fu;!V+aWC0`;ond>=bb{R9X;16O*}U#04}113pCK~#9!?OZ)*6hRbzvz(wQ zOsSyAVRdkIEbIe{78XJ92mHBHW1*N7$$1EZ$Z<slaXuYrGJ>lO2pI$TZJPi z#4;8tSggf5Y;N}FF1L5NdHcSv8JL;fnSI~)-pssRmIwd<000000000G1SRc(+tqfp zU9G=~YtPs6wS28|5&{rLyi_45X~g@)&Ywu`zwlOy5R_En|Ng8@dS1|f*WUVyQgVfm zIpRA7psDsepLox^ahB-T`=HeIX8-8>0qlu4+ocM@krL`>r|T;-AG+U9_cNCW^S=JL zU#8)D%tF0xcUx}DZ3U$n38X{>M~cT^pIE>A@Ho-z@A+$o=OR4+f4%P4Uqs+11eJB- zAH5_>B0dgFdlsIoEfV>WU`zeu%H)G%**P_^ivazu@mJR_-F$a}=-ZX`@~;=+c3rRg zrQIW72^b3TVUOx{b2n(jjms@xz&sJO)dzdS>GNk+_a7iS`1DX?>|8hkyng;_V&i*i zvnoV@ozbs~E{XizeNbxLyM1@;)5q|g%=)bM}LWIUaW*(CRz~o2?42K;mB+zkn5TZ0SqYwLr_=(0FDCCp2x)lxy{$H z-H=>Q16=Y0j_n4-UPO2Vz-a^#01*HY01*HY01*HY01-f71mJcYL!i9^P<9KT-|y##ZRoV~QVLEE f00000z$oz#K^b(!p3wfU00000NkvXXu0mjfD<@-W literal 0 HcmV?d00001 diff --git a/data.h b/data.h index 9f57e9c..55b6fe6 100644 --- a/data.h +++ b/data.h @@ -121,6 +121,15 @@ Well that was simpl-... Eh?)",//29 R"( $PLAYER Worms? Don't think they're here to play either.)",//30 +R"( +$PLAYER +Alright! Another one done. Oh! It's responding!)",//31 +R"( +R.O.V.E.R. 2001 +SIGNS INDICATE TRACES OF SILICON LOCATION ::: NORTHEAST)",//32 +R"( +$PLAYER +Hopefully no more ambushes... (Or maybe I'll just jinx myself.))",//33 };