public override void ObjectEnteredCell(LiquidVolume Liquid, XRL.World.GameObject GO) { if (Liquid.MaxVolume == -1 && GO.PhaseAndFlightMatches(Liquid.ParentObject) && GO.GetIntProperty("Slimewalking") <= 0 && GO.HasPart("Body")) { int difficulty = 10 + (int)((double)(Liquid.ComponentLiquids[2] * 5) / 1000.0); if (!GO.MakeSave("Strength,Agility", difficulty, null, null, "Furling Agent Restraint")) { GO.ApplyEffect(new cloneStuck(12, Liquid.ComponentLiquids[2] / 100, null)); } } }
public override void ObjectEnteredCell(LiquidVolume Liquid, XRL.World.GameObject GO) { if (Liquid.MaxVolume != -1 || !GO.HasPart("Body") || !GO.PhaseAndFlightMatches(Liquid.ParentObject) || Liquid.Volume > 1000) { return; } int num = 10 + (int)((double)(Liquid.ComponentLiquids[this.ID] * 5) / 1000.0); if (!GO.MakeSave("Agility", num, null, null, "Dye")) { if (GO.IsPlayer()) { MessageQueue.AddPlayerMessage("&CYou get covered in " + ColorNames[this.Color] + " dye!"); } GO.pRender.TileColor = "&" + this.Color; GO.pRender.ColorString = "&" + this.Color; GO.pRender.DetailColor = ToggleCase(this.Color); } }
public void TailStrike(XRL.World.GameObject Defender, int Hitbonus) { ThickTail Tail = base.ParentObject.Equipped.GetPart <Mutations>().GetMutation("ThickTail") as ThickTail; var TailSource = ParentObject; var Owner = TailSource.Equipped; Mutations HasSynergyMutation = Owner.GetPart <Mutations>(); if (Defender != null && Defender.PhaseAndFlightMatches(Owner) && Defender.CurrentCell != null && Owner.CurrentCell != null && Owner.DistanceTo(Defender) <= 1) { if (Defender.pBrain != null) { Defender.pBrain.GetAngryAt(Owner, -20); } if (Stat.Random(1, 20) + Hitbonus + Owner.StatMod("Agility", 0) > Stats.GetCombatDV(Defender)) { var data = Tail.GetData(Tail.Level); int PenetrationCont = Stat.RollDamagePenetrations(Stats.GetCombatAV(Defender), (Stat.Roll(data.Penetration, null) + Stat.Roll(data.BonusPen)), Stat.Roll(data.Penetration, null) + Stat.Roll(data.BonusPen)); string resultColor = Stat.GetResultColor(PenetrationCont); int DamageBaseInit = 0; if (PenetrationCont > 0) { for (int i = 0; i < PenetrationCont; i++) { DamageBaseInit += Stat.Roll(data.BaseDamage, null); CombatJuice.punch(Owner, Defender); } Damage damage = new Damage(DamageBaseInit); damage.AddAttribute("Physical"); damage.AddAttribute("Bludgeoning"); Event @event = Event.New("TakeDamage", 0, 0, 0); @event.AddParameter("Damage", damage); @event.AddParameter("Owner", Owner); @event.AddParameter("Attacker", Owner); if (HasSynergyMutation.HasMutation("Quills")) { @event.AddParameter("Damage", data.BonusDamage); } if (DamageBaseInit > 0 && Defender.FireEvent(@event)) { if (Owner.IsPlayer()) { IComponent <GameObject> .AddPlayerMessage(string.Concat(new string[] { "&gYou strike ", resultColor, "(x", PenetrationCont.ToString(), ")&y for ", damage.Amount.ToString(), " &ydamage with your " + base.ParentObject.DisplayName + "!" })); } else if (Defender.IsPlayer()) { IComponent <GameObject> .AddPlayerMessage(string.Concat(new string[] { ParentObject.The, ParentObject.ShortDisplayName, " &r", ParentObject.GetVerb("strike", false, false), " ", resultColor, "(x", PenetrationCont.ToString(), ")&r for ", damage.Amount.ToString(), " &ydamage with ", ParentObject.its, " tail!" })); } } else if (Owner.IsPlayer()) { IComponent <GameObject> .AddPlayerMessage("&rYou fail to deal damage to " + Defender.the + Defender.DisplayNameOnly + " &rwith your " + base.ParentObject.DisplayName + "!"); } else if (Defender.IsPlayer()) { IComponent <GameObject> .AddPlayerMessage(string.Concat(new string[] { ParentObject.The, ParentObject.DisplayName, " &g", ParentObject.GetVerb("fail", false, false), " to damage you with ", ParentObject.its, " tail!" })); } } } } }