Exemple #1
0
        public override bool FireEvent(Event E)
        {
            if (E.ID == "OwnerGetInventoryActions")
            {
                EventParameterGetInventoryActions eventParameterGetInventoryActions = E.GetParameter("Actions") as EventParameterGetInventoryActions;
                XRL.World.GameObject GO = E.GetGameObjectParameter("Object");

                eventParameterGetInventoryActions.AddAction("Paint", 'P', true, "&WP&yaint " + GO.the + GO.DisplayNameOnly, "InvCommandPainting");


                if (GO.GetPart <LiquidVolume>() != null)
                {
                    eventParameterGetInventoryActions.AddAction("PaintSelf", 's', true, "Paint your&Ws&yelf", "InvCommandPaintingSelf");
                }
                return(true);
            }
            if (E.ID == "InvCommandPainting")
            {
                XRL.World.GameObject Owner  = E.GetGameObjectParameter("Owner");
                XRL.World.GameObject Object = E.GetGameObjectParameter("Object");
                if (Object.pBrain != null && Object.pBrain.GetFeeling(Owner) < 50)
                {
                    Object.pBrain.AdjustFeeling(Owner, -10);
                    if (Owner.IsPlayer())
                    {
                        Popup.Show(Object.The + Object.DisplayNameOnly + " doesn't want to be painted!");
                    }
                    if (Object.MakeSave("Agility", 20, Owner, null, "Painting"))
                    {
                        return(false);
                    }
                }
                Paint(Object, Owner);
            }
            if (E.ID == "InvCommandPaintingSelf")
            {
                XRL.World.GameObject Owner = E.GetGameObjectParameter("Owner");

                Paint(Owner, Owner);
            }
            // if (E.ID == "AIGetOffensiveMutationList")
            // {
            //  List<AICommandList> list = (List<AICommandList>)E.GetParameter("List");
            //  ActivatedAbilities activatedAbilities = ParentObject.GetPart("ActivatedAbilities") as ActivatedAbilities;
            //  ActivatedAbilityEntry activatedAbilityEntry = activatedAbilities.AbilityByGuid[ActivatedAbilityID];
            //     list.Add(new AICommandList("CommandPaint", 1));
            // }
            return(base.FireEvent(E));
        }