Example #1
0
        public override void ApplyActionEffects(WorldModel worldModel)
        {
            //TODO its probably wrong, needs to be corrected
            base.ApplyActionEffects(worldModel);

            var conquerValue = worldModel.GetGoalValue(AutonomousCharacter.CONQUER_GOAL);
            worldModel.SetGoalValue(AutonomousCharacter.CONQUER_GOAL, conquerValue - 2.0f);

            var duration = this.GetDuration(worldModel);
            var energyChange = duration * 0.01f;
            var hungerChange = duration * 0.1f;

            var restValue = worldModel.GetGoalValue(AutonomousCharacter.REST_GOAL);
            worldModel.SetGoalValue(AutonomousCharacter.REST_GOAL, restValue + energyChange);

            var energy = (float)worldModel.GetProperty(Properties.ENERGY);
            worldModel.SetProperty(Properties.ENERGY, energy - energyChange);

            var eatGoalValue = worldModel.GetGoalValue(AutonomousCharacter.EAT_GOAL);
            worldModel.SetGoalValue(AutonomousCharacter.EAT_GOAL, eatGoalValue + hungerChange);

            var hunger = (float)worldModel.GetProperty(Properties.HUNGER);
            worldModel.SetProperty(Properties.HUNGER, hunger + hungerChange);

            worldModel.SetProperty(Properties.POSITION, this.Character.BestFlagPosition);
        }
        public override void ApplyActionEffects(WorldModel worldModel)
        {
            //TODO its probably wrong, needs to be corrected
            base.ApplyActionEffects(worldModel);

            //var position = (Vector3)worldModel.GetProperty(Properties.POSITION);
            var position = this.Character.Character.KinematicData.position;
            var distance = (this.Character.BestFlagPosition - position).magnitude;

            if (distance <= 5.0f)
            {
                var conquerValue = worldModel.GetGoalValue(AutonomousCharacter.CONQUER_GOAL);
                worldModel.SetGoalValue(AutonomousCharacter.CONQUER_GOAL, conquerValue - 2.0f);
            }
            else
            {
                var duration = distance / 20.0f;
                var energyChange = duration * 0.01f;
                var hungerChange = duration * 0.1f;

                var restValue = worldModel.GetGoalValue(AutonomousCharacter.REST_GOAL);
                worldModel.SetGoalValue(AutonomousCharacter.REST_GOAL, restValue + energyChange);

                var energy = (float)worldModel.GetProperty(Properties.ENERGY);
                worldModel.SetProperty(Properties.ENERGY, energy - energyChange);

                var eatGoalValue = worldModel.GetGoalValue(AutonomousCharacter.EAT_GOAL);
                worldModel.SetGoalValue(AutonomousCharacter.EAT_GOAL, eatGoalValue + hungerChange);

                var hunger = (float)worldModel.GetProperty(Properties.HUNGER);
                worldModel.SetProperty(Properties.HUNGER, hunger + hungerChange);
            }

            worldModel.SetProperty(Properties.POSITION, this.Character.BestFlagPosition);
        }
Example #3
0
 public override void ApplyActionEffects(WorldModel worldModel)
 {
     var restValue = worldModel.GetGoalValue(AutonomousCharacter.REST_GOAL);
     worldModel.SetGoalValue(AutonomousCharacter.REST_GOAL, restValue - 0.1f);
     var eat = worldModel.GetGoalValue(AutonomousCharacter.EAT_GOAL);
     worldModel.SetGoalValue(AutonomousCharacter.EAT_GOAL, eat + 0.2f);
 }
Example #4
0
        public override void ApplyActionEffects(WorldModel worldModel)
        {
            base.ApplyActionEffects(worldModel);

            var eatValue = worldModel.GetGoalValue(AutonomousCharacter.EAT_GOAL_ID);
            worldModel.SetGoalValue(AutonomousCharacter.EAT_GOAL_ID, eatValue - 2.0f);
            var surviveValue = worldModel.GetGoalValue(AutonomousCharacter.SURVIVE_GOAL_ID);
            worldModel.SetGoalValue(AutonomousCharacter.SURVIVE_GOAL_ID, surviveValue + 2.0f);

            var hunger = (float)worldModel.GetProperty(Properties.HUNGER);
            worldModel.SetProperty(Properties.HUNGER, hunger - 2.0f);

            //disables the target object so that it can't be reused again
            worldModel.SetProperty(this.Target.name, false);
        }
Example #5
0
        public override void ApplyActionEffects(WorldModel worldModel)
        {
            base.ApplyActionEffects(worldModel);

            var restValue = worldModel.GetGoalValue(AutonomousCharacter.REST_GOAL);
            worldModel.SetGoalValue(AutonomousCharacter.REST_GOAL,restValue-1.0f);
        }
Example #6
0
File: Rest.cs Project: IAJ-g04/Lab8
        public override void ApplyActionEffects(WorldModel worldModel)
        {
            base.ApplyActionEffects(worldModel);

            var restValue = worldModel.GetGoalValue(AutonomousCharacter.REST_GOAL);
            worldModel.SetGoalValue(AutonomousCharacter.REST_GOAL, restValue - 0.1f);

            var energy = (float)worldModel.GetProperty(Properties.ENERGY);
            worldModel.SetProperty(Properties.ENERGY, energy + 0.1f);
        }
Example #7
0
        public override void ApplyActionEffects(WorldModel worldModel)
        {
            base.ApplyActionEffects(worldModel);

            var surviveValue = worldModel.GetGoalValue(AutonomousCharacter.SURVIVE_GOAL);
            worldModel.SetGoalValue(AutonomousCharacter.SURVIVE_GOAL, surviveValue - 0.5f);
            worldModel.SetProperty(Properties.ARROWS, 10);

            worldModel.SetProperty(this.Target.name, false);
        }
Example #8
0
        public override void ApplyActionEffects(WorldModel worldModel)
        {
            base.ApplyActionEffects(worldModel);
            var money = (int)worldModel.GetProperty(Properties.MONEY);
            worldModel.SetProperty(Properties.MONEY, money + 5);
            var richGoal = (float)worldModel.GetGoalValue(AutonomousCharacter.GET_RICH_GOAL);
            worldModel.SetGoalValue(AutonomousCharacter.GET_RICH_GOAL, richGoal - 2);

            worldModel.SetProperty(this.Target.name, false);
        }
        public override void ApplyActionEffects(WorldModel worldModel)
        {
            var duration = this.GetDuration(worldModel);
            var energyChange = duration * 0.01f;
            var hungerChange = duration*0.1f;

            var restValue = worldModel.GetGoalValue(AutonomousCharacter.REST_GOAL);
            worldModel.SetGoalValue(AutonomousCharacter.REST_GOAL, restValue + energyChange);

            var energy = (float)worldModel.GetProperty(Properties.ENERGY);
            worldModel.SetProperty(Properties.ENERGY, energy - energyChange);

            var eatGoalValue = worldModel.GetGoalValue(AutonomousCharacter.EAT_GOAL);
            worldModel.SetGoalValue(AutonomousCharacter.EAT_GOAL,eatGoalValue + hungerChange);

            var hunger = (float) worldModel.GetProperty(Properties.HUNGER);
            worldModel.SetProperty(Properties.HUNGER, hunger + hungerChange);

            worldModel.SetProperty(Properties.POSITION, Target.transform.position);
        }
Example #10
0
        public override void ApplyActionEffects(WorldModel worldModel)
        {
            base.ApplyActionEffects(worldModel);

            var money = worldModel.GetGoalValue(AutonomousCharacter.GET_RICH_GOAL);
            worldModel.SetGoalValue(AutonomousCharacter.GET_RICH_GOAL, money - 5.0f);

            var coins = (int)worldModel.GetProperty(Properties.MONEY);
            worldModel.SetProperty(Properties.MONEY, coins - 5);
            worldModel.SetProperty(this.Target.name, false);
        }
        public override void ApplyActionEffects(WorldModel worldModel)
        {
            base.ApplyActionEffects(worldModel);

            var eatValue = worldModel.GetGoalValue(AutonomousCharacter.EAT_GOAL);
            worldModel.SetGoalValue(AutonomousCharacter.EAT_GOAL,eatValue-2.0f);
            var restValue = worldModel.GetGoalValue(AutonomousCharacter.REST_GOAL);
            worldModel.SetGoalValue(AutonomousCharacter.REST_GOAL,restValue+0.5f);
            var surviveValue = worldModel.GetGoalValue(AutonomousCharacter.SURVIVE_GOAL);
            worldModel.SetGoalValue(AutonomousCharacter.SURVIVE_GOAL,surviveValue+2.0f);

            var hp = (int)worldModel.GetProperty(Properties.HP);
            worldModel.SetProperty(Properties.HP,hp-2);
            var energy = (float)worldModel.GetProperty(Properties.ENERGY);
            worldModel.SetProperty(Properties.ENERGY,energy-0.5f);
            var hunger = (float)worldModel.GetProperty(Properties.HUNGER);
            worldModel.SetProperty(Properties.HUNGER,hunger-2.0f);

            //disables the target object so that it can't be reused again
            worldModel.SetProperty(this.Target.name,false);
        }
        public override void ApplyActionEffects(WorldModel worldModel)
        {
            base.ApplyActionEffects (worldModel);

            var richValue = worldModel.GetGoalValue (AutonomousCharacter.GET_RICH_GOAL);
            worldModel.SetGoalValue (AutonomousCharacter.GET_RICH_GOAL, richValue - 5.0f);

            var money = (int)worldModel.GetProperty (Properties.MONEY);
            worldModel.SetProperty (Properties.HP, money + 5);

            //disables the target object so that it can't be reused again
            worldModel.SetProperty (this.Target.name, false);
        }
Example #13
0
        public override void ApplyActionEffects(WorldModel worldModel)
        {
            base.ApplyActionEffects(worldModel);

            var duration = this.GetDuration(worldModel);
            var energyChange = duration * 0.01f;
            var hungerChange = duration * 0.1f;

            var restValue = worldModel.GetGoalValue(AutonomousCharacter.REST_GOAL_ID);
            worldModel.SetGoalValue(AutonomousCharacter.REST_GOAL_ID, restValue + energyChange);

            var energy = (float)worldModel.GetProperty(Properties.ENERGY);
            worldModel.SetProperty(Properties.ENERGY, energy - energyChange);

            var eatGoalValue = worldModel.GetGoalValue(AutonomousCharacter.EAT_GOAL_ID);
            worldModel.SetGoalValue(AutonomousCharacter.EAT_GOAL_ID, eatGoalValue + hungerChange);

            var hunger = (float)worldModel.GetProperty(Properties.HUNGER);
            worldModel.SetProperty(Properties.HUNGER, hunger + hungerChange);

            var conquerValue = worldModel.GetGoalValue(AutonomousCharacter.CONQUER_GOAL_ID);
            worldModel.SetGoalValue(AutonomousCharacter.CONQUER_GOAL_ID, conquerValue - 2.0f);
        }
Example #14
0
        public override void ApplyActionEffects(WorldModel worldModel)
        {
            base.ApplyActionEffects(worldModel);

            var eatValue = worldModel.GetGoalValue(AutonomousCharacter.EAT_GOAL);
            worldModel.SetGoalValue(AutonomousCharacter.EAT_GOAL, eatValue - 2.0f);

            var hunger = (float)worldModel.GetProperty(Properties.HUNGER);
            worldModel.SetProperty(Properties.HUNGER, hunger - 2.0f);

            var arrows = (int)worldModel.GetProperty(Properties.ARROWS);
            worldModel.SetProperty(Properties.ARROWS, arrows - 1);

            //disables the target object so that it can't be reused again
            worldModel.SetResourceState(this.Target.name, false);
        }