Skip to content

Commit

Permalink
#43: Localized Blobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Arcnor committed Oct 13, 2014
1 parent 7ba3a6c commit 77b7802
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 35 deletions.
15 changes: 14 additions & 1 deletion android/assets/i18n/l10n.properties
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,17 @@ glyph_viscosity = {0} of viscosity

# Glyphs (Viscosity)
glyph_viscosity_deferred = deferred {0,number,integer}
glyph_viscosity_deferred_damage = Deferred damage ({0,number,integer})
glyph_viscosity_deferred_damage = Deferred damage ({0,number,integer})

# Blobs
blog_fire_desc = A fire is raging here.
blob_foliage_desc = Shafts of light pierce the gloom of the underground garden.
blob_paralytic_gas_desc = A cloud of paralytic gas is swirling here.
blob_toxic_gas_desc = A greenish cloud of toxic gas is swirling here.
blob_water_aware_desc = Power of knowledge radiates from the water of this well. Take a sip from it to reveal all secrets of equipped items.
blob_water_aware_proceed = As you take a sip, you feel the knowledge pours into your mind. \
Now you know everything about your equipped items. Also you sense all items on the level and know all its secrets.
blob_water_health_desc = Power of health radiates from the water of this well. Take a sip from it to heal your wounds and satisfy hunger.
blob_water_health_proceed = As you take a sip, you feel your wounds heal completely.
blob_water_transmute_desc = Power of change radiates from the water of this well. Throw an item into the well to turn it into something else.
blob_web_desc = Everything is covered with a thick web here.
5 changes: 4 additions & 1 deletion core/src/com/watabou/pixeldungeon/actors/blobs/Blob.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,10 @@ public void clear( int cell ) {
volume -= cur[cell];
cur[cell] = 0;
}


/**
* @return the KEY of the string to translate, not the translated string itself
*/
public String tileDesc() {
return null;
}
Expand Down
6 changes: 4 additions & 2 deletions core/src/com/watabou/pixeldungeon/actors/blobs/Fire.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
import com.watabou.pixeldungeon.scenes.GameScene;

public class Fire extends Blob {


private static final String TXT_DESC = "blob_fire_desc";

@Override
protected void evolve() {

Expand Down Expand Up @@ -109,6 +111,6 @@ public void use( BlobEmitter emitter ) {

@Override
public String tileDesc() {
return "A fire is raging here.";
return TXT_DESC;
}
}
6 changes: 4 additions & 2 deletions core/src/com/watabou/pixeldungeon/actors/blobs/Foliage.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
import com.watabou.pixeldungeon.scenes.GameScene;

public class Foliage extends Blob {


private static final String TXT_DESC = "blob_foliage_desc";

@Override
protected void evolve() {

Expand Down Expand Up @@ -81,6 +83,6 @@ public void use( BlobEmitter emitter ) {

@Override
public String tileDesc() {
return "Shafts of light pierce the gloom of the underground garden.";
return TXT_DESC;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
import com.watabou.pixeldungeon.effects.Speck;

public class ParalyticGas extends Blob {


private static final String TXT_DESC = "blob_paralytic_gas_desc";

@Override
protected void evolve() {
super.evolve();
Expand All @@ -47,6 +49,6 @@ public void use( BlobEmitter emitter ) {

@Override
public String tileDesc() {
return "A cloud of paralytic gas is swirling here.";
return TXT_DESC;
}
}
6 changes: 4 additions & 2 deletions core/src/com/watabou/pixeldungeon/actors/blobs/ToxicGas.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
import static com.watabou.noosa.NoosaI18N.tr;

public class ToxicGas extends Blob implements Hero.Doom {


private static final String TXT_DESC = "blob_toxic_gas_desc";

@Override
protected void evolve() {
super.evolve();
Expand Down Expand Up @@ -81,7 +83,7 @@ public void use( BlobEmitter emitter ) {

@Override
public String tileDesc() {
return "A greenish cloud of toxic gas is swirling here.";
return TXT_DESC;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
import com.watabou.pixeldungeon.scenes.GameScene;
import com.watabou.pixeldungeon.utils.GLog;

import static com.watabou.noosa.NoosaI18N.tr;

public class WaterOfAwareness extends WellWater {

private static final String TXT_PROCCED =
"As you take a sip, you feel the knowledge pours into your mind. " +
"Now you know everything about your equipped items. Also you sense " +
"all items on the level and know all its secrets.";

private static final String TXT_PROCEED = "blob_water_aware_proceed";
private static final String TXT_DESC = "blob_water_aware_desc";

@Override
protected boolean affectHero( Hero hero ) {

Expand All @@ -56,7 +56,7 @@ protected boolean affectHero( Hero hero ) {
int terr = Dungeon.level.map[i];
if ((Terrain.flags[terr] & Terrain.SECRET) != 0) {

Level.set( i, Terrain.discover( terr ) );
Level.set( i, Terrain.discover( terr ) );
GameScene.updateMap( i );

if (Dungeon.visible[i]) {
Expand All @@ -70,7 +70,7 @@ protected boolean affectHero( Hero hero ) {

Dungeon.hero.interrupt();

GLog.p( TXT_PROCCED );
GLog.p(tr(TXT_PROCEED));

Journal.remove( Feature.WELL_OF_AWARENESS );

Expand Down Expand Up @@ -101,8 +101,6 @@ public void use( BlobEmitter emitter ) {

@Override
public String tileDesc() {
return
"Power of knowledge radiates from the water of this well. " +
"Take a sip from it to reveal all secrets of equipped items.";
return TXT_DESC;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@

public class WaterOfHealth extends WellWater {

private static final String TXT_PROCCED =
"As you take a sip, you feel your wounds heal completely.";
private static final String TXT_PROCEED = "blob_water_health_proceed";
private static final String TXT_DESC = "blob_water_health_desc";

@Override
protected boolean affectHero( Hero hero ) {

Sample.INSTANCE.play( Assets.SND_DRINK );

PotionOfHealing.heal( hero );
hero.belongings.uncurseEquipped();
((Hunger)hero.buff( Hunger.class )).satisfy( Hunger.STARVING );
hero.buff( Hunger.class ).satisfy(Hunger.STARVING);

CellEmitter.get( pos ).start( ShaftParticle.FACTORY, 0.2f, 3 );

Dungeon.hero.interrupt();

GLog.p( TXT_PROCCED );
GLog.p(TXT_PROCEED);

Journal.remove( Feature.WELL_OF_HEALTH );

Expand All @@ -76,8 +76,6 @@ public void use( BlobEmitter emitter ) {

@Override
public String tileDesc() {
return
"Power of health radiates from the water of this well. " +
"Take a sip from it to heal your wounds and satisfy hunger.";
return TXT_DESC;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
import com.watabou.pixeldungeon.plants.Plant;

public class WaterOfTransmutation extends WellWater {


private static final String TXT_DESC = "blob_water_transmute_desc";

@Override
protected Item affectItem( Item item ) {

Expand Down Expand Up @@ -230,8 +232,6 @@ private Potion changePotion( Potion p ) {

@Override
public String tileDesc() {
return
"Power of change radiates from the water of this well. " +
"Throw an item into the well to turn it into something else.";
return TXT_DESC;
}
}
6 changes: 4 additions & 2 deletions core/src/com/watabou/pixeldungeon/actors/blobs/Web.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
import com.watabou.pixeldungeon.effects.particles.WebParticle;

public class Web extends Blob {


private static final String TXT_DESC = "blob_web_desc";

@Override
protected void evolve() {

Expand Down Expand Up @@ -63,6 +65,6 @@ public void seed( int cell, int amount ) {

@Override
public String tileDesc() {
return "Everything is covered with a thick web here.";
return TXT_DESC;
}
}
4 changes: 3 additions & 1 deletion core/src/com/watabou/pixeldungeon/windows/WndInfoCell.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import com.watabou.pixeldungeon.scenes.PixelScene;
import com.watabou.pixeldungeon.ui.Window;

import static com.watabou.noosa.NoosaI18N.tr;

public class WndInfoCell extends Window {

private static final float GAP = 2;
Expand Down Expand Up @@ -69,7 +71,7 @@ public WndInfoCell( int cell ) {
if (desc.length() > 0) {
desc.append( newLine );
}
desc.append( blob.tileDesc() );
desc.append( tr(blob.tileDesc()) );
}
}

Expand Down

0 comments on commit 77b7802

Please sign in to comment.