public override float GetWeight(Phenix.Unity.AI.WorldState ws) { return(0); if (Agent.BlackBoard.HasAttackTarget == false) { return(0); } if (Agent.BlackBoard.DesiredTargetInWeaponRange) { return(0); } if (Agent.BlackBoard.motionType != MotionType.NONE && Agent.BlackBoard.motionType != MotionType.ANIMATION_DRIVE) { return(0); } if (ws.Get((int)WorldStatePropType.WILL_PLAY_ANIM)) { return(Agent.BlackBoard.GOAPMaxWeightShow); } else if (Random.Range(0, 100) < 1) { ws.Set((int)WorldStatePropType.WILL_PLAY_ANIM, true); } return(0); }
//public override bool IsAborted() //{ // return false; //} public override float GetWeight(Phenix.Unity.AI.WorldState ws) { if (ws.Get((int)WorldStatePropType.REACT_TO_DAMAGE)) { return(1f); } return(0); }
public override float GetWeight(Phenix.Unity.AI.WorldState ws) { if (Agent.BlackBoard.HasAttackTarget == false) { return(0); } if (ws.Get((int)WorldStatePropType.LOOKING_AT_TARGET)) { return(0); } if (ws.Get((int)WorldStatePropType.IN_WEAPON_RANGE)) { return(0); } return(Mathf.Min(Agent.BlackBoard.GOAPMaxWeightAlert, Agent.BlackBoard.ForwardAngleToDesiredTarget * 0.01f)); }
//public override bool IsAborted() //{ // return false; //} public override float GetWeight(Phenix.Unity.AI.WorldState ws) { if (ws.Get((int)WorldStatePropType.IN_IDLE) && Agent.BlackBoard.WeaponInHand && (Agent.BlackBoard.HasAttackTarget == false)) { return(Agent.BlackBoard.GOAPMaxWeightCalm); } return(0); }
public override float GetWeight(Phenix.Unity.AI.WorldState ws) { if (IsRunning && Agent.BlackBoard.InRollMotion) { return(Agent.BlackBoard.GOAPMaxWeightRetreat); } if (Agent.BlackBoard.HasAttackTarget == false) { return(0); } //if (Agent.BlackBoard.Fear < Agent.BlackBoard.maxFear * 0.25f) // return 0; // 后面有人 if (Agent.Decision.GetNearestAgent(Direction.Backward, 0.4f, Game1.Instance.AgentMgr.agents) != null) { return(0); } if (ws.Get((int)WorldStatePropType.IN_COMBAT_RANGE) == false) { return(0); } if (Agent.BlackBoard.InAttackCD) { return(Mathf.Min(Agent.BlackBoard.GOAPMaxWeightRetreat * Agent.BlackBoard.desiredTarget.BlackBoard.weaponRange / Agent.BlackBoard.DistanceToDesiredTarget, Agent.BlackBoard.GOAPMaxWeightRetreat)); } float ret = Agent.BlackBoard.GOAPMaxWeightRetreat * (Agent.BlackBoard.Fear * 0.01f); if (Agent.BlackBoard.DistanceToDesiredTarget <= Agent.BlackBoard.desiredTarget.BlackBoard.weaponRange) { ret += 0.2f; } if (Agent.BlackBoard.AheadOfDesiredTarget == false) { ret *= 0.5f; } if (ret > Agent.BlackBoard.GOAPMaxWeightRetreat) { ret = Agent.BlackBoard.GOAPMaxWeightRetreat; } return(ret); }
//public override bool IsAborted() //{ // return false; //} public override float GetWeight(Phenix.Unity.AI.WorldState ws) { if (ws.Get((int)WorldStatePropType.ORDER_ATTACK)) { return(Agent.BlackBoard.GOAPMaxWeightOrderAttack); } else { OrderDataAttack order = Agent.PlayerOrder.GetCurOrder() as OrderDataAttack; if (order != null) { ws.Set((int)WorldStatePropType.ORDER_ATTACK, true); return(Agent.BlackBoard.GOAPMaxWeightOrderAttack); } } return(0); }
public override float GetWeight(Phenix.Unity.AI.WorldState ws) { if (Agent.BlackBoard.HasAttackTarget == false) { return(0); } // 前面有人 if (Agent.Decision.GetNearestAgent(Direction.Forward, 0.4f, Game1.Instance.AgentMgr.agents) != null) { return(0); } if (ws.Get((int)WorldStatePropType.IN_COMBAT_RANGE)) { return(0); } return(Mathf.Min(Agent.BlackBoard.GOAPMaxWeightPress, (Agent.BlackBoard.DistanceToDesiredTarget - Agent.BlackBoard.combatRange) * 0.3f)); }