public void Spell(WiccanRede.AI.ActionInfo info) { Vector3 pos = player.GetPosition(); //Logging.Logger.AddInfo(info.ToString()); pos.Y += 50; Vector3 dir = info.targetPosition - pos; dir.Normalize(); player.SetDirection(dir); logic.Spell(info); }
/// <summary> /// take action from game - this mean for example damage for NPC from player /// </summary> /// <param name="npcName">NPC which is affected</param> /// <param name="info">info about action</param> public void AcceptAction(string npcName, ActionInfo info) { if (npcName == "Player") { this.player.SufferDamage(info.action.enemyHpTaken); this.player.DrainMana(info.action.enemyManaDrain); return; } foreach (NPC npc in this.npcs) { if (npc.character.name == npcName) { npc.SufferDamage(info.action.enemyHpTaken); npc.DrainMana(info.action.enemyManaDrain); if (npc.TargetedEnemy == null) { npc.RegisterAttack(this.player); } break; } } }
public void Spell(ActionInfo info) { }