private void killCreepB_Click(object sender, EventArgs e) { HabProperties hpsProfile = creepsCmbB.SelectedItem as HabProperties; player p = player.players[12]; for (int i = 0; i < (int)creepsNumUD.Value; i++) { unit u = p.add_unit(hpsProfile.name); u.OnDeath(Current.unit); u.destroy(); } }
private void killHeroB_Click(object sender, EventArgs e) { int streak = streakCmbB.SelectedIndex; if (streak > 0) { streak += 2; } player enemyPlayer = player.players[7]; player alliedPlayer = player.players[2]; for (int i = 0; i < (int)heroesNumUD.Value; i++) { unit enemyHero = new unit(); enemyHero.codeID = "Hero"; // so triggers could work with id enemyHero.ID.Value = "[Enemy Hero to be killed]"; enemyHero.primary = PrimAttrType.Str; // only heroes have primary attributes enemyHero.Level = (int)heroLevelNumUD.Value; enemyHero.set_owningPlayer(enemyPlayer); // generate killing streak for enemy hero // by killing allied heroes for (int j = 0; j < streak; j++) { unit victim = new unit(); victim.codeID = "Prey"; victim.ID.Value = "[Allied Victim]"; victim.primary = PrimAttrType.Str; victim.set_owningPlayer(alliedPlayer); victim.OnDeath(enemyHero); victim.destroy(); } // now our hero kills this enemy hero enemyHero.OnDeath(Current.unit); enemyHero.destroy(); } }
private void killHeroB_Click(object sender, EventArgs e) { int streak = streakCmbB.SelectedIndex; if (streak > 0) streak += 2; player enemyPlayer = player.players[7]; player alliedPlayer = player.players[2]; for (int i = 0; i < (int)heroesNumUD.Value; i++) { unit enemyHero = new unit(); enemyHero.codeID = "Hero"; // so triggers could work with id enemyHero.ID.Value = "[Enemy Hero to be killed]"; enemyHero.primary = PrimAttrType.Str; // only heroes have primary attributes enemyHero.Level = (int)heroLevelNumUD.Value; enemyHero.set_owningPlayer(enemyPlayer); // generate killing streak for enemy hero // by killing allied heroes for (int j = 0; j < streak; j++) { unit victim = new unit(); victim.codeID = "Prey"; victim.ID.Value = "[Allied Victim]"; victim.primary = PrimAttrType.Str; victim.set_owningPlayer(alliedPlayer); victim.OnDeath(enemyHero); victim.destroy(); } // now our hero kills this enemy hero enemyHero.OnDeath(Current.unit); enemyHero.destroy(); } }
private void dieB_Click(object sender, EventArgs e) { if (suicideRB.Checked) { Current.unit.OnDeath(Current.unit); Current.unit.playSound(AnimSounds.Death); } else switch (deathsCmbB.SelectedIndex) { case 0: // enemy hero int streak = streakCmbB.SelectedIndex; if (streak > 0) streak += 2; player enemyPlayer = player.players[7]; player alliedPlayer = player.players[2]; unit enemyHero = new unit(); enemyHero.codeID = "Hero"; // so triggers could work with id enemyHero.ID.Value = "[Enemy Hero that will kill you]"; enemyHero.primary = PrimAttrType.Str; // only heroes have primary attributes enemyHero.Level = (int)heroLevelNumUD.Value; enemyHero.set_owningPlayer(enemyPlayer); // generate killing streak for enemy hero // by killing allied heroes for (int j = 0; j < streak; j++) { unit victim = new unit(); victim.codeID = "Prey"; victim.ID.Value = "[Allied Victim]"; victim.primary = PrimAttrType.Str; victim.set_owningPlayer(alliedPlayer); victim.OnDeath(enemyHero); victim.destroy(); } // enemy hero kills our hero Current.unit.OnDeath(enemyHero); enemyHero.destroy(); break; case 1: // allied hero alliedPlayer = player.players[2]; unit ally = new unit(); ally.codeID = "Ally"; ally.ID.Value = "[Allied Killer]"; ally.primary = PrimAttrType.Str; ally.set_owningPlayer(alliedPlayer); // allied hero kills our hero Current.unit.OnDeath(ally); ally.destroy(); break; case 2: // enemy creep HabProperties hpsProfile = creepsCmbB.SelectedItem as HabProperties; player enemyCreepPlayer = player.players[6]; unit creep = enemyCreepPlayer.add_unit(hpsProfile.name); // creep kills our hero Current.unit.OnDeath(creep); creep.destroy(); break; case 3: // neutral creep hpsProfile = creepsCmbB.SelectedItem as HabProperties; player neutralPlayer = player.players[12]; creep = neutralPlayer.add_unit(hpsProfile.name); // creep kills our hero Current.unit.OnDeath(creep); creep.destroy(); break; case 4: // unknown source Current.unit.OnDeath(null); break; } }
private void dieB_Click(object sender, EventArgs e) { if (suicideRB.Checked) { Current.unit.OnDeath(Current.unit); Current.unit.playSound(AnimSounds.Death); } else { switch (deathsCmbB.SelectedIndex) { case 0: // enemy hero int streak = streakCmbB.SelectedIndex; if (streak > 0) { streak += 2; } player enemyPlayer = player.players[7]; player alliedPlayer = player.players[2]; unit enemyHero = new unit(); enemyHero.codeID = "Hero"; // so triggers could work with id enemyHero.ID.Value = "[Enemy Hero that will kill you]"; enemyHero.primary = PrimAttrType.Str; // only heroes have primary attributes enemyHero.Level = (int)heroLevelNumUD.Value; enemyHero.set_owningPlayer(enemyPlayer); // generate killing streak for enemy hero // by killing allied heroes for (int j = 0; j < streak; j++) { unit victim = new unit(); victim.codeID = "Prey"; victim.ID.Value = "[Allied Victim]"; victim.primary = PrimAttrType.Str; victim.set_owningPlayer(alliedPlayer); victim.OnDeath(enemyHero); victim.destroy(); } // enemy hero kills our hero Current.unit.OnDeath(enemyHero); enemyHero.destroy(); break; case 1: // allied hero alliedPlayer = player.players[2]; unit ally = new unit(); ally.codeID = "Ally"; ally.ID.Value = "[Allied Killer]"; ally.primary = PrimAttrType.Str; ally.set_owningPlayer(alliedPlayer); // allied hero kills our hero Current.unit.OnDeath(ally); ally.destroy(); break; case 2: // enemy creep HabProperties hpsProfile = creepsCmbB.SelectedItem as HabProperties; player enemyCreepPlayer = player.players[6]; unit creep = enemyCreepPlayer.add_unit(hpsProfile.name); // creep kills our hero Current.unit.OnDeath(creep); creep.destroy(); break; case 3: // neutral creep hpsProfile = creepsCmbB.SelectedItem as HabProperties; player neutralPlayer = player.players[12]; creep = neutralPlayer.add_unit(hpsProfile.name); // creep kills our hero Current.unit.OnDeath(creep); creep.destroy(); break; case 4: // unknown source Current.unit.OnDeath(null); break; } } }