- wrap all personality decision actions in VM functions.

This commit is contained in:
Christoph Oelckers 2023-05-24 18:03:16 +02:00
parent 540f96407d
commit f12cc01055
21 changed files with 340 additions and 354 deletions

View file

@ -1101,9 +1101,15 @@ void DSWActor::callAction()
void DSWActor::callStateAction()
{
if (user.__legacyState.State && user.__legacyState.State->Animator)
callFunction(*user.__legacyState.State->Animator);
}
void DSWActor::callFunction(VMFunction* func)
{
if (func)
{
VMValue param[] = { this };
VMCall(*user.__legacyState.State->Animator, param, 1, nullptr, 0);
VMCall(func, param, 1, nullptr, 0);
}
}

View file

@ -43,7 +43,7 @@ BEGIN_SW_NS
ANIMATOR InitActorRunToward;
bool DropAhead(DSWActor* actor, double min_height);
ANIMATOR* ChooseAction(DECISION decision[]);
VMFunction* ChooseAction(DECISION decision[]);
#define CHOOSE2(value) (RANDOM_P2(1024) < (value))
@ -68,11 +68,7 @@ bool ActorMoveHitReact(DSWActor* actor)
// if you ran into a player - call close range functions
DoActorPickClosePlayer(actor);
auto action = ChooseAction(actor->user.__legacyState.Personality->TouchTarget);
if (action)
{
(*action)(actor);
return true;
}
actor->callFunction(action);
}
}
return false;
@ -126,7 +122,7 @@ void DoActorSetSpeed(DSWActor* actor, uint8_t speed)
*/
//---------------------------------------------------------------------------
ANIMATOR* ChooseAction(DECISION decision[])
VMFunction* ChooseAction(DECISION decision[])
{
// !JIM! Here is an opportunity for some AI, instead of randomness!
int random_value = RANDOM_P2(1024<<5)>>5;
@ -137,7 +133,7 @@ ANIMATOR* ChooseAction(DECISION decision[])
if (random_value <= decision[i].range)
{
return decision[i].action;
return *decision[i].action;
}
}
}
@ -167,50 +163,50 @@ int ChooseActionNumber(int16_t decision[])
//
//---------------------------------------------------------------------------
int DoActorNoise(ANIMATOR* Action, DSWActor* actor)
int DoActorNoise(VMFunction* Action, DSWActor* actor)
{
if (Action == InitActorAmbientNoise)
if (Action == *AF(InitActorAmbientNoise))
{
PlaySpriteSound(actor, attr_ambient, v3df_follow);
}
else if (Action == InitActorAlertNoise)
else if (Action == *AF(InitActorAlertNoise))
{
if (actor->hasU() && !actor->user.DidAlert) // This only allowed once
PlaySpriteSound(actor, attr_alert, v3df_follow);
}
else if (Action == InitActorAttackNoise)
else if (Action == *AF(InitActorAttackNoise))
{
PlaySpriteSound(actor, attr_attack, v3df_follow);
}
else if (Action == InitActorPainNoise)
else if (Action == *AF(InitActorPainNoise))
{
PlaySpriteSound(actor, attr_pain, v3df_follow);
}
else if (Action == InitActorDieNoise)
else if (Action == *AF(InitActorDieNoise))
{
PlaySpriteSound(actor, attr_die, v3df_none);
}
else if (Action == InitActorExtra1Noise)
else if (Action == *AF(InitActorExtra1Noise))
{
PlaySpriteSound(actor, attr_extra1, v3df_follow);
}
else if (Action == InitActorExtra2Noise)
else if (Action == *AF(InitActorExtra2Noise))
{
PlaySpriteSound(actor, attr_extra2, v3df_follow);
}
else if (Action == InitActorExtra3Noise)
else if (Action == *AF(InitActorExtra3Noise))
{
PlaySpriteSound(actor, attr_extra3, v3df_follow);
}
else if (Action == InitActorExtra4Noise)
else if (Action == *AF(InitActorExtra4Noise))
{
PlaySpriteSound(actor, attr_extra4, v3df_follow);
}
else if (Action == InitActorExtra5Noise)
else if (Action == *AF(InitActorExtra5Noise))
{
PlaySpriteSound(actor, attr_extra5, v3df_follow);
}
else if (Action == InitActorExtra6Noise)
else if (Action == *AF(InitActorExtra6Noise))
{
PlaySpriteSound(actor, attr_extra6, v3df_follow);
}
@ -455,9 +451,9 @@ int DoActorOperate(DSWActor* actor)
DECISION GenericFlaming[] =
{
{30, InitActorAttack},
{512, InitActorRunToward},
{1024, InitActorRunAway},
{30, AF(InitActorAttack)},
{512, AF(InitActorRunToward)},
{1024, AF(InitActorRunAway)},
};
/*
@ -471,9 +467,9 @@ DECISION GenericFlaming[] =
do anymore and then this routine is called again.
*/
ANIMATOR* DoActorActionDecide(DSWActor* actor)
VMFunction* DoActorActionDecide(DSWActor* actor)
{
ANIMATOR* action;
VMFunction* action;
bool ICanSee=false;
// REMINDER: This function is not even called if SpriteControl doesn't let
@ -482,7 +478,7 @@ ANIMATOR* DoActorActionDecide(DSWActor* actor)
ASSERT(actor->user.__legacyState.Personality);
actor->user.Dist = 0;
action = InitActorDecide;
action = *AF(InitActorDecide);
// target is gone.
if (actor->user.targetActor == nullptr)
@ -555,7 +551,7 @@ ANIMATOR* DoActorActionDecide(DSWActor* actor)
// knows, its not a
// target any more
if (actor->hasState(NAME_Duck) && RANDOM_P2(1024<<8)>>8 < 100)
action = InitActorDuck;
action = *AF(InitActorDuck);
else
{
if ((actor->user.ID == COOLG_RUN_R0 && (actor->spr.cstat & CSTAT_SPRITE_TRANSLUCENT)) || (actor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
@ -618,7 +614,7 @@ ANIMATOR* DoActorActionDecide(DSWActor* actor)
//CON_Message("Surprised");
if (!actor->user.DidAlert && ICanSee)
{
DoActorNoise(InitActorAlertNoise, actor);
DoActorNoise(*AF(InitActorAlertNoise), actor);
actor->user.DidAlert = true;
}
return action;
@ -635,7 +631,7 @@ ANIMATOR* DoActorActionDecide(DSWActor* actor)
}
}
//CON_Message("Couldn't resolve decide, InitActorDecide");
//CON_Message("Couldn't resolve decide, AF(InitActorDecide)");
return action;
}
@ -659,13 +655,14 @@ int InitActorDecide(DSWActor* actor)
int DoActorDecide(DSWActor* actor)
{
ANIMATOR* actor_action;
VMFunction* actor_action;
// See what to do next
actor_action = DoActorActionDecide(actor);
// Fix for the GenericFlaming bug for actors that don't have attack states
if (actor_action == InitActorAttack && actor->user.WeaponNum == 0)
if (actor_action == *AF(InitActorAttack) && actor->user.WeaponNum == 0)
return 0; // Just let the actor do as it was doing before in this case
// Target is gone.
@ -673,7 +670,7 @@ int DoActorDecide(DSWActor* actor)
return 0;
// zombie is attacking a player
if (actor_action == InitActorAttack && actor->user.ID == ZOMBIE_RUN_R0 && actor->user.targetActor->user.PlayerP)
if (actor_action == *AF(InitActorAttack) && actor->user.ID == ZOMBIE_RUN_R0 && actor->user.targetActor->user.PlayerP)
{
// Don't let zombies shoot at master
if (GetOwner(actor) == actor->user.targetActor)
@ -686,17 +683,15 @@ int DoActorDecide(DSWActor* actor)
ASSERT(actor_action != nullptr);
if (actor_action != InitActorDecide)
if (actor_action != *AF(InitActorDecide))
{
// NOT staying put
(*actor_action)(actor);
//CON_Message("DoActorDecide: NOT Staying put");
actor->callFunction(actor_action);
}
else
{
// Actually staying put
actor->setStateGroup(NAME_Stand);
//CON_Message("DoActorDecide: Staying put");
}
return 0;

View file

@ -32,32 +32,11 @@ class VMFunction;
BEGIN_SW_NS
// Call functions based on a random range value
struct Decision
{
int range;
VMFunction* action;
};
// Personality structure
struct Personality
{
Decision* Battle;
Decision* Offense;
Decision* Broadcast;
Decision* Surprised;
Decision* Evasive;
Decision* LostTarget;
Decision* CloseRange;
Decision* TouchTarget;
};
// Call functions based on a random range value
struct DECISION
{
int range;
ANIMATOR* action;
VMNativeFunction** action;
};
// Personality structure

View file

@ -43,55 +43,54 @@ int Bunny_Count = 0;
DECISION BunnyBattle[] =
{
{748, InitActorMoveCloser},
{750, InitActorAlertNoise},
{760, InitActorAttackNoise},
{1024, InitActorMoveCloser}
{748, AF(InitActorMoveCloser)},
{750, AF(InitActorAlertNoise)},
{760, AF(InitActorAttackNoise)},
{1024, AF(InitActorMoveCloser)}
};
DECISION BunnyOffense[] =
{
{600, InitActorMoveCloser},
{700, InitActorAlertNoise},
{1024, InitActorMoveCloser}
{600, AF(InitActorMoveCloser)},
{700, AF(InitActorAlertNoise)},
{1024, AF(InitActorMoveCloser)}
};
DECISION BunnyBroadcast[] =
{
{21, InitActorAlertNoise},
{51, InitActorAmbientNoise},
{1024, InitActorDecide}
{21, AF(InitActorAlertNoise)},
{51, AF(InitActorAmbientNoise)},
{1024, AF(InitActorDecide)}
};
DECISION BunnySurprised[] =
{
{500, InitActorRunAway},
{701, InitActorMoveCloser},
{1024, InitActorDecide}
{500, AF(InitActorRunAway)},
{701, AF(InitActorMoveCloser)},
{1024, AF(InitActorDecide)}
};
DECISION BunnyEvasive[] =
{
{500, InitActorWanderAround},
{1020, InitActorRunAway},
{1024, InitActorAmbientNoise}
{500, AF(InitActorWanderAround)},
{1020, AF(InitActorRunAway)},
{1024, AF(InitActorAmbientNoise)}
};
DECISION BunnyLostTarget[] =
{
{900, InitActorFindPlayer},
{1024, InitActorWanderAround}
{900, AF(InitActorFindPlayer)},
{1024, AF(InitActorWanderAround)}
};
DECISION BunnyCloseRange[] =
{
{1024, InitActorAttack },
// {1024, InitActorReposition }
{1024, AF(InitActorAttack) },
};
DECISION BunnyWander[] =
{
{1024, InitActorReposition}
{1024, AF(InitActorReposition)}
};
PERSONALITY WhiteBunnyPersonality =

View file

@ -43,56 +43,52 @@ const int COOLG_BOB_AMT = 8;
DECISION CoolgBattle[] =
{
{50, InitCoolgCircle },
{450, InitActorMoveCloser },
//{456, InitActorAmbientNoise },
//{760, InitActorRunAway },
{1024, InitActorAttack }
{50, AF(InitCoolgCircle ) },
{450, AF(InitActorMoveCloser) },
{1024, AF(InitActorAttack ) }
};
DECISION CoolgOffense[] =
{
{449, InitActorMoveCloser },
//{554, InitActorAmbientNoise },
{1024, InitActorAttack }
{449, AF(InitActorMoveCloser) },
{1024, AF(InitActorAttack ) }
};
DECISION CoolgBroadcast[] =
{
//{1, InitActorAlertNoise },
{1, InitActorAmbientNoise },
{1024, InitActorDecide }
{1, AF(InitActorAmbientNoise) },
{1024, AF(InitActorDecide) }
};
DECISION CoolgSurprised[] =
{
{100, InitCoolgCircle },
{701, InitActorMoveCloser },
{1024, InitActorDecide }
{100, AF(InitCoolgCircle ) },
{701, AF(InitActorMoveCloser) },
{1024, AF(InitActorDecide ) }
};
DECISION CoolgEvasive[] =
{
{20, InitCoolgCircle },
{1024, InitActorRunAway },
{20, AF(InitCoolgCircle) },
{1024, AF(InitActorRunAway) },
};
DECISION CoolgLostTarget[] =
{
{900, InitActorFindPlayer },
{1024, InitActorWanderAround }
{900, AF(InitActorFindPlayer ) },
{1024, AF(InitActorWanderAround) }
};
DECISION CoolgCloseRange[] =
{
{800, InitActorAttack },
{1024, InitActorReposition }
{800, AF(InitActorAttack ) },
{1024, AF(InitActorReposition) }
};
DECISION CoolgTouchTarget[] =
{
//{50, InitCoolgCircle },
{1024, InitActorAttack },
{1024, AF(InitActorAttack) },
};
PERSONALITY CoolgPersonality =

View file

@ -41,49 +41,48 @@ ANIMATOR InitCoolieCharge;
DECISION CoolieBattle[] =
{
{700, InitCoolieCharge },
{990, InitActorMoveCloser },
{1000, InitActorAttackNoise },
{1024, InitActorRunAway }
{700, AF(InitCoolieCharge ) },
{990, AF(InitActorMoveCloser ) },
{1000, AF(InitActorAttackNoise) },
{1024, AF(InitActorRunAway ) }
};
DECISION CoolieOffense[] =
{
{700, InitCoolieCharge },
{1015, InitActorMoveCloser },
{1024, InitActorAttackNoise }
{700, AF(InitCoolieCharge ) },
{1015, AF(InitActorMoveCloser ) },
{1024, AF(InitActorAttackNoise) }
};
DECISION CoolieBroadcast[] =
{
//{1, InitActorAlertNoise },
{16, InitActorAmbientNoise },
{1024, InitActorDecide }
{16, AF(InitActorAmbientNoise) },
{1024, AF(InitActorDecide) }
};
DECISION CoolieSurprised[] =
{
{700, InitActorMoveCloser },
{703, InitActorAmbientNoise },
{1024, InitActorDecide }
{700, AF(InitActorMoveCloser ) },
{703, AF(InitActorAmbientNoise) },
{1024, AF(InitActorDecide ) }
};
DECISION CoolieEvasive[] =
{
{10, InitActorEvade },
{10, AF(InitActorEvade) },
{1024, nullptr }
};
DECISION CoolieLostTarget[] =
{
{900, InitActorFindPlayer },
{1024, InitActorWanderAround }
{900, AF(InitActorFindPlayer ) },
{1024, AF(InitActorWanderAround) }
};
DECISION CoolieCloseRange[] =
{
{400, InitCoolieCharge },
{1024, InitActorReposition }
{400, AF(InitCoolieCharge ) },
{1024, AF(InitActorReposition) }
};
PERSONALITY CooliePersonality =

View file

@ -38,52 +38,52 @@ BEGIN_SW_NS
DECISION EelBattle[] =
{
{649, InitActorMoveCloser },
{650, InitActorAlertNoise },
{1024, InitActorMoveCloser }
{649, AF(InitActorMoveCloser) },
{650, AF(InitActorAlertNoise) },
{1024, AF(InitActorMoveCloser) }
};
DECISION EelOffense[] =
{
{649, InitActorMoveCloser },
{750, InitActorAlertNoise },
{1024, InitActorMoveCloser }
{649, AF(InitActorMoveCloser) },
{750, AF(InitActorAlertNoise) },
{1024, AF(InitActorMoveCloser) }
};
DECISION EelBroadcast[] =
{
{3, InitActorAlertNoise },
{6, InitActorAmbientNoise },
{1024, InitActorDecide }
{3, AF(InitActorAlertNoise ) },
{6, AF(InitActorAmbientNoise) },
{1024, AF( InitActorDecide ) }
};
DECISION EelSurprised[] =
{
{701, InitActorMoveCloser },
{1024, InitActorDecide }
{701, AF(InitActorMoveCloser) },
{1024, AF(InitActorDecide ) }
};
DECISION EelEvasive[] =
{
{ 790, InitActorRunAway },
{1024, InitActorMoveCloser },
{ 790, AF(InitActorRunAway ) },
{1024, AF(InitActorMoveCloser) },
};
DECISION EelLostTarget[] =
{
{900, InitActorFindPlayer },
{1024, InitActorWanderAround }
{900, AF(InitActorFindPlayer ) },
{1024, AF(InitActorWanderAround) }
};
DECISION EelCloseRange[] =
{
{950, InitActorAttack },
{1024, InitActorReposition }
{950, AF(InitActorAttack ) },
{1024, AF(InitActorReposition) }
};
DECISION EelTouchTarget[] =
{
{1024, InitActorAttack },
{1024, AF(InitActorAttack) },
};
PERSONALITY EelPersonality =

View file

@ -2429,8 +2429,33 @@ DEF_ANIMATOR(DoZombiePain)
DEF_ANIMATOR(InitEnemyNuke)
DEF_ANIMATOR(InitEnemyRail)
DEF_ANIMATOR(InitActorRunAway)
DEF_ANIMATOR(InitActorAlertNoise)
DEF_ANIMATOR(InitActorAmbientNoise)
DEF_ANIMATOR(InitActorAttack)
DEF_ANIMATOR(InitActorAttackNoise)
DEF_ANIMATOR(InitActorDuck)
DEF_ANIMATOR(InitActorEvade)
DEF_ANIMATOR(InitActorFindPlayer)
DEF_ANIMATOR(InitActorMoveCloser)
DEF_ANIMATOR(InitActorReposition)
DEF_ANIMATOR(InitActorWanderAround)
DEF_ANIMATOR(InitCoolgCircle)
DEF_ANIMATOR(InitCoolieCharge)
DEF_ANIMATOR(InitHornetCircle)
DEF_ANIMATOR(InitHornetSting)
DEF_ANIMATOR(InitRipper2Charge)
DEF_ANIMATOR(InitRipper2Hang)
DEF_ANIMATOR(InitRipperHang)
DEF_ANIMATOR(InitActorRunToward)
DEF_ANIMATOR(InitActorPainNoise)
DEF_ANIMATOR(InitActorDieNoise)
DEF_ANIMATOR(InitActorExtra1Noise)
DEF_ANIMATOR(InitActorExtra2Noise)
DEF_ANIMATOR(InitActorExtra3Noise)
DEF_ANIMATOR(InitActorExtra4Noise)
DEF_ANIMATOR(InitActorExtra5Noise)
DEF_ANIMATOR(InitActorExtra6Noise)
END_SW_NS
#endif

View file

@ -42,50 +42,44 @@ BEGIN_SW_NS
DECISION GirlNinjaBattle[] =
{
{499, InitActorMoveCloser},
//{509, InitActorAmbientNoise},
//{710, InitActorRunAway},
{1024, InitActorAttack}
{499, AF(InitActorMoveCloser)},
{1024, AF(InitActorAttack)}
};
DECISION GirlNinjaOffense[] =
{
{499, InitActorMoveCloser},
//{509, InitActorAmbientNoise},
{1024, InitActorAttack}
{499, AF(InitActorMoveCloser)},
{1024, AF(InitActorAttack)}
};
DECISION GirlNinjaBroadcast[] =
{
//{1, InitActorAlertNoise},
{6, InitActorAmbientNoise},
{1024, InitActorDecide}
{6, AF(InitActorAmbientNoise)},
{1024, AF(InitActorDecide)}
};
DECISION GirlNinjaSurprised[] =
{
{701, InitActorMoveCloser},
{1024, InitActorDecide}
{701, AF(InitActorMoveCloser)},
{1024, AF(InitActorDecide)}
};
DECISION GirlNinjaEvasive[] =
{
{400, InitActorDuck}, // 100
// {300, InitActorEvade},
// {800, InitActorRunAway},
{400, AF(InitActorDuck)}, // 100
{1024, nullptr}
};
DECISION GirlNinjaLostTarget[] =
{
{900, InitActorFindPlayer},
{1024, InitActorWanderAround}
{900, AF(InitActorFindPlayer)},
{1024, AF(InitActorWanderAround)}
};
DECISION GirlNinjaCloseRange[] =
{
{900, InitActorAttack },
{1024, InitActorReposition }
{900, AF(InitActorAttack ) },
{1024, AF(InitActorReposition) }
};
/*

View file

@ -43,46 +43,46 @@ BEGIN_SW_NS
DECISION GoroBattle[] =
{
{697, InitActorMoveCloser },
{700, InitActorAmbientNoise },
{1024, InitActorAttack }
{697, AF(InitActorMoveCloser ) },
{700, AF(InitActorAmbientNoise) },
{1024, AF(InitActorAttack ) }
};
DECISION GoroOffense[] =
{
{797, InitActorMoveCloser },
{800, InitActorAttackNoise },
{1024, InitActorAttack }
{797, AF(InitActorMoveCloser ) },
{800, AF(InitActorAttackNoise) },
{1024, AF(InitActorAttack ) }
};
DECISION GoroBroadcast[] =
{
{3, InitActorAmbientNoise },
{1024, InitActorDecide }
{3, AF(InitActorAmbientNoise) },
{1024, AF( InitActorDecide ) }
};
DECISION GoroSurprised[] =
{
{701, InitActorMoveCloser },
{1024, InitActorDecide }
{701, AF(InitActorMoveCloser) },
{1024, AF(InitActorDecide ) }
};
DECISION GoroEvasive[] =
{
{10, InitActorEvade },
{1024, InitActorMoveCloser }
{10, AF(InitActorEvade ) },
{1024, AF(InitActorMoveCloser) }
};
DECISION GoroLostTarget[] =
{
{900, InitActorFindPlayer },
{1024, InitActorWanderAround }
{900, AF(InitActorFindPlayer ) },
{1024, AF(InitActorWanderAround) }
};
DECISION GoroCloseRange[] =
{
{700, InitActorAttack },
{1024, InitActorReposition }
{700, AF(InitActorAttack ) },
{1024, AF(InitActorReposition) }
};
PERSONALITY GoroPersonality =

View file

@ -42,56 +42,56 @@ ANIMATOR DoHornetCircle, InitHornetCircle;
DECISION HornetBattle[] =
{
{50, InitHornetCircle },
{798, InitActorMoveCloser },
{800, InitActorAlertNoise },
{1024, InitActorRunAway }
{50, AF(InitHornetCircle ) },
{798, AF(InitActorMoveCloser) },
{800, AF(InitActorAlertNoise) },
{1024, AF(InitActorRunAway ) }
};
DECISION HornetOffense[] =
{
{1022, InitActorMoveCloser },
{1024, InitActorAlertNoise }
{1022, AF(InitActorMoveCloser) },
{1024, AF(InitActorAlertNoise) }
};
DECISION HornetBroadcast[] =
{
{3, InitActorAlertNoise },
{6, InitActorAmbientNoise },
{1024, InitActorDecide }
{3, AF(InitActorAlertNoise ) },
{6, AF(InitActorAmbientNoise) },
{1024, AF( InitActorDecide ) }
};
DECISION HornetSurprised[] =
{
{100, InitHornetCircle },
{701, InitActorMoveCloser },
{1024, InitActorDecide }
{100, AF(InitHornetCircle ) },
{701, AF(InitActorMoveCloser) },
{1024, AF(InitActorDecide ) }
};
DECISION HornetEvasive[] =
{
{20, InitHornetCircle },
{20, AF(InitHornetCircle) },
{1024, nullptr },
};
DECISION HornetLostTarget[] =
{
{900, InitActorFindPlayer },
{1024, InitActorWanderAround }
{900, AF(InitActorFindPlayer) },
{1024, AF(InitActorWanderAround) }
};
DECISION HornetCloseRange[] =
{
{900, InitActorMoveCloser },
{1024, InitActorReposition }
{900, AF(InitActorMoveCloser) },
{1024, AF(InitActorReposition) }
};
ANIMATOR InitHornetSting;
DECISION HornetTouchTarget[] =
{
{500, InitHornetCircle },
{1024, InitHornetSting }
{500, AF(InitHornetCircle) },
{1024, AF(InitHornetSting ) }
};
PERSONALITY HornetPersonality =

View file

@ -38,48 +38,48 @@ BEGIN_SW_NS
DECISION LavaBattle[] =
{
{600, InitActorMoveCloser },
{700, InitActorAlertNoise },
{710, InitActorRunAway },
{1024, InitActorAttack }
{600, AF(InitActorMoveCloser) },
{700, AF(InitActorAlertNoise) },
{710, AF(InitActorRunAway ) },
{1024, AF(InitActorAttack ) }
};
DECISION LavaOffense[] =
{
{700, InitActorMoveCloser },
{800, InitActorAlertNoise },
{1024, InitActorAttack }
{700, AF(InitActorMoveCloser) },
{800, AF(InitActorAlertNoise) },
{1024, AF(InitActorAttack ) }
};
DECISION LavaBroadcast[] =
{
{21, InitActorAlertNoise },
{51, InitActorAmbientNoise },
{1024, InitActorDecide }
{21, AF(InitActorAlertNoise ) },
{51, AF(InitActorAmbientNoise) },
{1024, AF(InitActorDecide ) }
};
DECISION LavaSurprised[] =
{
{701, InitActorMoveCloser },
{1024, InitActorDecide }
{701, AF(InitActorMoveCloser) },
{1024, AF(InitActorDecide ) }
};
DECISION LavaEvasive[] =
{
{10, InitActorEvade },
{10, AF(InitActorEvade) },
{1024, nullptr }
};
DECISION LavaLostTarget[] =
{
{900, InitActorFindPlayer },
{1024, InitActorWanderAround }
{900, AF(InitActorFindPlayer ) },
{1024, AF(InitActorWanderAround) }
};
DECISION LavaCloseRange[] =
{
{700, InitActorAttack },
{1024, InitActorReposition }
{700, AF(InitActorAttack ) },
{1024, AF(InitActorReposition) }
};
PERSONALITY LavaPersonality =

View file

@ -56,50 +56,44 @@ BEGIN_SW_NS
DECISION NinjaBattle[] =
{
{499, InitActorMoveCloser},
//{509, InitActorAmbientNoise},
//{710, InitActorRunAway},
{1024, InitActorAttack}
{499, AF(InitActorMoveCloser)},
{1024, AF(InitActorAttack)}
};
DECISION NinjaOffense[] =
{
{499, InitActorMoveCloser},
//{509, InitActorAmbientNoise},
{1024, InitActorAttack}
{499, AF(InitActorMoveCloser)},
{1024, AF(InitActorAttack)}
};
DECISION NinjaBroadcast[] =
{
//{1, InitActorAlertNoise},
{6, InitActorAmbientNoise},
{1024, InitActorDecide}
{6, AF(InitActorAmbientNoise)},
{1024, AF(InitActorDecide)}
};
DECISION NinjaSurprised[] =
{
{701, InitActorMoveCloser},
{1024, InitActorDecide}
{701, AF(InitActorMoveCloser)},
{1024, AF(InitActorDecide)}
};
DECISION NinjaEvasive[] =
{
{400, InitActorDuck}, // 100
// {300, InitActorEvade},
// {800, InitActorRunAway},
{400, AF(InitActorDuck)}, // 100
{1024, nullptr}
};
DECISION NinjaLostTarget[] =
{
{900, InitActorFindPlayer},
{1024, InitActorWanderAround}
{900, AF(InitActorFindPlayer)},
{1024, AF(InitActorWanderAround)}
};
DECISION NinjaCloseRange[] =
{
{700, InitActorAttack },
{1024, InitActorReposition }
{700, AF(InitActorAttack ) },
{1024, AF(InitActorReposition) }
};
/*
@ -123,15 +117,15 @@ PERSONALITY NinjaPersonality =
// Sniper Ninjas
DECISION NinjaSniperRoam[] =
{
{1023, InitActorDuck},
{1024, InitActorAmbientNoise},
{1023, AF(InitActorDuck)},
{1024, AF(InitActorAmbientNoise)},
};
DECISION NinjaSniperBattle[] =
{
{499, InitActorDuck},
{500, InitActorAmbientNoise},
{1024, InitActorAttack}
{499, AF(InitActorDuck)},
{500, AF(InitActorAmbientNoise)},
{1024, AF(InitActorAttack)}
};
PERSONALITY NinjaSniperPersonality =

View file

@ -42,50 +42,49 @@ ANIMATOR InitRipperHang;
DECISION RipperBattle[] =
{
{748, InitActorMoveCloser},
{750, InitActorAlertNoise},
// {900, InitRipperHang},
{755, InitActorAttackNoise},
{1024, InitActorAttack}
{748, AF(InitActorMoveCloser)},
{750, AF(InitActorAlertNoise)},
{755, AF(InitActorAttackNoise)},
{1024, AF(InitActorAttack)}
};
DECISION RipperOffense[] =
{
{700, InitActorMoveCloser},
{710, InitActorAlertNoise},
{1024, InitActorAttack}
{700, AF(InitActorMoveCloser)},
{710, AF(InitActorAlertNoise)},
{1024, AF(InitActorAttack)}
};
DECISION RipperBroadcast[] =
{
{3, InitActorAlertNoise},
{6, InitActorAmbientNoise},
{1024, InitActorDecide}
{3, AF(InitActorAlertNoise)},
{6, AF(InitActorAmbientNoise)},
{1024, AF(InitActorDecide)}
};
DECISION RipperSurprised[] =
{
{30, InitRipperHang},
{701, InitActorMoveCloser},
{1024, InitActorDecide}
{30, AF(InitRipperHang)},
{701, AF(InitActorMoveCloser)},
{1024, AF(InitActorDecide)}
};
DECISION RipperEvasive[] =
{
{6, InitRipperHang},
{6, AF(InitRipperHang)},
{1024, nullptr}
};
DECISION RipperLostTarget[] =
{
{980, InitActorFindPlayer},
{1024, InitActorWanderAround}
{980, AF(InitActorFindPlayer)},
{1024, AF(InitActorWanderAround)}
};
DECISION RipperCloseRange[] =
{
{900, InitActorAttack },
{1024, InitActorReposition }
{900, AF(InitActorAttack ) },
{1024, AF(InitActorReposition) }
};
PERSONALITY RipperPersonality =

View file

@ -41,48 +41,48 @@ ANIMATOR InitRipper2Hang, InitRipper2Charge;
DECISION Ripper2Battle[] =
{
{879, InitRipper2Charge},
{883, InitActorAttackNoise},
{900, InitRipper2Hang},
{1024, InitActorAttack}
{879, AF(InitRipper2Charge)},
{883, AF(InitActorAttackNoise)},
{900, AF(InitRipper2Hang)},
{1024, AF(InitActorAttack)}
};
DECISION Ripper2Offense[] =
{
{789, InitActorMoveCloser},
{790, InitActorAttackNoise},
{800, InitRipper2Hang},
{1024, InitActorAttack}
{789, AF(InitActorMoveCloser)},
{790, AF(InitActorAttackNoise)},
{800, AF(InitRipper2Hang)},
{1024, AF(InitActorAttack)}
};
DECISION Ripper2Broadcast[] =
{
{3, InitActorAmbientNoise},
{1024, InitActorDecide}
{3, AF(InitActorAmbientNoise)},
{1024, AF(InitActorDecide)}
};
DECISION Ripper2Surprised[] =
{
{40, InitRipper2Hang},
{701, InitActorMoveCloser},
{1024, InitActorDecide}
{40, AF(InitRipper2Hang)},
{701, AF(InitActorMoveCloser)},
{1024, AF(InitActorDecide)}
};
DECISION Ripper2Evasive[] =
{
{10, InitActorMoveCloser},
{1024, InitRipper2Charge}
{10, AF(InitActorMoveCloser)},
{1024, AF(InitRipper2Charge)}
};
DECISION Ripper2LostTarget[] =
{
{900, InitActorFindPlayer},
{1024, InitActorWanderAround}
{900, AF(InitActorFindPlayer)},
{1024, AF(InitActorWanderAround)}
};
DECISION Ripper2CloseRange[] =
{
{1024, InitActorAttack }
{1024, AF(InitActorAttack) }
};
PERSONALITY Ripper2Personality =

View file

@ -39,49 +39,48 @@ BEGIN_SW_NS
DECISION SerpBattle[] =
{
{670, InitActorMoveCloser },
{700, InitActorAmbientNoise },
{710, InitActorRunAway },
{1024, InitActorAttack }
{670, AF(InitActorMoveCloser ) },
{700, AF(InitActorAmbientNoise) },
{710, AF(InitActorRunAway ) },
{1024, AF(InitActorAttack ) }
};
DECISION SerpOffense[] =
{
{775, InitActorMoveCloser },
{800, InitActorAmbientNoise },
{1024, InitActorAttack }
{775, AF(InitActorMoveCloser ) },
{800, AF(InitActorAmbientNoise) },
{1024, AF(InitActorAttack ) }
};
DECISION SerpBroadcast[] =
{
//{21, InitActorAlertNoise },
{10, InitActorAmbientNoise },
{1024, InitActorDecide }
{10, AF(InitActorAmbientNoise) },
{1024, AF(InitActorDecide ) }
};
DECISION SerpSurprised[] =
{
{701, InitActorMoveCloser },
{1024, InitActorDecide }
{701, AF(InitActorMoveCloser) },
{1024, AF(InitActorDecide ) }
};
DECISION SerpEvasive[] =
{
{10, InitActorEvade },
{10, AF(InitActorEvade) },
{1024, nullptr }
};
DECISION SerpLostTarget[] =
{
{900, InitActorFindPlayer },
{921, InitActorAmbientNoise },
{1024, InitActorWanderAround }
{900, AF(InitActorFindPlayer ) },
{921, AF(InitActorAmbientNoise) },
{1024, AF(InitActorWanderAround) }
};
DECISION SerpCloseRange[] =
{
{700, InitActorAttack },
{1024, InitActorReposition }
{700, AF(InitActorAttack ) },
{1024, AF(InitActorReposition) }
};
PERSONALITY SerpPersonality =

View file

@ -36,49 +36,49 @@ BEGIN_SW_NS
DECISION SkelBattle[] =
{
{600, InitActorMoveCloser },
{602, InitActorAlertNoise },
{700, InitActorRunAway },
{1024, InitActorAttack }
{600, AF(InitActorMoveCloser) },
{602, AF(InitActorAlertNoise) },
{700, AF(InitActorRunAway ) },
{1024, AF(InitActorAttack ) }
};
DECISION SkelOffense[] =
{
{700, InitActorMoveCloser },
{702, InitActorAlertNoise },
{1024, InitActorAttack }
{700, AF(InitActorMoveCloser) },
{702, AF(InitActorAlertNoise) },
{1024, AF(InitActorAttack ) }
};
DECISION SkelBroadcast[] =
{
{3, InitActorAlertNoise },
{6, InitActorAmbientNoise },
{1024, InitActorDecide }
{3, AF(InitActorAlertNoise ) },
{6, AF(InitActorAmbientNoise) },
{1024, AF( InitActorDecide ) }
};
DECISION SkelSurprised[] =
{
{701, InitActorMoveCloser },
{1024, InitActorDecide }
{701, AF(InitActorMoveCloser) },
{1024, AF(InitActorDecide ) }
};
DECISION SkelEvasive[] =
{
{22, InitActorDuck },
{30, InitActorEvade },
{22, AF(InitActorDuck ) },
{30, AF(InitActorEvade) },
{1024, nullptr },
};
DECISION SkelLostTarget[] =
{
{900, InitActorFindPlayer },
{1024, InitActorWanderAround }
{900, AF(InitActorFindPlayer ) },
{1024, AF(InitActorWanderAround) }
};
DECISION SkelCloseRange[] =
{
{800, InitActorAttack },
{1024, InitActorReposition }
{800, AF(InitActorAttack ) },
{1024, AF(InitActorReposition) }
};
PERSONALITY SkelPersonality =

View file

@ -55,46 +55,46 @@ ANIMATOR InitSumoCharge;
DECISION SumoBattle[] =
{
{690, InitActorMoveCloser },
{692, InitActorAlertNoise },
{1024, InitActorAttack }
{690, AF(InitActorMoveCloser) },
{692, AF(InitActorAlertNoise) },
{1024, AF(InitActorAttack ) }
};
DECISION SumoOffense[] =
{
{690, InitActorMoveCloser },
{692, InitActorAlertNoise },
{1024, InitActorAttack }
{690, AF(InitActorMoveCloser) },
{692, AF(InitActorAlertNoise) },
{1024, AF(InitActorAttack ) }
};
DECISION SumoBroadcast[] =
{
{2, InitActorAlertNoise },
{4, InitActorAmbientNoise },
{1024, InitActorDecide }
{2, AF(InitActorAlertNoise ) },
{4, AF(InitActorAmbientNoise) },
{1024, AF(InitActorDecide ) }
};
DECISION SumoSurprised[] =
{
{700, InitActorMoveCloser },
{703, InitActorAlertNoise },
{1024, InitActorDecide }
{700, AF(InitActorMoveCloser) },
{703, AF(InitActorAlertNoise) },
{1024, AF(InitActorDecide ) }
};
DECISION SumoEvasive[] =
{
{1024, InitActorAttack }
{1024, AF(InitActorAttack) }
};
DECISION SumoLostTarget[] =
{
{900, InitActorFindPlayer },
{1024, InitActorWanderAround }
{900, AF(InitActorFindPlayer ) },
{1024, AF(InitActorWanderAround) }
};
DECISION SumoCloseRange[] =
{
{1024, InitActorAttack }
{1024, AF(InitActorAttack) }
};
PERSONALITY SumoPersonality =

View file

@ -54,6 +54,7 @@ public:
bool hasState(FName label, int substate = 0);
void callAction();
void callStateAction();
void callFunction(VMFunction* func);
};

View file

@ -40,48 +40,48 @@ BEGIN_SW_NS
DECISION ZillaBattle[] =
{
{100, InitActorRunAway },
{690, InitActorMoveCloser },
{692, InitActorAlertNoise },
{1024, InitActorAttack }
{100, AF(InitActorRunAway ) },
{690, AF(InitActorMoveCloser) },
{692, AF(InitActorAlertNoise) },
{1024, AF(InitActorAttack ) }
};
DECISION ZillaOffense[] =
{
{100, InitActorRunAway },
{690, InitActorMoveCloser },
{692, InitActorAlertNoise },
{1024, InitActorAttack }
{100, AF(InitActorRunAway ) },
{690, AF(InitActorMoveCloser) },
{692, AF(InitActorAlertNoise) },
{1024, AF(InitActorAttack ) }
};
DECISION ZillaBroadcast[] =
{
{2, InitActorAlertNoise },
{4, InitActorAmbientNoise },
{1024, InitActorDecide }
{2, AF(InitActorAlertNoise ) },
{4, AF(InitActorAmbientNoise) },
{1024, AF(InitActorDecide ) }
};
DECISION ZillaSurprised[] =
{
{700, InitActorMoveCloser },
{703, InitActorAlertNoise },
{1024, InitActorDecide }
{700, AF(InitActorMoveCloser) },
{703, AF(InitActorAlertNoise) },
{1024, AF(InitActorDecide ) }
};
DECISION ZillaEvasive[] =
{
{1024, InitActorWanderAround }
{1024, AF(InitActorWanderAround) }
};
DECISION ZillaLostTarget[] =
{
{900, InitActorFindPlayer },
{1024, InitActorWanderAround }
{900, AF(InitActorFindPlayer ) },
{1024, AF(InitActorWanderAround) }
};
DECISION ZillaCloseRange[] =
{
{1024, InitActorAttack }
{1024, AF(InitActorAttack) }
};
PERSONALITY ZillaPersonality =

View file

@ -44,44 +44,44 @@ BEGIN_SW_NS
DECISION ZombieBattle[] =
{
{399, InitActorMoveCloser},
{1024, InitActorAttack}
{399, AF(InitActorMoveCloser)},
{1024, AF(InitActorAttack)}
};
DECISION ZombieOffense[] =
{
{399, InitActorMoveCloser},
{1024, InitActorAttack}
{399, AF(InitActorMoveCloser)},
{1024, AF(InitActorAttack)}
};
DECISION ZombieBroadcast[] =
{
{6, InitActorAmbientNoise},
{1024, InitActorDecide}
{6, AF(InitActorAmbientNoise)},
{1024, AF(InitActorDecide)}
};
DECISION ZombieSurprised[] =
{
{701, InitActorMoveCloser},
{1024, InitActorDecide}
{701, AF(InitActorMoveCloser)},
{1024, AF(InitActorDecide)}
};
DECISION ZombieEvasive[] =
{
{400, InitActorDuck},
{400, AF(InitActorDuck)},
{1024, nullptr}
};
DECISION ZombieLostTarget[] =
{
{900, InitActorFindPlayer},
{1024, InitActorWanderAround}
{900, AF(InitActorFindPlayer)},
{1024, AF(InitActorWanderAround)}
};
DECISION ZombieCloseRange[] =
{
{800, InitActorAttack },
{1024, InitActorReposition }
{800, AF(InitActorAttack ) },
{1024, AF(InitActorReposition) }
};
PERSONALITY ZombiePersonality =