MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / Sprite_Handle_Enemy_Aggression_Set

Method Sprite_Handle_Enemy_Aggression_Set

Source/Fodder.cpp:9200–9224  ·  view source on GitHub ↗

* Set the aggression of a sprite, then calculate the next aggression rate * * This moves by 'Increment' in an up or down * direction inside the min/max range for this map */

Source from the content-addressed store, hash-verified

9198 * direction inside the min/max range for this map
9199 */
9200void cFodder::Sprite_Handle_Enemy_Aggression_Set(sSprite* pSprite) {
9201
9202 int16 Next = mGame_Data.mGamePhase_Data.mSprite_Enemy_AggressionNext;
9203 pSprite->field_62 = Next;
9204
9205 int16 Increment = mGame_Data.mGamePhase_Data.mSprite_Enemy_AggressionIncrement;
9206 Next += Increment;
9207
9208 if (Increment >= 0) {
9209
9210 if (Next >= mGame_Data.mGamePhase_Data.mSprite_Enemy_AggressionMax) {
9211 Next = mGame_Data.mGamePhase_Data.mSprite_Enemy_AggressionMax;
9212 Increment = -Increment;
9213 }
9214 }
9215 else {
9216 if (Next < 0 || Next <= mGame_Data.mGamePhase_Data.mSprite_Enemy_AggressionMin) {
9217 Next = mGame_Data.mGamePhase_Data.mSprite_Enemy_AggressionMin;
9218 Increment = -Increment;
9219 }
9220 }
9221 //loc_2D90D
9222 mGame_Data.mGamePhase_Data.mSprite_Enemy_AggressionIncrement = Increment;
9223 mGame_Data.mGamePhase_Data.mSprite_Enemy_AggressionNext = Next;
9224}
9225
9226int16 cFodder::Sprite_Next_WalkTarget_Set(sSprite* pSprite) {
9227

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected