Blowing up the reactor sets karma to 0, all jobs except assistant require a certain karma level

This commit is contained in:
juanjp600
2017-12-04 17:05:22 -03:00
parent 2347f2937e
commit a0782e5d8d
9 changed files with 57 additions and 15 deletions
@@ -1565,7 +1565,7 @@ namespace Barotrauma
public virtual AttackResult AddDamage(IDamageable attacker, Vector2 worldPosition, Attack attack, float deltaTime, bool playSound = false)
{
Limb limbHit = null;
var attackResult = AddDamage(worldPosition, attack.DamageType, attack.GetDamage(deltaTime), attack.GetBleedingDamage(deltaTime), attack.Stun, playSound, attack.TargetForce, out limbHit);
var attackResult = AddDamage(worldPosition, attack.DamageType, attack.GetDamage(deltaTime), attack.GetBleedingDamage(deltaTime), attack.Stun, playSound, attack.TargetForce, out limbHit, attacker);
if (limbHit == null) return new AttackResult();
var attackingCharacter = attacker as Character;
@@ -1612,7 +1612,7 @@ namespace Barotrauma
return AddDamage(worldPosition, damageType, amount, bleedingAmount, stun, playSound, attackForce, out temp);
}
public AttackResult AddDamage(Vector2 worldPosition, DamageType damageType, float amount, float bleedingAmount, float stun, bool playSound, float attackForce, out Limb hitLimb)
public AttackResult AddDamage(Vector2 worldPosition, DamageType damageType, float amount, float bleedingAmount, float stun, bool playSound, float attackForce, out Limb hitLimb,IDamageable attacker=null)
{
hitLimb = null;
@@ -1640,7 +1640,7 @@ namespace Barotrauma
AttackResult attackResult = hitLimb.AddDamage(worldPosition, damageType, amount, bleedingAmount, playSound);
AddDamage(damageType == DamageType.Burn ? CauseOfDeath.Burn : causeOfDeath, attackResult.Damage, null);
AddDamage(damageType == DamageType.Burn ? CauseOfDeath.Burn : causeOfDeath, attackResult.Damage, attacker);
if (DoesBleed)
{
@@ -47,6 +47,12 @@ namespace Barotrauma
private set;
}
public float MinKarma
{
get;
private set;
}
public float Commonness
{
get;
@@ -61,6 +67,7 @@ namespace Barotrauma
MinNumber = element.GetAttributeInt("minnumber", 0);
MaxNumber = element.GetAttributeInt("maxnumber", 10);
MinKarma = element.GetAttributeFloat("minkarma", 0.0f);
Commonness = element.GetAttributeInt("commonness", 10);