private void Age(ushort modifiers) { // roll exploding die for aging if (LongevityRitual > 0) { Warping.AddExperience(0.25); } bool apparent = true; bool crisis = false; bool died = false; ushort agingRoll = Die.Instance.RollExplodingDie(); agingRoll -= modifiers; ushort ageModifier = (ushort)Math.Ceiling(SeasonalAge / 40.0m); agingRoll += ageModifier; if (agingRoll < 3) { _noAgingSeasons++; apparent = false; } if (agingRoll == 13 || agingRoll > 21) { crisis = true; LongevityRitual = 0; IncreaseDecrepitudeToNextLevel(); int crisisRoll = Die.Instance.RollSimpleDie(); crisisRoll = crisisRoll + ageModifier + GetDecrepitudeScore(); if (crisisRoll > 14) { int staDiff = 3 * (crisisRoll - 14); if (GetAttribute(AttributeType.Stamina).Value + Die.Instance.RollSimpleDie() < staDiff) { died = true; Decrepitude = 75; } } } else if (agingRoll > 9) { Decrepitude++; } if (Decrepitude > 74) { died = true; } AgingEventArgs args = new AgingEventArgs(this, crisis, apparent, died); OnAged(args); }
public override void CollisionResponse(ICollision collided) { if (!(collided is ItemCollision)) { if (Mario.EntityCollision.TopCollision(collided) && collided.CurrentEntity is PipeBlockEntity && (collided.CurrentEntity as PipeBlockEntity).Warpable) { Mario.Pipe = collided.CurrentEntity as PipeBlockEntity; CurrentState.ExitState(); CurrentState = new Warping(Mario); CurrentState.Enter(this); } else if (Mario.EntityCollision.TopCollision(collided)) { Mario.SpriteVelocity = new Vector2(Mario.SpriteVelocity.X, 0); } } }
void Start() { warp = GameObject.Find ("Player").GetComponent<Warping> (); }