Merge branch 'master' into random

This commit is contained in:
Michael Cook (mackal) 2014-12-03 16:13:39 -05:00
commit bc53ca3b71

View File

@ -827,6 +827,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
this function is then run again to do the damage portion
*/
bool LaunchProjectile = false;
bool ProjectileImpact = false;
bool ProjectileMiss = false;
if (RuleB(Combat, ProjectileDmgOnImpact)){
@ -843,6 +844,8 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
if (!RangeWeapon && !Ammo && range_id && ammo_id){
ProjectileImpact = true;
if (weapon_damage == 0)
ProjectileMiss = true; //This indicates that MISS was originally calculated.
@ -864,7 +867,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
else if (AmmoItem)
SendItemAnimation(other, AmmoItem, SkillArchery);
if (ProjectileMiss || !other->CheckHitChance(this, SkillArchery, MainPrimary, chance_mod)) {
if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillArchery, MainPrimary, chance_mod))) {
mlog(COMBAT__RANGED, "Ranged attack missed %s.", other->GetName());
if (LaunchProjectile){
@ -1380,6 +1383,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
this function is then run again to do the damage portion
*/
bool LaunchProjectile = false;
bool ProjectileImpact = false;
bool ProjectileMiss = false;
if (RuleB(Combat, ProjectileDmgOnImpact)){
@ -1389,6 +1393,8 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
else{
if (!RangeWeapon && range_id){
ProjectileImpact = true;
if (weapon_damage == 0)
ProjectileMiss = true; //This indicates that MISS was originally calculated.
@ -1406,7 +1412,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
else if (AmmoItem)
SendItemAnimation(other, AmmoItem, SkillThrowing);
if (ProjectileMiss || !other->CheckHitChance(this, SkillThrowing, MainPrimary, chance_mod)){
if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillThrowing, MainPrimary, chance_mod))){
mlog(COMBAT__RANGED, "Ranged attack missed %s.", other->GetName());
if (LaunchProjectile){
TryProjectileAttack(other, AmmoItem, SkillThrowing, 0, RangeWeapon, nullptr, AmmoSlot, speed);