V0.2.1: tweaked some code in gnoll trickster and great crab.
This commit is contained in:
parent
cb381c1cbb
commit
4c102eb3f3
|
@ -468,22 +468,20 @@ public class Ghost extends Mob.NPC {
|
||||||
public int attackProc( Char enemy, int damage ) {
|
public int attackProc( Char enemy, int damage ) {
|
||||||
//The gnoll's attacks get more severe the more the player lets it hit them
|
//The gnoll's attacks get more severe the more the player lets it hit them
|
||||||
int effect = Random.Int(3)+combo;
|
int effect = Random.Int(3)+combo;
|
||||||
Burning aflame = enemy.buff(Burning.class);
|
|
||||||
|
|
||||||
if (effect <= 2) {
|
if (effect <= 2) {
|
||||||
|
|
||||||
Buff.prolong(enemy, Cripple.class, 2f);
|
Buff.prolong(enemy, Cripple.class, 2f);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (effect >=4 && aflame == null){
|
if (effect >=4 && enemy.buff(Burning.class) == null){
|
||||||
|
|
||||||
if (Level.flamable[enemy.pos])
|
if (Level.flamable[enemy.pos])
|
||||||
GameScene.add( Blob.seed( enemy.pos, 4, Fire.class ) );
|
GameScene.add( Blob.seed( enemy.pos, 4, Fire.class ) );
|
||||||
Buff.affect( enemy, Burning.class ).reignite( enemy );
|
Buff.affect( enemy, Burning.class ).reignite( enemy );
|
||||||
|
|
||||||
} else
|
} else
|
||||||
Buff.affect( enemy, Poison.class).set(Random.Int(effect-2, effect) * Poison.durationFactor(enemy));
|
Buff.affect( enemy, Poison.class).set((effect-1) * Poison.durationFactor(enemy));
|
||||||
|
|
||||||
}
|
}
|
||||||
return damage;
|
return damage;
|
||||||
|
@ -535,12 +533,13 @@ public class Ghost extends Mob.NPC {
|
||||||
|
|
||||||
HP = HT = 30;
|
HP = HT = 30;
|
||||||
defenseSkill = 0; //see damage()
|
defenseSkill = 0; //see damage()
|
||||||
baseSpeed = 0.67f;
|
|
||||||
|
|
||||||
EXP = 6;
|
EXP = 6;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean moving = true;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int damageRoll() {
|
public int damageRoll() {
|
||||||
return Random.NormalIntRange( 4, 6 );
|
return Random.NormalIntRange( 4, 6 );
|
||||||
|
@ -556,6 +555,20 @@ public class Ghost extends Mob.NPC {
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean getCloser( int target ) {
|
||||||
|
|
||||||
|
//this is used such that the crab remains slow, but still detects the player at the expected rate.
|
||||||
|
if (moving) {
|
||||||
|
moving = false;
|
||||||
|
return super.getCloser( target );
|
||||||
|
} else {
|
||||||
|
moving = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//TODO: New functionality, test this with a variety of items/effects
|
//TODO: New functionality, test this with a variety of items/effects
|
||||||
@Override
|
@Override
|
||||||
public void damage( int dmg, Object src ){
|
public void damage( int dmg, Object src ){
|
||||||
|
@ -563,7 +576,7 @@ public class Ghost extends Mob.NPC {
|
||||||
//All direct damage from these sources is negated, no exceptions. blob/debuff effects go through as normal.
|
//All direct damage from these sources is negated, no exceptions. blob/debuff effects go through as normal.
|
||||||
if (enemySeen && (src instanceof Weapon || src instanceof Char)){
|
if (enemySeen && (src instanceof Weapon || src instanceof Char)){
|
||||||
GLog.w("The crab notices the attack and blocks with its massive claw.");
|
GLog.w("The crab notices the attack and blocks with its massive claw.");
|
||||||
sprite.showStatus( CharSprite.DEFAULT, "blocked" );
|
sprite.showStatus( CharSprite.NEUTRAL, "blocked" );
|
||||||
} else {
|
} else {
|
||||||
super.damage( dmg, src );
|
super.damage( dmg, src );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user