Aller au contenu

Question about "flat-footed"


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
Guest_Scrotok_*

Guest_Scrotok_*
  • Guests
Hi all!

Is there a way to determine whether someone is "flat-footed" via scripting?

http://nwn.wikia.com/wiki/Flat-foot

Thanks!
JP

#2
henesua

henesua
  • Members
  • 3 883 messages
good question.

#3
Shadooow

Shadooow
  • Members
  • 4 472 messages
in vanilla nwn all you can do is to check if the current action is ACTION_INVALID, character who does nothing is likely being flatfooted

action_invalid is returned alsoi in case of using healers kit, but that makes char flatfooted so no prob, question is what is the return of this function when character is walking via keyboard and not mouse (which makes no action in queve)

it is cetainly not reliable, but without NWNX you hardly can do better

NWNX related, I have developd both function getisflatfooted and getisflanked, sent source to the Terra777 as I added it into his nwnx_funcs, don't know if he already released a new version though

#4
Shadooow

Shadooow
  • Members
  • 4 472 messages

int GetIsFlatfooted(object oCreature=OBJECT_SELF)
{
 if(GetHasFeat(FEAT_UNCANNY_REFLEX,oCreature))
 {
 return FALSE;
 }
 switch(GetCurrentAction(oCreature))
 {
 case ACTION_DISABLETRAP:
 case ACTION_EXAMINETRAP:
 case ACTION_FLAGTRAP:
 case ACTION_INVALID:
 case ACTION_LOCK:
 case ACTION_OPENLOCK:
 case ACTION_RECOVERTRAP:
 case ACTION_REST:
 case ACTION_SETTRAP:
 case ACTION_SIT:
 case ACTION_TAUNT:
 case ACTION_WAIT:
    return TRUE;
 }
int bBlindFight = GetHasFeat(FEAT_BLIND_FIGHT,oCreature);
effect e = GetFirstEffect(oCreature);
 while(GetIsEffectValid(e))
 {
  switch(GetEffectType(e))
  {
  case EFFECT_TYPE_ENTANGLE:
  case EFFECT_TYPE_CUTSCENEIMMOBILIZE:
      return TRUE;
  case EFFECT_TYPE_BLINDNESS:
      if(!bBlindFight) return TRUE;
  break;
  }
 e = GetNextEffect(oCreature);
 }
return GetMovementRate(oCreature) < 2;
}

there is a custom function inside NWScript. Its definitely not 100% reliable and there might be some other circumstances I have missed or misinterpreted.

Im unsure whether the creature is already flatfooted when she has the action to open lock assigned, but she is running towards locked object. As well I dont even know if its ACTION_OPENLOCK returned in such moment. Also I dont know whether cutscene immobilize effect type ID is correctly returned by the function GetEffectType - lexicon says nothing about any weirdness so I guess it does.

Modifié par ShaDoOoW, 01 décembre 2012 - 09:15 .