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.MONEY, money + 5);

            //disables the target object so that it can't be reused again
            worldModel.SetResourceState (this.Target.name, false);
        }
Esempio n. 2
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);
        }
        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.SetResourceState(this.Target.name,false);
        }