static void CheatScreen() { Program.WipeGame(); int row = 0; Console.BackgroundColor = ConsoleColor.Black; Console.ForegroundColor = ConsoleColor.Gray; row = row + 1; Console.SetCursorPosition(1, row); Console.Write("Welcome to Debug."); row = row + 2; Console.SetCursorPosition(1, row); Console.Write("Choose your poisson:"); row = row + 1; Console.SetCursorPosition(1, row); Console.Write("(0) Overshoot"); row = row + 1; Console.SetCursorPosition(1, row); Console.Write("(1) Choose a level"); row = row + 1; Console.SetCursorPosition(1, row); Console.Write("(2) Nymphate everyone"); row = row + 1; Console.SetCursorPosition(1, row); Console.Write("(3) Save"); row = row + 1; Console.SetCursorPosition(1, row); Console.Write("(4) Load"); Program.LastKey = Console.ReadKey(true); switch (Program.LastKey.Key) { case ConsoleKey.D0: { AttributeChange test = new AttributeChange(); test.setSpecies("Naga"); test.NewGender = AttributeChange.StatusGenders.Female; test.Food = Int32.MaxValue - 10000; test.Health = 10000; test.MoreSpells = 10; test.setSpell("Destroy"); Program.entities[0].Transform(test, "the goddess"); break; } case ConsoleKey.D1: { Console.Clear(); int level = Int32.Parse(System.Console.ReadLine()); newlevel = level; newlevelflag = true; break; } case ConsoleKey.D2: { AttributeChange test = new AttributeChange(); test.setSpecies("Nymph"); test.NewGender = AttributeChange.StatusGenders.Female; test.Status = Entity.statuses.Charmed; foreach (Entity u in Program.entities) { u.Transform(test, "the goddess"); } break; } case ConsoleKey.D3: { StoredLevels.Save(); break; } case ConsoleKey.D4: { StoredLevels.Load(); break; } } Program.DrawGame(); }
public bool Transform(AttributeChange change, string transformer) { bool condition = true; if (change.Spell != null) condition = this.Learn(change.Spell); if (condition) { this.LimitedTransform(change); if ((this.species.undead) && (change.Health > 0)) this.health -= change.Health; else this.health += change.Health; if (this.health <= 0) this.die(transformer); this._attack += change.Attack; this._defense += change.Defense; this.food += change.Food; this.maxspells += change.MoreSpells; } return condition; }
public bool Cast(Entity caster, bool willwork) { bool result = true; AttributeChange del = this.delta; if (clone) { Entity source = caster.GetTarget(this.range); if (source != null) { del = new AttributeChange(); del.NewSpecies = source.species; del.NewGender = source.GetStatusGender(); del.Status = source.status; } else { if (caster == Program.entities[0]) Program.Report("Invalid target."); return false; } } if (targetself) { if (willwork) caster.Transform(del, "themself"); } if (target1enemy) { Entity spelltarget = caster.GetTarget(this.range); if (spelltarget != null) if (willwork) spelltarget.Transform(del, caster.name); else { if (caster == Program.entities[0]) Program.Report("Invalid target."); result = false; } } if (targetenemies) { if (willwork) foreach (Entity u in Program.entities.Where(item => item.WithinRange(caster, this.range))) u.Transform(del, caster.name); } if (targetitem) { if (caster == Program.entities[0]) { InventoryItem item = Program.ItemSelectionScreen(String.Concat("Which item to use ", this.name, " on?")); if (item != null) { if (willwork) { if (this.identify) item.Identify(); else if (this.uncurse) item.cursed = false; } } else { Program.Report("Invalid target."); result = false; } } } if (targetthing) { if (caster == Program.entities[0]) { Thing item = Program.TargetThing(this.range); if (item != null) { if (willwork) { item.Destroy(); } } else { Program.Report("Invalid target."); result = false; } } } return result; }
public void LimitedTransform(AttributeChange change) { // Certain changes happen whether you equip or use it bool genderchange = false; bool specieschange = false; string oldname = this.name; if (change.NewSpecies != null) { this.ChangeSpecies(change.NewSpecies); specieschange = true; } if ((this.species.gendered || ((change.NewSpecies != null) && (change.NewSpecies.gendered))) && (change.NewGender != AttributeChange.StatusGenders.None)) { if (change.NewGender == AttributeChange.StatusGenders.Flip) this.FlipGender(); else if (change.NewGender == AttributeChange.StatusGenders.Female) this.gender = genders.Female; else if (change.NewGender == AttributeChange.StatusGenders.Male) this.gender = genders.Male; genderchange = true; } if (change.Status != statuses.Null) this.ChangeStatus(change.Status); if (this == Program.entities[0]) { if (genderchange) Program.Report(String.Concat("You are now a ", Program.entities[0].GenderMarker(), " ", Program.entities[0].species.ToString())); else if (specieschange) Program.Report(String.Concat("You are now a ", Program.entities[0].species.ToString())); } else if (genderchange || specieschange) { Program.Report(String.Concat(oldname, " became a ", this.name,"!")); } }