Change move towards bump behavior to be a chance to stop an instance of this strategy instead.

pull/28/head
sigonasr2 1 year ago
parent 74a31dda2e
commit 7745010099
  1. 4
      Crawler/Monster.cpp
  2. 2
      Crawler/Version.h
  3. 2
      Crawler/assets/config/MonsterStrategies.txt
  4. 1
      Crawler/assets/config/Monsters.txt

@ -5,6 +5,8 @@
#include "BulletTypes.h"
#include "DEFINES.h"
#include "safemap.h"
#include "MonsterStrategyHelpers.h"
#include "utils.h"
INCLUDE_ANIMATION_DATA
INCLUDE_MONSTER_DATA
@ -207,7 +209,7 @@ void Monster::Collision(Monster&m){
Collision();
}
void Monster::Collision(){
if(strategy==0&&GetState()==State::MOVE_TOWARDS){//The run towards strategy causes state to return to normal upon a collision.
if(strategy==0&&GetState()==State::MOVE_TOWARDS&&util::random(Monster::STRATEGY::_GetInt(*this,"BumpStopChance",strategy))<1){//The run towards strategy causes state to return to normal upon a collision.
SetState(State::NORMAL);
}
}

@ -2,7 +2,7 @@
#define VERSION_MAJOR 0
#define VERSION_MINOR 2
#define VERSION_PATCH 0
#define VERSION_BUILD 1342
#define VERSION_BUILD 1344
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -43,6 +43,8 @@ MonsterStrategy
WaitTime = 3
# How far the monster will travel before reassessing for a new path.
MaxDistance = 999999
# 1 of X chance to stop after bumping into something.
BumpStopChance = 5
}
1
{

@ -12,6 +12,7 @@ Monsters
Size = 80
Strategy = Run Towards
BumpStopChance = 2
#Size of each animation frame
SheetFrameSize = 24,24

Loading…
Cancel
Save