v0.6.2: improved emoicons and removed enemy state from descriptions
This commit is contained in:
parent
70a39f4229
commit
bb5e798b98
Binary file not shown.
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.2 KiB |
|
@ -160,7 +160,11 @@ public abstract class Mob extends Char {
|
|||
boolean justAlerted = alerted;
|
||||
alerted = false;
|
||||
|
||||
if (justAlerted){
|
||||
sprite.showAlert();
|
||||
} else {
|
||||
sprite.hideAlert();
|
||||
}
|
||||
|
||||
if (paralysed > 0) {
|
||||
enemySeen = false;
|
||||
|
@ -517,7 +521,9 @@ public abstract class Mob extends Char {
|
|||
if (state == SLEEPING) {
|
||||
state = WANDERING;
|
||||
}
|
||||
if (state != HUNTING) {
|
||||
alerted = true;
|
||||
}
|
||||
|
||||
super.damage( dmg, src );
|
||||
}
|
||||
|
@ -631,7 +637,6 @@ public abstract class Mob extends Char {
|
|||
|
||||
public interface AiState {
|
||||
boolean act( boolean enemyInFOV, boolean justAlerted );
|
||||
String status();
|
||||
}
|
||||
|
||||
protected class Sleeping implements AiState {
|
||||
|
@ -667,11 +672,6 @@ public abstract class Mob extends Char {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String status() {
|
||||
return Messages.get(this, "status", name );
|
||||
}
|
||||
}
|
||||
|
||||
protected class Wandering implements AiState {
|
||||
|
@ -685,12 +685,14 @@ public abstract class Mob extends Char {
|
|||
enemySeen = true;
|
||||
|
||||
notice();
|
||||
alerted = true;
|
||||
state = HUNTING;
|
||||
target = enemy.pos;
|
||||
|
||||
} else {
|
||||
|
||||
enemySeen = false;
|
||||
sprite.hideLost();
|
||||
|
||||
int oldPos = pos;
|
||||
if (target != -1 && getCloser( target )) {
|
||||
|
@ -704,11 +706,6 @@ public abstract class Mob extends Char {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String status() {
|
||||
return Messages.get(this, "status", name );
|
||||
}
|
||||
}
|
||||
|
||||
protected class Hunting implements AiState {
|
||||
|
@ -737,17 +734,16 @@ public abstract class Mob extends Char {
|
|||
} else {
|
||||
|
||||
spend( TICK );
|
||||
|
||||
if (!enemyInFOV) {
|
||||
sprite.showLost();
|
||||
state = WANDERING;
|
||||
target = Dungeon.level.randomDestination();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String status() {
|
||||
return Messages.get(this, "status", name );
|
||||
}
|
||||
}
|
||||
|
||||
protected class Fleeing implements AiState {
|
||||
|
@ -781,11 +777,6 @@ public abstract class Mob extends Char {
|
|||
|
||||
protected void nowhereToRun() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String status() {
|
||||
return Messages.get(this, "status", name );
|
||||
}
|
||||
}
|
||||
|
||||
protected class Passive implements AiState {
|
||||
|
@ -798,11 +789,6 @@ public abstract class Mob extends Char {
|
|||
spend( TICK );
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String status() {
|
||||
return Messages.get(this, "status", name );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -104,4 +104,23 @@ public class EmoIcon extends Image {
|
|||
}
|
||||
}
|
||||
|
||||
public static class Lost extends EmoIcon {
|
||||
|
||||
public Lost( CharSprite owner ){
|
||||
super( owner );
|
||||
|
||||
copy( Icons.get( Icons.LOST ) );
|
||||
|
||||
maxSize = 1.25f;
|
||||
timeScale = 1;
|
||||
|
||||
origin.set( 2.5f, height - 2.5f );
|
||||
scale.set( Random.Float( 1, maxSize ) );
|
||||
|
||||
x = owner.x + owner.width - width / 2;
|
||||
y = owner.y - height;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -228,8 +228,8 @@ public class GameScene extends PixelScene {
|
|||
|
||||
emitters = new Group();
|
||||
effects = new Group();
|
||||
emoicons = new Group();
|
||||
healthIndicators = new Group();
|
||||
emoicons = new Group();
|
||||
|
||||
mobs = new Group();
|
||||
add( mobs );
|
||||
|
@ -275,6 +275,10 @@ public class GameScene extends PixelScene {
|
|||
statuses = new Group();
|
||||
add( statuses );
|
||||
|
||||
add( healthIndicators );
|
||||
//always appears ontop of other health indicators
|
||||
add( new TargetHealthIndicator() );
|
||||
|
||||
add( emoicons );
|
||||
|
||||
hero = new HeroSprite();
|
||||
|
@ -282,10 +286,6 @@ public class GameScene extends PixelScene {
|
|||
hero.updateArmor();
|
||||
mobs.add( hero );
|
||||
|
||||
add( healthIndicators );
|
||||
//always appears ontop of other health indicators
|
||||
add( new TargetHealthIndicator() );
|
||||
|
||||
add( cellSelector = new CellSelector( tiles ) );
|
||||
|
||||
pane = new StatusPane();
|
||||
|
|
|
@ -489,6 +489,25 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
|
|||
}
|
||||
}
|
||||
|
||||
public synchronized void showLost() {
|
||||
if (emo instanceof EmoIcon.Lost) {
|
||||
|
||||
} else {
|
||||
if (emo != null) {
|
||||
emo.killAndErase();
|
||||
}
|
||||
emo = new EmoIcon.Lost( this );
|
||||
emo.visible = visible;
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void hideLost() {
|
||||
if (emo instanceof EmoIcon.Lost) {
|
||||
emo.killAndErase();
|
||||
emo = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void kill() {
|
||||
super.kill();
|
||||
|
|
|
@ -45,6 +45,7 @@ public enum Icons {
|
|||
DEPTH,
|
||||
SLEEP,
|
||||
ALERT,
|
||||
LOST,
|
||||
BACKPACK,
|
||||
SEED_POUCH,
|
||||
SCROLL_HOLDER,
|
||||
|
@ -112,7 +113,7 @@ public enum Icons {
|
|||
icon.frame( icon.texture.uvRect( 0, 45, 13, 58 ) );
|
||||
break;
|
||||
case DEPTH:
|
||||
icon.frame( icon.texture.uvRect( 34, 46, 50, 62 ) );
|
||||
icon.frame( icon.texture.uvRect( 38, 46, 54, 62 ) );
|
||||
break;
|
||||
case SLEEP:
|
||||
icon.frame( icon.texture.uvRect( 13, 45, 22, 53 ) );
|
||||
|
@ -120,6 +121,9 @@ public enum Icons {
|
|||
case ALERT:
|
||||
icon.frame( icon.texture.uvRect( 22, 45, 30, 53 ) );
|
||||
break;
|
||||
case LOST:
|
||||
icon.frame( icon.texture.uvRect( 30, 45, 38, 53 ) );
|
||||
break;
|
||||
case BACKPACK:
|
||||
icon.frame( icon.texture.uvRect( 58, 0, 68, 10 ) );
|
||||
break;
|
||||
|
|
|
@ -34,19 +34,10 @@ public class WndInfoMob extends WndTitledMessage {
|
|||
|
||||
public WndInfoMob( Mob mob ) {
|
||||
|
||||
super( new MobTitle( mob ), desc( mob ) );
|
||||
super( new MobTitle( mob ), mob.description() );
|
||||
|
||||
}
|
||||
|
||||
private static String desc( Mob mob ) {
|
||||
|
||||
StringBuilder builder = new StringBuilder( mob.description() );
|
||||
|
||||
builder.append( "\n\n" + mob.state.status() );
|
||||
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
private static class MobTitle extends Component {
|
||||
|
||||
private static final int GAP = 2;
|
||||
|
|
|
@ -456,11 +456,6 @@ actors.mobs.mob.died=You hear something die in the distance.
|
|||
actors.mobs.mob.rage=#$%^
|
||||
actors.mobs.mob.exp=%+dEXP
|
||||
actors.mobs.mob.rankings_desc=Slain by: %s
|
||||
actors.mobs.mob$sleeping.status=This %s is sleeping.
|
||||
actors.mobs.mob$wandering.status=This %s is wandering.
|
||||
actors.mobs.mob$hunting.status=This %s is hunting.
|
||||
actors.mobs.mob$fleeing.status=This %s is fleeing.
|
||||
actors.mobs.mob$passive.status=This %s is passive.
|
||||
|
||||
actors.mobs.monk.name=dwarf monk
|
||||
actors.mobs.monk.disarm=The monk knocks the %s from your hands!
|
||||
|
|
Loading…
Reference in New Issue
Block a user