public Juggernaut(Unit9 owner, MultiSleeper abilitySleeper, Sleeper orbwalkSleeper, ControllableUnitMenu menu) : base(owner, abilitySleeper, orbwalkSleeper, menu) { this.ComboAbilities = new Dictionary <AbilityId, Func <ActiveAbility, UsableAbility> > { { AbilityId.juggernaut_blade_fury, x => this.bladeFury = new NukeAbility(x) }, { AbilityId.juggernaut_healing_ward, x => this.ward = new HealingWard(x) }, { (AbilityId)419, x => this.slash = new Omnislash(x) }, { AbilityId.juggernaut_omni_slash, x => this.omni = new Omnislash(x) }, { AbilityId.item_phase_boots, x => this.phase = new SpeedBuffAbility(x) }, { AbilityId.item_orchid, x => this.orchid = new DisableAbility(x) }, { AbilityId.item_bloodthorn, x => this.bloodthorn = new Bloodthorn(x) }, { AbilityId.item_nullifier, x => this.nullifier = new Nullifier(x) }, { AbilityId.item_diffusal_blade, x => this.diffusal = new DebuffAbility(x) }, { AbilityId.item_abyssal_blade, x => this.abyssal = new DisableAbility(x) }, { AbilityId.item_manta, x => this.manta = new BuffAbility(x) }, { AbilityId.item_blink, x => this.blink = new BlinkAbility(x) }, { AbilityId.item_swift_blink, x => this.blink = new BlinkAbility(x) }, { AbilityId.item_arcane_blink, x => this.blink = new BlinkAbility(x) }, { AbilityId.item_overwhelming_blink, x => this.blink = new BlinkAbility(x) }, { AbilityId.item_mjollnir, x => this.mjollnir = new ShieldAbility(x) }, }; this.MoveComboAbilities.Add(AbilityId.juggernaut_blade_fury, x => this.bladeFuryShield = new ShieldAbility(x)); }
private void UpdateRadius() { float nextRadius = GetRadius(); if (nextRadius <= 0) { outer.SetNextState(new PreDetonate()); } HealingWard healingWard = mushroomWard.GetComponent <HealingWard>(); healingWard.Networkradius = nextRadius; }
private static GameObject CreateMushroomWard(Vector3 position) { // create mushroom ward visuals GameObject resource = Resources.Load <GameObject>("Prefabs/NetworkedObjects/MushroomWard"); GameObject mushroomWard = UnityEngine.Object.Instantiate(resource, position, Quaternion.identity); mushroomWard.GetComponent <TeamFilter>().teamIndex = TeamIndex.Player; NetworkServer.Spawn(mushroomWard); // initialize healing ward props HealingWard healingWard = mushroomWard.GetComponent <HealingWard>(); healingWard.healFraction = 0.05f; healingWard.healPoints = 0f; healingWard.Networkradius = INITIAL_RADIUS; return(mushroomWard); }
public override void OnEnter() { base.OnEnter(); base.PlayAnimation("Plant", "PlantLoop"); this.maxDuration = Plant.baseMaxDuration / this.attackSpeedStat; this.minDuration = Plant.baseMinDuration / this.attackSpeedStat; this.soundID = Util.PlaySound(Plant.healSoundLoop, base.characterBody.modelLocator.modelTransform.gameObject); if (!NetworkServer.active) { return; } for (float num = 0f; num < 9f; num += 1f) { float num2 = 6.2831855f; Vector3 forward = new Vector3(Mathf.Cos(num / 9f * num2), 0f, Mathf.Sin(num / 9f * num2)); var projInfo = new FireProjectileInfo { crit = base.RollCrit(), damage = this.damageStat * (SporeGrenade.damageCoefficient * 1.2f), owner = base.gameObject, position = base.transform.position, projectilePrefab = Resources.Load <GameObject>("prefabs/projectiles/Sunder"), rotation = Quaternion.LookRotation(forward), damageColorIndex = DamageColorIndex.Default, force = 2500, procChainMask = default }; ProjectileManager.instance.FireProjectile(projInfo); } if (this.mushroomWard == null) { this.mushroomWard = Object.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/NetworkedObjects/MiniMushroomWard"), base.characterBody.footPosition, Quaternion.identity); this.mushroomWard.GetComponent <TeamFilter>().teamIndex = base.teamComponent.teamIndex; if (this.mushroomWard) { HealingWard component = this.mushroomWard.GetComponent <HealingWard>(); component.healFraction = healFraction; component.healPoints = 0f; component.Networkradius = mushroomRadius; } NetworkServer.Spawn(this.mushroomWard); } }
// Token: 0x06000755 RID: 1877 RVA: 0x0002243C File Offset: 0x0002063C protected override void Execute() { if (this.sleeper.IsSleeping) { return; } Unit9 unit = this.ward; if (unit == null || !unit.IsValid || !this.ward.IsAlive) { return; } Vector3 fountain = base.TargetManager.Fountain; Unit9 owner = this.ward.Owner; HealingWard healingWard = (HealingWard)owner.Abilities.First((Ability9 x) => x.Id == AbilityId.juggernaut_healing_ward); List <Unit9> list = (from x in base.TargetManager.AllyHeroes where x.HealthPercentage < 90f || x.IsMyHero orderby x.HealthPercentage select x).ToList <Unit9>(); Unit9 unit2 = (owner.HealthPercentage < 80f && owner.IsAlive) ? owner : list.FirstOrDefault <Unit9>(); if (unit2 == null || !unit2.IsAlive) { return; } PredictionInput9 predictionInput = healingWard.GetPredictionInput(unit2, list); predictionInput.CastRange = 2000f; PredictionOutput9 predictionOutput = healingWard.GetPredictionOutput(predictionInput); if (predictionOutput.HitChance < 1) { return; } Vector3 vector = predictionOutput.CastPosition; if (predictionOutput.AoeTargetsHit.Count == 1) { vector = predictionOutput.TargetPosition; } if (!unit2.Equals(owner) || owner.HealthPercentage > 50f) { foreach (Unit9 unit3 in from x in base.TargetManager.EnemyHeroes orderby x.GetAttackRange(null, 0f) descending select x) { float num = unit3.GetAttackRange(null, 0f) * (unit3.IsRanged ? 2f : 3f); if (unit3.Distance(vector) <= num) { vector = unit2.InFront(5f, 0f, false); break; } } } if (this.ward.Position == vector) { return; } this.ward.BaseUnit.Move(vector); this.sleeper.Sleep(0.15f); }