public void InitEnemyProfile(EnemyProfile _profile) { hp = _profile.hp; agent.acceleration = _profile.speed; attackRange = _profile.attackRange; warningRange = _profile.warningRange; baseWeapon = _profile.basicWeapon; }
private void EnemyDeath(EnemyProfile slainEnemy) { for (int i = 0; i < objectives.Length; i++) { if (slainEnemy == objectives[i].requiredEnemy) { CurrentAmount[i]++; Debug.Log("Current Amount" + CurrentAmount[i]); } } Evaluate(); }
void LoadProfile() { if (m_profile == null) { m_profile = UnityEditor.AssetDatabase.LoadAssetAtPath <EnemyProfile>("Assets/Resources/EnemyProfile.asset"); if (m_profile == null) { var asset = ScriptableObject.CreateInstance <EnemyProfile>(); UnityEditor.AssetDatabase.CreateAsset(asset, "Assets/Resources/EnemyProfile.asset"); UnityEditor.AssetDatabase.Refresh(); m_profile = UnityEditor.AssetDatabase.LoadAssetAtPath <EnemyProfile>("Assets/Resources/EnemyProfile.asset"); } } }
public EnemyProfile CloneEnemy(EnemyProfile Enemy) { EnemyProfile NewEnemy = new EnemyProfile(); NewEnemy.name = Enemy.name; NewEnemy.Weapon = CloneItem(Enemy.Weapon); NewEnemy.HPBonus = Enemy.HPBonus; NewEnemy.armor = Enemy.armor; NewEnemy.Money = Enemy.Money; NewEnemy.KillMessage = Enemy.KillMessage; NewEnemy.DeathMessage = Enemy.DeathMessage; NewEnemy.PayOff = Enemy.PayOff; NewEnemy.PayOffResponse = Enemy.PayOffResponse; NewEnemy.XP = Enemy.XP; NewEnemy.Behaviour = Enemy.Behaviour; //NewEnemy.ImagePath = Enemy.ImagePath; //NewEnemy.ImageLocation = Enemy.ImageLocation; return(NewEnemy); }
public EnemyProfile CloneEnemy(EnemyProfile Enemy) { EnemyProfile NewEnemy = new EnemyProfile(); NewEnemy.name = Enemy.name; NewEnemy.Weapon = CloneItem(Enemy.Weapon); NewEnemy.HPBonus = Enemy.HPBonus; NewEnemy.armor = Enemy.armor; NewEnemy.Money = Enemy.Money; NewEnemy.KillMessage = Enemy.KillMessage; NewEnemy.DeathMessage = Enemy.DeathMessage; NewEnemy.PayOff = Enemy.PayOff; NewEnemy.PayOffResponse = Enemy.PayOffResponse; NewEnemy.XP = Enemy.XP; NewEnemy.Behaviour = Enemy.Behaviour; //NewEnemy.ImagePath = Enemy.ImagePath; //NewEnemy.ImageLocation = Enemy.ImageLocation; return NewEnemy; }
public ChangeEnemyParams(EnemyProfile _enemyProfile) : base(_enemyProfile) { enemyProfile = _enemyProfile; }
void Awake() { agent = GetComponent <NavMeshAgent>(); profile = GetComponent <Enemy>().settings; path = new NavMeshPath(); }
// Use this for initialization void Start() { _profile = GetComponent <EnemyProfile>(); _animator = GetComponent <Animator>(); }
public static void StartFight(string NPCname) { int index = 0; bool NPCFound = false; if (CurrentRoom.Civilians != null) { while (NPCFound == false && index < CurrentRoom.Civilians.Count) { if (NPCname.ToLower() == CurrentRoom.Civilians[index].name.ToLower()) { NPCFound = true; if (CurrentRoom.Enemy == null) { CurrentRoom.Enemy = new List<EnemyProfile>(); } if (CurrentRoom.Civilians[index].QuestCharacter == false) { EnemyProfile NewEnemy = new EnemyProfile(); NewEnemy.name = CurrentRoom.Civilians[index].name; NewEnemy.Money = CurrentRoom.Civilians[index].Money; NewEnemy.HPBonus = CurrentRoom.Civilians[index].HPBonus; NewEnemy.armor = CurrentRoom.Civilians[index].armor; NewEnemy.XP = CurrentRoom.Civilians[index].XP; NewEnemy.PayOff = 0; NewEnemy.Weapon.Class = "Weapon"; NewEnemy.Weapon.AttackMod = 1; NewEnemy.Weapon.CanPickUp = false; NewEnemy.Weapon.Name = "fists"; NewEnemy.Behaviour = "AttackPlayer"; if (CurrentRoom.items == null) CurrentRoom.items = new List<itemInfo>(); if (CurrentRoom.Civilians[index].inventory != null && CurrentRoom.Civilians[index].inventory.Count > 0) { for (int counter = 0; counter < CurrentRoom.Civilians[index].inventory.Count; counter++) { if (CurrentRoom.Civilians[index].inventory[counter].Class == "Weapon" && NewEnemy.Weapon.AttackMod < CurrentRoom.Civilians[index].inventory[counter].AttackMod) { NewEnemy.Weapon = CurrentRoom.Civilians[index].inventory[counter]; } else CurrentRoom.items.Add(CurrentRoom.Civilians[index].inventory[counter]); } } CurrentRoom.Enemy.Add(NewEnemy); CurrentRoom.Civilians.RemoveAt(index); SurpriseAttack(NewEnemy.name); } else { NPCFound = true; LoDConsole.WriteLine(WordWrap(string.Concat("Starting a fight with ", CurrentRoom.Civilians[index].name, " is not a good idea"))); } } index++; } if (NPCFound == false) LoDConsole.WriteLine("Cannot find that person here"); } else LoDConsole.WriteLine("There is nobody around here to fight"); }
public static EnemyProfile GainXPfromEnemy(EnemyProfile Enemy) { if (Enemy.XP > 0) Player.XP = Player.XP + Enemy.XP; Enemy.XP = 0; return Enemy; }