Skip to content

Commit

Permalink
thoqqua is now immune to suffication, more vulnerable to water
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackJar72 committed Sep 2, 2019
1 parent af8b6f3 commit fe6166f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/main/java/com/gw/dm/entity/EntityThoqqua.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ public void onLivingUpdate() {
super.onLivingUpdate();

changeLavaToMagma(false);

if(inWater) {
damageEntity(DamageSource.DROWN, 1);
}

setShitOnFire++;
attackTime--;
Expand Down Expand Up @@ -314,4 +318,28 @@ public void setDead() {
}


@Override
public boolean attackEntityFrom(DamageSource source, float amount) {
if(immune(source)) {
return false;
}
return super.attackEntityFrom(source, amount);
}


@Override
protected void damageEntity(DamageSource source, float damageAmount) {
if(immune(source)) {
return;
}
super.damageEntity(source, damageAmount);
}


private boolean immune(DamageSource source) {
return source.isFireDamage() || (source == DamageSource.LAVA) ||
(source == DamageSource.IN_WALL);
}


}

0 comments on commit fe6166f

Please sign in to comment.