コード例 #1
0
        public override string endEncounter()
        {
            var messages = "";

            if (playerList.Count > 0)
            {
                if (deadPlayers.Count == 0)
                {
                    messages = "The quest was successful and there were no casualties";
                }
                else
                {
                    var message = "The quest was successful but there were losses. ";
                    foreach (Game.Agents.Agent player in deadPlayers)
                    {
                        message += player.GetName() + " ";
                    }
                    message += "perished. However, ";
                    foreach (Game.Agents.Agent player in playerList)
                    {
                        message += player.GetName() + " ";
                    }
                    message += "managed to make it out alive after finishing off the monsters.";
                    messages = message;
                }
            }
            else
            {
                messages = "The quest has failed and all party members perished";
            }

            int exp = 0;

            foreach (Game.Agents.Agent monster in deadMonsters)
            {
                exp += monster.GetExp();
            }

            foreach (Game.Agents.Agent player in playerList)
            {
                PlayerUpdater.UpdateCharacter(exp, player.GetName());
            }
            foreach (Game.Agents.Agent player in deadPlayers)
            {
                PlayerUpdater.UpdateCharacter(exp / 2, player.GetName());
            }

            return(messages);
        }
コード例 #2
0
 public void Start()
 {
     Enemies         = new List <EnemyAI>(GetComponentsInChildren <EnemyAI>());
     playerUpdater   = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerUpdater>();
     myArcAngles     = new ArcAngles();
     myActionManager = new ActionManager();
     myActionManager.MaxAttackActions     = MaxAttackActions;
     myActionManager.MaxNormalAttacks     = MaxNormalAttacks;
     myActionManager.MaxSpecial1Attacks   = MaxSpecial1Attacks;
     myActionManager.MaxProjectileAttacks = MaxProjectileAttacks;
     foreach (GameObject door in Exits)
     {
         door.SetActive(false);
     }
 }
コード例 #3
0
 private void Awake()
 {
     instance = this;
 }