v0.4.3a: implemented a halloween treat
This commit is contained in:
parent
7651e4c557
commit
e065d68f71
Binary file not shown.
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
@ -24,6 +24,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
|
@ -37,7 +38,7 @@ public class Pasty extends Food {
|
|||
private enum Holiday{
|
||||
NONE,
|
||||
EASTER, //TBD
|
||||
HALLOWEEN,//TBD
|
||||
HWEEN,//2nd week of october though first day of november
|
||||
XMAS //3rd week of december through first week of january
|
||||
}
|
||||
|
||||
|
@ -45,18 +46,25 @@ public class Pasty extends Food {
|
|||
|
||||
static{
|
||||
final Calendar calendar = Calendar.getInstance();
|
||||
switch(calendar.get(Calendar.MONTH)){
|
||||
default:
|
||||
holiday = Holiday.NONE;
|
||||
//we add 1 to turn it into standard calendar months (1-12 instead of 0-11)
|
||||
switch(calendar.get(Calendar.MONTH)+1){
|
||||
case 1:
|
||||
if (calendar.get(Calendar.WEEK_OF_MONTH) == 1){
|
||||
holiday = Holiday.XMAS;
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
if (calendar.get(Calendar.WEEK_OF_MONTH) >= 3){
|
||||
case Calendar.JANUARY:
|
||||
if (calendar.get(Calendar.WEEK_OF_MONTH) == 1)
|
||||
holiday = Holiday.XMAS;
|
||||
break;
|
||||
case Calendar.OCTOBER:
|
||||
if (calendar.get(Calendar.WEEK_OF_MONTH) >= 2)
|
||||
holiday = Holiday.HWEEN;
|
||||
break;
|
||||
case Calendar.NOVEMBER:
|
||||
if (calendar.get(Calendar.DAY_OF_MONTH) == 1)
|
||||
holiday = Holiday.HWEEN;
|
||||
break;
|
||||
case Calendar.DECEMBER:
|
||||
if (calendar.get(Calendar.WEEK_OF_MONTH) >= 3)
|
||||
holiday = Holiday.XMAS;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -68,6 +76,10 @@ public class Pasty extends Food {
|
|||
name = Messages.get(this, "pasty");
|
||||
image = ItemSpriteSheet.PASTY;
|
||||
break;
|
||||
case HWEEN:
|
||||
name = Messages.get(this, "pie");
|
||||
image = ItemSpriteSheet.PUMPKIN_PIE;
|
||||
break;
|
||||
case XMAS:
|
||||
name = Messages.get(this, "cane");
|
||||
image = ItemSpriteSheet.CANDY_CANE;
|
||||
|
@ -88,6 +100,11 @@ public class Pasty extends Food {
|
|||
switch(holiday){
|
||||
case NONE: default:
|
||||
break; //do nothing extra
|
||||
case HWEEN:
|
||||
//heals for 10% max hp
|
||||
hero.HP = Math.min(hero.HP + hero.HT/10, hero.HT);
|
||||
hero.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 );
|
||||
break;
|
||||
case XMAS:
|
||||
Buff.affect( hero, Recharging.class, 2f ); //half of a charge
|
||||
ScrollOfRecharging.charge( hero );
|
||||
|
@ -101,6 +118,8 @@ public class Pasty extends Food {
|
|||
switch(holiday){
|
||||
case NONE: default:
|
||||
return Messages.get(this, "pasty_desc");
|
||||
case HWEEN:
|
||||
return Messages.get(this, "pie_desc");
|
||||
case XMAS:
|
||||
return Messages.get(this, "cane_desc");
|
||||
}
|
||||
|
|
|
@ -241,7 +241,8 @@ public class ItemSpriteSheet {
|
|||
public static final int BLANDFRUIT = FOOD+4;
|
||||
public static final int RATION = FOOD+5;
|
||||
public static final int PASTY = FOOD+6;
|
||||
public static final int CANDY_CANE = FOOD+7;
|
||||
public static final int PUMPKIN_PIE = FOOD+7;
|
||||
public static final int CANDY_CANE = FOOD+8;
|
||||
|
||||
private static final int QUEST = xy(1, 26); //32 slots
|
||||
public static final int SKULL = QUEST+0;
|
||||
|
|
|
@ -368,10 +368,12 @@ items.food.overpricedration.eat_msg=That food tasted ok.
|
|||
items.food.overpricedration.desc=It looks exactly like a standard ration of food but smaller.
|
||||
|
||||
items.food.pasty.pasty=pasty
|
||||
items.food.pasty.pie=pumpkin pie
|
||||
items.food.pasty.cane=candy cane
|
||||
|
||||
items.food.food.pasty_desc=This is authentic Cornish pasty with traditional filling of beef and potato.
|
||||
items.food.food.cane_desc=A huge sugary sweet candy cane! It's big enough to fill you up, and the sugar might give your wands a tiny bit of extra charge too.\n\nHappy Holidays!
|
||||
items.food.pasty.pasty_desc=This is authentic Cornish pasty with traditional filling of beef and potato.
|
||||
items.food.pasty.pie_desc=A great big slice of pumpkin pie! Its sweet and spicy flavor will fill you up and give you a tiny bit of healing.\n\nHappy Halloween!
|
||||
items.food.pasty.cane_desc=A huge sugary sweet candy cane! It's big enough to fill you up, and the sugar might give your wands a tiny bit of extra charge too.\n\nHappy Holidays!
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user