private void HandleHasteRune(InternalRuneData data, string id) { AddScores(data, id); world.Actors.OfType <PudgeRobot>() .First(a => a.ControllerId == id) .ActivateBuff(PudgeEvent.Hasted, PudgeRules.Current.BuffDurations[data]); }
private void HandleDoubleDamageRune(InternalRuneData data, string id) { var pudge = world.Actors.OfType <PudgeRobot>() .First(a => a.ControllerId == id); pudge.ActivateBuff(PudgeEvent.DoubleDamage, PudgeRules.Current.BuffDurations[data]); }
private void AddScores(InternalRuneData data, string id) { if (PudgeRules.Current.RuneScores.ContainsKey(data)) { world.Scores.Add(id, PudgeRules.Current.RuneScores[data], string.Format("Picked {0} {1} rune", data.Size, data.Type)); } }
protected void SpawnRune(double X, double Y, RuneType type, RuneSize size = RuneSize.Normal) { var rune = new InternalRuneData(type, size, new Frame3D(X, Y, 0)); var id = world.IdGenerator.CreateNewId(rune); var p = rune.Location; world.GetEngine <IPudgeWorldEngine>().SpawnRune(rune.Type, rune.Size, p.X, p.Y, p.Z, id); world.SpawnedRunes.Add(rune); }
private void HandleInvisRune(InternalRuneData data, string id) { AddScores(data, id); var pudge = world.Actors.OfType <PudgeRobot>() .First(a => a.ControllerId == id); var buffDuration = PudgeRules.Current.BuffDurations[data]; var engine = pudge.World.GetEngine <IPudgeWorldEngine>(); pudge.ActivateBuff(PudgeEvent.Invisible, buffDuration); engine.SetTransparent(pudge.ObjectId, true); world.Clocks.AddTrigger(new OneTimeTrigger(world.Clocks.CurrentTime + buffDuration + 0.1, () => { if (!pudge.IsBuffActivated(PudgeEvent.Invisible)) { engine.SetTransparent(pudge.ObjectId, false); } })); }
protected bool Equals(InternalRuneData other) { return(Type == other.Type && Size == other.Size && Location.Equals(other.Location)); }