Change move towards bump behavior to be a chance to stop an instance of this strategy instead.
This commit is contained in:
parent
74a31dda2e
commit
7745010099
Crawler
@ -5,6 +5,8 @@
|
|||||||
#include "BulletTypes.h"
|
#include "BulletTypes.h"
|
||||||
#include "DEFINES.h"
|
#include "DEFINES.h"
|
||||||
#include "safemap.h"
|
#include "safemap.h"
|
||||||
|
#include "MonsterStrategyHelpers.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
INCLUDE_ANIMATION_DATA
|
INCLUDE_ANIMATION_DATA
|
||||||
INCLUDE_MONSTER_DATA
|
INCLUDE_MONSTER_DATA
|
||||||
@ -207,7 +209,7 @@ void Monster::Collision(Monster&m){
|
|||||||
Collision();
|
Collision();
|
||||||
}
|
}
|
||||||
void Monster::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);
|
SetState(State::NORMAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define VERSION_MAJOR 0
|
#define VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 2
|
#define VERSION_MINOR 2
|
||||||
#define VERSION_PATCH 0
|
#define VERSION_PATCH 0
|
||||||
#define VERSION_BUILD 1342
|
#define VERSION_BUILD 1344
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
@ -43,6 +43,8 @@ MonsterStrategy
|
|||||||
WaitTime = 3
|
WaitTime = 3
|
||||||
# How far the monster will travel before reassessing for a new path.
|
# How far the monster will travel before reassessing for a new path.
|
||||||
MaxDistance = 999999
|
MaxDistance = 999999
|
||||||
|
# 1 of X chance to stop after bumping into something.
|
||||||
|
BumpStopChance = 5
|
||||||
}
|
}
|
||||||
1
|
1
|
||||||
{
|
{
|
||||||
|
@ -12,6 +12,7 @@ Monsters
|
|||||||
Size = 80
|
Size = 80
|
||||||
|
|
||||||
Strategy = Run Towards
|
Strategy = Run Towards
|
||||||
|
BumpStopChance = 2
|
||||||
|
|
||||||
#Size of each animation frame
|
#Size of each animation frame
|
||||||
SheetFrameSize = 24,24
|
SheetFrameSize = 24,24
|
||||||
|
Loading…
x
Reference in New Issue
Block a user