Skip to content

Commit

Permalink
#43: More Buffs localization
Browse files Browse the repository at this point in the history
  • Loading branch information
Arcnor committed Oct 15, 2014
1 parent 0be1c94 commit 83a45b6
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 25 deletions.
6 changes: 6 additions & 0 deletions android/assets/i18n/l10n.properties
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,14 @@ mob_larva_name = god's larva
buff_amok_name = Amok
buff_barkskin_name = Barkskin
buff_bleeding_name = Bleeding
buff_bleeding_killed = You bled to death...
buff_blindness_name = Blinded
buff_burning_name = Burning
buff_burning_killed = You burned to death...
buff_burning_burns = {0} burns up!
buff_charm_name = Charmed
buff_combo_name = Combo
buff_combo_combo = {0,number,integer} hit combo!
buff_cripple_name = Crippled
buff_frost_name = Frozen
buff_fury_name = Fury
Expand All @@ -351,8 +355,10 @@ buff_levitation_name = Levitating
buff_light_name = Illuminated
buff_mindvision_name = Mind vision
buff_ooze_name = Caustic ooze
buff_ooze_killed = Caustic ooze killed you...
buff_paralysis_name = Paralysed
buff_poison_name = Poisoned
buff_poison_killed = You died from poison...
buff_roots_name = Rooted
buff_shadows_name = Shadowmelded
buff_slow_name = Slowed
Expand Down
5 changes: 3 additions & 2 deletions core/src/com/watabou/pixeldungeon/actors/buffs/Bleeding.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@

public class Bleeding extends Buff {
private static final String TXT_NAME = "buff_bleeding_name";

private static final String TXT_HERO_KILLED = "buff_bleeding_killed";

protected int level;

private static final String BUNDLE_KEY_LEVEL = "level";
Expand Down Expand Up @@ -76,7 +77,7 @@ public boolean act() {

if (target == Dungeon.hero && !target.isAlive()) {
Dungeon.fail( tr(ResultDescriptions.BLEEDING, Dungeon.depth) );
GLog.n( "You bled to death..." );
GLog.n(tr(TXT_HERO_KILLED));
}

spend( TICK );
Expand Down
15 changes: 7 additions & 8 deletions core/src/com/watabou/pixeldungeon/actors/buffs/Burning.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,25 @@

public class Burning extends Buff implements Hero.Doom {
private static final String TXT_NAME = "buff_burning_name";
private static final String TXT_HERO_KILLED = "buff_burning_killed";
private static final String TXT_BURNS_UP = "buff_burning_burns";

private static final String TXT_BURNS_UP = "%s burns up!";
private static final String TXT_BURNED_TO_DEATH = "You burned to death...";

private static final float DURATION = 8f;

private float left;

private static final String LEFT = "left";
private static final String BUNDLE_KEY_LEFT = "left";

@Override
public void storeInBundle( Bundle bundle ) {
super.storeInBundle( bundle );
bundle.put( LEFT, left );
bundle.put(BUNDLE_KEY_LEFT, left );
}

@Override
public void restoreFromBundle( Bundle bundle ) {
super.restoreFromBundle(bundle);
left = bundle.getFloat( LEFT );
left = bundle.getFloat(BUNDLE_KEY_LEFT);
}

@Override
Expand All @@ -82,7 +81,7 @@ public boolean act() {
if (item instanceof Scroll) {

item = item.detach( ((Hero)target).belongings.backpack );
GLog.w( TXT_BURNS_UP, item.toString() );
GLog.w(tr(TXT_BURNS_UP, item.toString()));

Heap.burnFX( target.pos );

Expand Down Expand Up @@ -151,6 +150,6 @@ public void onDeath() {
Badges.validateDeathFromFire();

Dungeon.fail( tr(ResultDescriptions.BURNING, Dungeon.depth) );
GLog.n( TXT_BURNED_TO_DEATH );
GLog.n(tr(TXT_HERO_KILLED));
}
}
5 changes: 2 additions & 3 deletions core/src/com/watabou/pixeldungeon/actors/buffs/Combo.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@

public class Combo extends Buff {
private static final String TXT_NAME = "buff_combo_name";

private static final String TXT_COMBO = "%d hit combo!";
private static final String TXT_COMBO = "buff_combo_combo";

public int count = 0;

Expand All @@ -49,7 +48,7 @@ public int hit( Char enemy, int damage ) {

Badges.validateMasteryCombo( count );

GLog.p( TXT_COMBO, count );
GLog.p(tr(TXT_COMBO, count));
postpone( 1.41f - count / 10f );
return (int)(damage * (count - 2) / 5f);

Expand Down
5 changes: 2 additions & 3 deletions core/src/com/watabou/pixeldungeon/actors/buffs/Ooze.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@

public class Ooze extends Buff {
private static final String TXT_NAME = "buff_ooze_name";

private static final String TXT_HERO_KILLED = "%s killed you...";
private static final String TXT_HERO_KILLED = "buff_ooze_killed";

public int damage = 1;

Expand All @@ -48,7 +47,7 @@ public boolean act() {
target.damage( damage, this );
if (!target.isAlive() && target == Dungeon.hero) {
Dungeon.fail( tr(ResultDescriptions.OOZE, Dungeon.depth) );
GLog.n( TXT_HERO_KILLED, toString() );
GLog.n(tr(TXT_HERO_KILLED));
}
spend( TICK );
}
Expand Down
13 changes: 7 additions & 6 deletions core/src/com/watabou/pixeldungeon/actors/buffs/Poison.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,25 @@

public class Poison extends Buff implements Hero.Doom {
private static final String TXT_NAME = "buff_poison_name";

private static final String TXT_HERO_KILLED = "buff_poison_killed";

public static final int DOT = 2;

protected float left;

private static final String LEFT = "left";
private static final String BUNDLE_KEY_LEFT = "left";

@Override
public void storeInBundle( Bundle bundle ) {
super.storeInBundle( bundle );
bundle.put( LEFT, left );
bundle.put(BUNDLE_KEY_LEFT, left );

}

@Override
public void restoreFromBundle( Bundle bundle ) {
super.restoreFromBundle( bundle );
left = bundle.getFloat( LEFT );
left = bundle.getFloat(BUNDLE_KEY_LEFT);
}

public void set( float duration ) {
Expand Down Expand Up @@ -95,6 +96,6 @@ public void onDeath() {
Badges.validateDeathFromPoison();

Dungeon.fail( tr(ResultDescriptions.POISON, Dungeon.depth) );
GLog.n( "You died from poison..." );
GLog.n(tr(TXT_HERO_KILLED));
}
}
6 changes: 3 additions & 3 deletions core/src/com/watabou/pixeldungeon/actors/buffs/Shadows.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ public class Shadows extends Invisibility {

protected float left;

private static final String LEFT = "left";
private static final String BUNDLE_KEY_LEFT = "left";

@Override
public void storeInBundle( Bundle bundle ) {
super.storeInBundle( bundle );
bundle.put( LEFT, left );
bundle.put(BUNDLE_KEY_LEFT, left );

}

@Override
public void restoreFromBundle( Bundle bundle ) {
super.restoreFromBundle( bundle );
left = bundle.getFloat( LEFT );
left = bundle.getFloat(BUNDLE_KEY_LEFT);
}

@Override
Expand Down

0 comments on commit 83a45b6

Please sign in to comment.