Fix kill reward for skinned knives

This commit is contained in:
Nate Mortensen 2016-11-04 10:33:22 -06:00 committed by cnr
parent e1aeaa8714
commit afaed17071
3 changed files with 26 additions and 13 deletions

View File

@ -946,6 +946,7 @@ public class GunModule implements Listener
}
event.SetKnockback(false);
event.setMetadata("gunType", "KNIFE");
}
}
@ -1057,6 +1058,7 @@ public class GunModule implements Listener
event.SetIgnoreArmor(true);
Bukkit.getPluginManager().callEvent(new CustomGunDamageEvent(bullet, event.GetDamageePlayer(), hitArea == 1, event, this));
event.setMetadata("gunType", bullet.Gun.getGunStats().name());
}
public int getArrowHitArea(Player damagee, Location origin, Vector trajectory)

View File

@ -401,19 +401,26 @@ public class Minestrike extends TeamGame
if (GetTeam(killed).equals(GetTeam(killer)))
return;
int amount = 300;
int amount;
if (event.GetLog().GetLastDamager().GetReason().contains("AWP"))
amount = 100;
else if (event.GetLog().GetLastDamager().GetReason().contains("PP-Bizon"))
amount = 600;
else if (event.GetLog().GetLastDamager().GetReason().contains("Nova"))
amount = 900;
else if (event.GetLog().GetLastDamager().GetReason().contains("Knife"))
amount = 1500;
String gunType = (String) event.GetLog().GetLastDamager().GetDamage().getFirst().getMetadata().get("gunType");
switch (gunType)
{
case "AWP":
amount = 100;
break;
case "PPBIZON":
amount = 600;
break;
case "NOVA":
amount = 900;
break;
case "KNIFE":
amount = 1500;
break;
default:
amount = 300;
}
_shopManager.addMoney(killer, amount, "kill with " + event.GetLog().GetLastDamager().GetReason());

View File

@ -588,7 +588,11 @@ public class Gun extends StrikeItem
{
return _gunStats.getGunType();
}
public GunStats getGunStats()
{
return _gunStats;
}
public String getBaseStatName(boolean withPlayerName)
{
return (withPlayerName ? getOwnerName() + "." : "") + getName() + "." + _activeSkinName;