Untitled
unknown
d
3 years ago
1.2 kB
5
Indexable
public void CalcAttack(CharacterComponent cc, Weapon weapon, Vector3 attackPosition, ITargetable t) { Reset(); target = t; var weaponProto = weapon.Prototype; var mainTargetAsCC = target as CharacterComponent; int dpe = weaponProto.DamagePierce; int ape = mainTargetAsCC.AntiPierce; int dt = mainTargetAsCC.DamageThreshold; int pierce = dpe - ape; bool ignoreArmor = false; if (pierce > 0) { int ignoreArmorDice = GetDice(1, 100); if (ignoreArmorDice <= pierce) { ignoreArmor = true; } } int meleeDamage = cc.Character.Stats.MeleeDamage; int finalDamage = GetDice(meleeDamage + weaponProto.DamageMin, meleeDamage + weaponProto.DamageMax); if(!ignoreArmor) { finalDamage = Math.Max(0, finalDamage - dt); } var a = new Attack(); a.bulletID = 0; a.status = AttackStatus.Hit; a.result = new AttackResult(weaponProto.Single.AP, finalDamage, attackPosition, 0, false, 0, WeaponProto.DamageTypeParam.Normal, false, 0, 0, 0, 0); attacks.Add(a); }
Editor is loading...