void FloatingDamagetoCity(Ccity victim, mob attacker, int amount, string explanation = "", bool flashsupress = false) { Color c; if (amount == 0) { c = Color.grey; } else { c = (amount < 0) ? Color.red : Color.green; } FloatingTextItems.Add(new FloatingTextItem(explanation + " " + amount + " hp", victim.posx, victim.posy, c)); if (attacker == player.mob) { log.Printline(attacker.archetype.name + " deals " + (-amount) + " to " + victim.name + " [" + explanation + "]", Color.green); } else { log.Printline(victim.name, c); if (amount <= 0) { log.Print(" takes ", c); } else { log.Print(" gains ", c); } log.Print(amount + " from " + attacker.archetype.name, c); if (explanation.Length > 0) { log.Print("[" + explanation + "]", c); } } //actually do the damage victim.hp += amount; c.a = 0.5f; map.gridflashcolour[victim.posx, victim.posy] = c; map.gridflashtime[victim.posx, victim.posy] = Time.time + 0.5f; }
void FloatingDamage(mob victim, mob attacker, int amount, string explanation = "", bool flashsupress = false) { Color c; //deal with super buffs if (victim != attacker) { if (attacker.hasattackup) { amount -= 100; if (!victim.dead_currently) { log.Printline("Aided by cairn power " + attacker.archetype.name + " strikes true!", Color.magenta); } } if (victim.hasdefenseup) { if (amount < 0) { amount = 0; if (!victim.dead_currently) { log.Printline("The cairn power protects " + victim.archetype.name + "!", Color.magenta); } } } } if (amount == 0) { c = Color.grey; } else { c = (amount < 0) ? Color.red : Color.green; } if (amount > 0 && victim.hp + amount > victim.archetype.hp) { amount = victim.archetype.hp - victim.hp; } FloatingTextItems.Add(new FloatingTextItem(explanation + " " + amount + " hp", victim.posx, victim.posy, c)); // if (attacker.tile == Etilesprite.ENEMY_GIANTBAT && victim != attacker) FloatingDamage(attacker, attacker, -amount, "blood drain"); // if ((attacker.tile == Etilesprite.ENEMY_NECROMANCER||attacker.tile==Etilesprite.ENEMY_LICH) && victim != attacker) FloatingDamage(attacker, attacker, -amount, "drain life"); if (attacker == player.mob && victim != player.mob) { if (!victim.dead_currently) { log.Printline(attacker.archetype.name + " deals " + (-amount) + " to " + victim.archetype.name + " [" + explanation + "]", Color.green); } } else { if (!victim.dead_currently) { log.Printline(victim.archetype.name, c); if (amount <= 0) { log.Print(" takes ", c); } else { log.Print(" gains ", c); } if (victim == attacker) { log.Print(amount + " ", c); } else { log.Print(amount + " from " + attacker.archetype.name, c); } if (explanation.Length > 0) { log.Print("[" + explanation + "]", c); } } } //actually do the damage victim.hp += amount; c.a = 0.5f; //if (map.displaychar[victim.posx, victim.posy] != Etilesprite.MAP_WATER && amount != 0) // if (map.bloodgrid[victim.posx, victim.posy] == null) // { // if(victim.archetype.tile!=Etilesprite.ENEMY_ICE_GOLEM && victim.undead_currently==false) // map.bloodgrid[victim.posx, victim.posy] = lil.randi(0, 3) + ((amount < -3) ? 4 : 0); // } map.gridflashcolour[victim.posx, victim.posy] = c; map.gridflashtime[victim.posx, victim.posy] = Time.time + 0.5f; //if (attacker.tile == Etilesprite.ENEMY_MAGE && attacker!=victim) //{ // log.Printline(victim.archetype.name + " is slowed!"); // victim.speed = 0; //} }