public override bool FireEvent(Event E) { if (E.ID == "CommandCombustionBlast") { if (base.IsMyActivatedAbilityUsable(this.CombustionBlastActivatedAbilityID)) { if (!this.ParentObject.pPhysics.CurrentCell.ParentZone.IsWorldMap()) { CombustionBeam(); } return(false); } } if (E.ID == "CommandQuickFire") { if (base.IsMyActivatedAbilityUsable(this.CombustionBlastVolleyActivatedAbilityID)) { if (!ParentObject.pPhysics.CurrentCell.ParentZone.IsWorldMap()) { CombustionBeamQuickFire(); } return(false); } } if (E.ID == "AIGetOffensiveMutationList") { FocusPsi PsiMutation = ParentObject.GetPart <FocusPsi>(); //AddPlayerMessage("I'mma keel yo ass."); if (PsiMutation.focusPsiCurrentCharges > 0) { E.AddAICommand("CommandCombustionBlast"); //AddPlayerMessage("I'mma keel yo ass fo real."); } } return(base.FireEvent(E)); }
public override bool FireEvent(Event E) { //... if (E.ID == "Regenerating" && ParentObject.HasEffect("Submerged")) { int RegenerationAmountParameter = E.GetIntParameter("Amount"); RegenerationAmountParameter += (int)Math.Ceiling((float)RegenerationAmountParameter); E.SetParameter("Amount", RegenerationAmountParameter); } else if (E.ID == "BeginMove" && ParentObject.HasEffect("Submerged")) { Cell Cell = E.GetParameter("DestinationCell") as Cell; if (((!Cell.HasObjectWithPart("LiquidVolume") || (Cell.GetFirstObjectWithPart("LiquidVolume") as GameObject).LiquidVolume.Volume < 200) && ParentObject.IsPlayer() && ParentObject.HasEffect("Submerged"))) { if (Popup.ShowYesNo("Surface and go ashore?") == (int)DialogResult.Yes) { ParentObject.Splash("{{b|*}}"); ParentObject.RemoveEffect("Submerged"); } else { return(false); } } } else if (E.ID == "DiveCommand") { Cell Cell = ParentObject.GetCurrentCell(); Mutations ParentsMutations = ParentObject.GetPart <Mutations>(); if (ParentObject.HasEffect("Flying")) { if (IsPlayer()) { AddPlayerMessage("You cannot do this while flying"); } return(false); } else if (!Cell.HasObjectWithPart("LiquidVolume")) { AddPlayerMessage("You try to dive into the earth, you imagine this would be easier if the ground were, say, just a tad less hard."); return(false); } else if ((Cell.GetFirstObjectWithPart("LiquidVolume") as GameObject).LiquidVolume.Volume < 200) { AddPlayerMessage("Its too shallow to dive in!"); return(false); } else if (ParentObject.HasEffect("Submerged")) { // AddPlayerMessage("Your return to the surface."); ParentObject.Splatter("{{B|*}}"); ParentObject.RemoveEffect("Submerged"); } else if ((Cell.GetFirstObjectWithPart("LiquidVolume") as GameObject).LiquidVolume.Volume >= 200 && ParentsMutations.HasMutation("Amphibious")) { AddPlayerMessage("You feel right at home."); ParentObject.Splatter("{{B|*}}"); ParentObject.ApplyEffect(new Submerged(Duration: Effect.DURATION_INDEFINITE)); } else if ((Cell.GetFirstObjectWithPart("LiquidVolume") as GameObject).LiquidVolume.Volume >= 200 && !ParentsMutations.HasMutation("Amphibious")) { ParentObject.Splatter("{{B|*}}"); ParentObject.ApplyEffect(new Submerged(Duration: Effect.DURATION_INDEFINITE)); } } else if (E.ID == "EndTurn") { Cell Cell = ParentObject.GetCurrentCell(); if (ParentObject.HasEffect("Flying") && (ParentObject.HasEffect("Submerged"))) { ParentObject.RemoveEffect(new Flying()); AddPlayerMessage("Removing Paradox Incident."); } else if (ParentObject.IsHealingPool() && ParentObject.HasEffect("Submerged")) { ParentObject.Heal(+ParentObject.Statistics["Toughness"].Modifier); } else if (((!Cell.HasObjectWithPart("LiquidVolume") || (Cell.GetFirstObjectWithPart("LiquidVolume") as GameObject).LiquidVolume.Volume < 200) && ParentObject.HasEffect("Submerged"))) { ParentObject.Splash("{{b|*}}"); ParentObject.RemoveEffect("Submerged"); return(false); } } //...--------------------------------------------------------------------------------------------- else if (E.ID == "DeepStrikeCommand") { if (!ParentObject.HasEffect("Submerged") && ParentObject.IsPlayer()) { AddPlayerMessage("You must be submerged in deep pools of liquid to use this attack."); } else if (!ParentObject.HasEffect("Submerged") && !ParentObject.IsPlayer()) { } else if (ParentObject.HasEffect("Submerged")) { string Direction = E.GetStringParameter("Direction"); if (Direction == null) { if (ParentObject != null) { Direction = PickDirectionS(); try { Patch_PhaseAndFlightMatches.TemporarilyDisabled = true; Event e = Event.New("CommandAttackDirection", "Direction", Direction); bool num11 = FireEvent(e); ParentObject.FireEvent(e); XDidY(ParentObject, "rush", "from the depths to strike!", "!", "C", ParentObject); Patch_PhaseAndFlightMatches.TemporarilyDisabled = false; } catch { } } } } } else if (E.ID == "AIGetOffensiveMutationList") { //AddPlayerMessage("I'mma keel yo ass."); if (IsMyActivatedAbilityAIUsable(DiveActivatedAbility)) { if (!ParentObject.HasEffect("Submerged") && (ParentObject.CurrentCell.GetFirstObjectWithPart("LiquidVolume") as GameObject).LiquidVolume.Volume >= 200) { E.AddAICommand("DiveCommand"); } } int intParameter = E.GetIntParameter("Distance"); if (E.GetGameObjectParameter("Target") != null && intParameter <= 1 && !ParentObject.IsFrozen() && IsMyActivatedAbilityAIUsable(DeepStrikeActivatedAbility)) { E.AddAICommand("DeepStrikeCommand"); } } else if (E.ID == "BeginTakeAction") { if (ParentObject.HasEffect("Flying") && (ParentObject.HasEffect("Submerged"))) { ParentObject.RemoveEffect(new Flying()); AddPlayerMessage("Removing Paradox Incident."); } } return(base.FireEvent(E)); }
public override bool FireEvent(Event E) { if (E.ID == "AIGetOffensiveMutationList") { if (IsMyActivatedAbilityAIUsable(SureStrikesActivatedAbilityID, ParentObject)) { E.AddAICommand("CommandSureStrikes"); } } else if (E.ID == "CommandSureStrikes") { // AddPlayerMessage("Firing Sure strike commandsurestrikes"); AwardSureStrikes = 0; var MMAAccess = ParentObject.GetPart <WM_MMA_CombinationStrikesI>(); var ParentAgi = ParentObject.StatMod("Agility"); if (ParentObject.HasPart("WM_MMA_PathDawnGlider") && IsPlayer()) { var MMAComboPathDawnAccess = ParentObject.GetPart <WM_MMA_PathDawnGlider>(); PlayersSurestrike(); MMAComboPathDawnAccess.BonusSureStrike = 0; UpdateCounter(); } else if (IsPlayer()) { PlayersSurestrike(); } AwardSureStrikes = ParentAgi; var eAttacker = _ParentObject; if (AwardSureStrikes <= 0) { return(base.FireEvent(E)); } else { ChainFuntion(); ParentObject.CooldownActivatedAbility(SureStrikesActivatedAbilityID, 80 - (AwardSureStrikes * 10)); } if (IsPlayer()) { UpdateCounter(); } } else if (E.ID == "FailedChainingSureStrikes") { var MMAAccess = ParentObject.GetPart <WM_MMA_CombinationStrikesI>(); var eAttacker = _ParentObject; if (IsPlayer()) { UpdateCounter(); } if (Stat.Random(1, 100) <= 20 + MMAAccess.CurrentComboICounter) { ChainFuntion(); ParentObject.CooldownActivatedAbility(SureStrikesActivatedAbilityID, 80 - (AwardSureStrikes * 10)); } if (IsPlayer()) { UpdateCounter(); } } else if (E.ID == "ChainingSureStrikes") { // AddPlayerMessage("Chaining strike fires"); var MMAAccess = ParentObject.GetPart <WM_MMA_CombinationStrikesI>(); var eDefender = E.GetGameObjectParameter("Defender"); var eAttacker = E.GetGameObjectParameter("Attacker"); ChainingSureStrike(eDefender); if (Stat.Random(1, 100) <= 20 + (MMAAccess.CurrentComboICounter * 2)) { ChainFuntion(); ParentObject.CooldownActivatedAbility(SureStrikesActivatedAbilityID, 80 - (AwardSureStrikes * 10)); } if (IsPlayer()) { UpdateCounter(); } } else if (E.ID == "EndTurn") { if (IsPlayer()) { UpdateCounter(); } } return(base.FireEvent(E)); }
public override bool FireEvent(Event E) { if (E.ID == "DismissStanceCommand") { StanceReplacement(); NoviceStancer(); } else if (E.ID == "DawngliderStanceCommand") { StanceReplacement(); ParentObject.ApplyEffect(new DawnStance(Effect.DURATION_INDEFINITE)); NoviceStancer(); } else if (E.ID == "AstralTabbyStanceCommand") { StanceReplacement(); ParentObject.ApplyEffect(new AstralTabbyStance(Effect.DURATION_INDEFINITE)); NoviceStancer(); } else if (E.ID == "SaltBackStanceCommand") { StanceReplacement(); ParentObject.ApplyEffect(new SaltbackStance(Effect.DURATION_INDEFINITE)); NoviceStancer(); } else if (E.ID == "SlumberlingStanceCommand") { StanceReplacement(); ParentObject.ApplyEffect(new SlumberStance(Effect.DURATION_INDEFINITE)); NoviceStancer(); } else if (E.ID == "SaltHopperStanceCommand") { StanceReplacement(); ParentObject.ApplyEffect(new SaltHopperStance(Effect.DURATION_INDEFINITE)); NoviceStancer(); } else if (E.ID == "DeathDaccaStanceCommand") { StanceReplacement(); ParentObject.ApplyEffect(new DaccaStance(Effect.DURATION_INDEFINITE)); NoviceStancer(); } else if (E.ID == "AIGetOffensiveMutationList") { WM_MMA_MartialStances GetStances = ParentObject.GetPart <WM_MMA_MartialStances>(); if (IsMyActivatedAbilityToggledOn(AstralTabbyStanceID, ParentObject) == false && !ParentObject.HasEffect("AstralTabbyStance") && InStance == false) { E.AddAICommand("AstralTabbyStanceCommand"); InStance = true; } else if (IsMyActivatedAbilityToggledOn(DawnStanceID, ParentObject) == false && !ParentObject.HasEffect("DawnStance") && InStance == false) { E.AddAICommand("DawngliderStanceCommand"); InStance = true; } else if (IsMyActivatedAbilityToggledOn(SlumberStanceID, ParentObject) == false && !ParentObject.HasEffect("SlumberStance") && InStance == false) { E.AddAICommand("SlumberlingStanceCommand"); InStance = true; } else if (IsMyActivatedAbilityToggledOn(SaltHopperStanceID, ParentObject) == false && !ParentObject.HasEffect("SaltHopperStance") && InStance == false) { E.AddAICommand("SaltHopperStanceCommand"); InStance = true; } else if (IsMyActivatedAbilityToggledOn(SaltBackStanceID, ParentObject) == false && !ParentObject.HasEffect("SaltbackStance") && InStance == false) { E.AddAICommand("SaltBackStanceCommand"); InStance = true; } else if (IsMyActivatedAbilityToggledOn(DeathDaccaStanceID, ParentObject) == false && !ParentObject.HasEffect("SaltbackStance") && InStance == false) { E.AddAICommand("DeathDaccaStanceCommand"); InStance = true; } } return(base.FireEvent(E)); }
public override bool FireEvent(Event E) { if (E.ID == "CommandManifestLimb") { ArmCost = (2 + ArmCounter) + (2 * ArmCounter) - 1; NewArmCost = ArmCost; if (NewArmCost <= focusPsiCurrentMaximumCharges) { UpdateCharges(); ArmCounter += 1; } else if (NewArmCost > focusPsiCurrentMaximumCharges) { UpdateCharges(); return(true); } } if (E.ID == "CommandDismissLimb") { if (ArmCounter >= 1) { ArmCounter -= 1; } UpdateCharges(); } if (E.ID == "AIGetPassiveMutationList") { // AddPlayerMessage("Hey prepare, to eat my combustion blast."); // AddPlayerMessage($"Currentcharges: {focusPsiCurrentCharges}"); // AddPlayerMessage($"MaximumPsi: {maximumPsiCharge()}"); if (focusPsiCurrentCharges < focusPsiCurrentMaximumCharges / 2 && !HandlingCharging()) { E.AddAICommand("CommandFocusPsi"); // AddPlayerMessage($"Currentcharges: {focusPsiCurrentCharges}"); AddPlayerMessage("Something is gathering psionic energy ..."); } else if (focusPsiCurrentCharges >= focusPsiCurrentMaximumCharges - 1 && HandlingCharging()) { E.AddAICommand("CommandFocusPsi"); // AddPlayerMessage($"Currentcharges: {focusPsiCurrentCharges}"); AddPlayerMessage("Something is gathering psionic energy ..."); } } if (E.ID == "CommandFocusPsi") { if (!base.IsMyActivatedAbilityToggledOn(this.PsiFocusActivatedAbilityID)) { base.ToggleMyActivatedAbility(this.PsiFocusActivatedAbilityID); string verb1 = "begin to gather"; string extra1 = "psionic energy"; string TermiP1 = "."; XDidY(ParentObject, verb1, extra1, TermiP1); isCharging = true; } else { base.ToggleMyActivatedAbility(this.PsiFocusActivatedAbilityID); string verb2 = "stop"; string extra2 = "gathering psi energy"; string termiPun2 = "."; XDidY(ParentObject, verb2, extra2, termiPun2); isCharging = false; UseEnergy(1000); } UpdateCharges(); return(false); } else if (E.ID == "EndTurn") { Psybrachiomancy BrachMutation = ParentObject.GetPart <Psybrachiomancy>(); var PsiburdeningCatch = ParentObject.GetEffect <Psiburdening>(); if (base.IsMyActivatedAbilityToggledOn(this.PsiFocusActivatedAbilityID) && (focusPsiCurrentCharges < focusPsiCurrentMaximumCharges)) { int chanceforpsi = (ParentObject.StatMod("Willpower") * 3) + PsiCounter; if (Stat.Random(1, 100) < chanceforpsi) { focusPsiCurrentCharges++; DidX("charge", "psi energy", ".", ColorAsGoodFor: ParentObject); } else { PsiCounter++; } turnsTilPsiDecay++; } else if (ParentObject.HasPart("Psybrachiomancy") && BrachMutation.ArmCounter <= Math.Min(1, ParentObject.StatMod("Willpower")) && ParentObject.HasEffect("Psiburdening")) { ParentObject.RemoveEffect(PsiburdeningCatch); } UpdateCharges(); } else if (E.ID == "PsionicDecay") { if (!(ParentObject.MakeSave("Willpower", effectiveSaveTarget, null, null, "Psionic Decay"))) { focusPsiCurrentCharges -= E.GetIntParameter("Amount", (int)0); // Current default value is zero, change default value to something more appropriate later } UpdateCharges(); } else if (E.ID == "FireEventDebuffSystem") { Psybrachiomancy BrachMutation = ParentObject.GetPart <Psybrachiomancy>(); if (BrachMutation.ArmCounter > ParentObject.StatMod("Willpower") + BrachMutation.Level / 2 && !ParentObject.HasEffect("Psiburdening")) { ParentObject.ApplyEffect(new Psiburdening((Stat.Random(10, 20) - ParentObject.StatMod("Willpower")) * Stat.Random(50, 125))); } else if (BrachMutation.ArmCounter < ParentObject.StatMod("Willpower") && ParentObject.HasEffect("Psiburdening")) { ParentObject.RemoveEffect("Psiburdening"); } } return(base.FireEvent(E)); }