v2.3.0: implemented new holiday items for feb-april, minus sprites

This commit is contained in:
Evan Debenham
2023-11-29 12:49:32 -05:00
parent 1a9bb22968
commit 3694bc666d
8 changed files with 122 additions and 44 deletions
@@ -574,12 +574,21 @@ items.food.mysterymeat$placeholder.name=meat
items.food.phantommeat.name=phantom meat items.food.phantommeat.name=phantom meat
items.food.phantommeat.desc=A large glistening translucent steak, cut from a phantom piranha. This magical meat doesn't need to be cooked and grants a number of defensive benefits in addition to fully satiating you. When eaten it will grant invisibility, barkskin, some healing, and cures many harmful effects. items.food.phantommeat.desc=A large glistening translucent steak, cut from a phantom piranha. This magical meat doesn't need to be cooked and grants a number of defensive benefits in addition to fully satiating you. When eaten it will grant invisibility, barkskin, some healing, and cures many harmful effects.
items.food.pasty.pasty=pasty items.food.pasty.name=pasty
items.food.pasty.pie=pumpkin pie items.food.pasty.fish_name=steamed fish
items.food.pasty.cane=candy cane items.food.pasty.amulet_name=amulet of yendor?
items.food.pasty.pasty_desc=An authentic Cornish pasty with a traditional filling of beef and potato. Delicious! items.food.pasty.egg_name=easter egg
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.pie_name=pumpkin pie
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! items.food.pasty.cane_name=candy cane
items.food.pasty.desc=An authentic Cornish pasty with a traditional filling of beef and potato. Delicious!
items.food.pasty.fish_desc=A whole steamed fish, magically preserved on a bed of greens. It's tradition to save some fish for later around this time of year, so you'll keep some leftovers instead of eating it all at once.\n\nHappy Lunar New Year!
items.food.pasty.amulet_desc=You've finally found it, the magical amulet of - wait a minute, this is just a foil-wrapped chocolate made to look like the amulet! It won't grant you limitless power, but at least it'll fill you up and give you a little artifact charge.\n\nApril Fools!
items.food.pasty.egg_desc=A great big chocolate egg, wrapped in colorful foil. There's easily enough chocolate here to fill you up, and the suger might give your artifacts a tiny bit of extra charge.\n\nHappy Easter!
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!
items.food.pasty$fishleftover.name=fish leftovers
items.food.pasty$fishleftover.eat_msg=That food tasted ok.
items.food.pasty$fishleftover.desc=Some surplus fish from your previous meal. You can eat it any time you like to restore a little hunger.
items.food.smallration.name=small food ration items.food.smallration.name=small food ration
items.food.smallration.eat_msg=That food tasted ok. items.food.smallration.eat_msg=That food tasted ok.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

@@ -124,4 +124,12 @@ public class ArtifactRecharge extends Buff {
left = bundle.getFloat(LEFT); left = bundle.getFloat(LEFT);
ignoreHornOfPlenty = bundle.getBoolean(IGNORE_HORN); ignoreHornOfPlenty = bundle.getBoolean(IGNORE_HORN);
} }
public static void chargeArtifacts( Hero hero, float turns ){
for (Buff b : hero.buffs()){
if (b instanceof Artifact.ArtifactBuff && !((Artifact.ArtifactBuff) b).isCursed()){
if (!((Artifact.ArtifactBuff) b).isCursed()) ((Artifact.ArtifactBuff) b).charge(hero, turns);
}
}
}
} }
@@ -21,15 +21,17 @@
package com.shatteredpixel.shatteredpixeldungeon.items.food; package com.shatteredpixel.shatteredpixeldungeon.items.food;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ArtifactRecharge;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger; 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.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.utils.Holiday; import com.shatteredpixel.shatteredpixeldungeon.utils.Holiday;
import com.watabou.noosa.audio.Sample;
public class Pasty extends Food { public class Pasty extends Food {
@@ -48,6 +50,15 @@ public class Pasty extends Food {
case NONE: case NONE:
image = ItemSpriteSheet.PASTY; image = ItemSpriteSheet.PASTY;
break; break;
case LUNAR_NEW_YEAR:
image = ItemSpriteSheet.STEAMED_FISH;
break;
case APRIL_FOOLS:
image = ItemSpriteSheet.CHOC_AMULET;
break;
case EASTER:
image = ItemSpriteSheet.EASTER_EGG;
break;
case HALLOWEEN: case HALLOWEEN:
image = ItemSpriteSheet.PUMPKIN_PIE; image = ItemSpriteSheet.PUMPKIN_PIE;
break; break;
@@ -59,18 +70,37 @@ public class Pasty extends Food {
@Override @Override
protected void satisfy(Hero hero) { protected void satisfy(Hero hero) {
if (Holiday.getCurrentHoliday() == Holiday.LUNAR_NEW_YEAR){
//main item only clears 300 hunger on lunar new year...
energy = Hunger.HUNGRY;
}
super.satisfy(hero); super.satisfy(hero);
switch(Holiday.getCurrentHoliday()){ switch(Holiday.getCurrentHoliday()){
default: default:
break; //do nothing extra break; //do nothing extra
case LUNAR_NEW_YEAR:
//...but it also awards an extra item that restores 150 hunger
FishLeftover left = new FishLeftover();
if (!left.collect()){
Dungeon.level.drop(left, hero.pos).sprite.drop();
}
break;
case APRIL_FOOLS:
Sample.INSTANCE.play(Assets.Sounds.MIMIC);
case EASTER:
ArtifactRecharge.chargeArtifacts(hero, 2f);
ScrollOfRecharging.charge( hero );
break;
case HALLOWEEN: case HALLOWEEN:
//heals for 10% max hp //heals for 5% max hp, min of 3
hero.HP = Math.min(hero.HP + hero.HT/10, hero.HT); int toHeal = Math.max(3, hero.HT/20);
hero.HP = Math.min(hero.HP + toHeal, hero.HT);
hero.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); hero.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 );
break; break;
case WINTER_HOLIDAYS: case WINTER_HOLIDAYS:
Buff.affect( hero, Recharging.class, 2f ); //half of a charge hero.belongings.charge(0.5f); //2 turns worth
ScrollOfRecharging.charge( hero ); ScrollOfRecharging.charge( hero );
break; break;
} }
@@ -80,11 +110,17 @@ public class Pasty extends Food {
public String name() { public String name() {
switch(Holiday.getCurrentHoliday()){ switch(Holiday.getCurrentHoliday()){
case NONE: default: case NONE: default:
return Messages.get(this, "pasty"); return super.name();
case LUNAR_NEW_YEAR:
return Messages.get(this, "fish_name");
case APRIL_FOOLS:
return Messages.get(this, "amulet_name");
case EASTER:
return Messages.get(this, "egg_name");
case HALLOWEEN: case HALLOWEEN:
return Messages.get(this, "pie"); return Messages.get(this, "pie_name");
case WINTER_HOLIDAYS: case WINTER_HOLIDAYS:
return Messages.get(this, "cane"); return Messages.get(this, "cane_name");
} }
} }
@@ -92,7 +128,13 @@ public class Pasty extends Food {
public String info() { public String info() {
switch(Holiday.getCurrentHoliday()){ switch(Holiday.getCurrentHoliday()){
case NONE: default: case NONE: default:
return Messages.get(this, "pasty_desc"); return super.info();
case LUNAR_NEW_YEAR:
return Messages.get(this, "fish_desc");
case APRIL_FOOLS:
return Messages.get(this, "amulet_desc");
case EASTER:
return Messages.get(this, "egg_desc");
case HALLOWEEN: case HALLOWEEN:
return Messages.get(this, "pie_desc"); return Messages.get(this, "pie_desc");
case WINTER_HOLIDAYS: case WINTER_HOLIDAYS:
@@ -104,4 +146,17 @@ public class Pasty extends Food {
public int value() { public int value() {
return 20 * quantity; return 20 * quantity;
} }
public static class FishLeftover extends Food {
{
image = ItemSpriteSheet.FISH_LEFTOVER;
energy = Hunger.HUNGRY/2;
}
@Override
public int value() {
return 10 * quantity;
}
}
} }
@@ -22,9 +22,8 @@
package com.shatteredpixel.shatteredpixeldungeon.items.remains; package com.shatteredpixel.shatteredpixeldungeon.items.remains;
import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ArtifactRecharge;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
@@ -37,11 +36,7 @@ public class CloakScrap extends RemainsItem {
@Override @Override
protected void doEffect(Hero hero) { protected void doEffect(Hero hero) {
for (Buff b : hero.buffs()){ ArtifactRecharge.chargeArtifacts(hero, 4f);
if (b instanceof Artifact.ArtifactBuff){
if (!((Artifact.ArtifactBuff) b).isCursed()) ((Artifact.ArtifactBuff) b).charge(hero, 4);
}
}
ScrollOfRecharging.charge(hero); ScrollOfRecharging.charge(hero);
Sample.INSTANCE.play( Assets.Sounds.CHARGEUP ); Sample.INSTANCE.play( Assets.Sounds.CHARGEUP );
} }
@@ -27,7 +27,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite; import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact;
import com.shatteredpixel.shatteredpixeldungeon.items.quest.MetalShard; import com.shatteredpixel.shatteredpixeldungeon.items.quest.MetalShard;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfMysticalEnergy; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfMysticalEnergy;
@@ -58,11 +57,7 @@ public class WildEnergy extends TargetedSpell {
SpellSprite.show(hero, SpellSprite.CHARGE); SpellSprite.show(hero, SpellSprite.CHARGE);
hero.belongings.charge(1f); hero.belongings.charge(1f);
for (Buff b : hero.buffs()){ ArtifactRecharge.chargeArtifacts(hero, 4f);
if (b instanceof Artifact.ArtifactBuff){
if (!((Artifact.ArtifactBuff) b).isCursed()) ((Artifact.ArtifactBuff) b).charge(hero, 4);
}
}
Buff.affect(hero, Recharging.class, 8f); Buff.affect(hero, Recharging.class, 8f);
Buff.affect(hero, ArtifactRecharge.class).prolong( 8 ).ignoreHornOfPlenty = false; Buff.affect(hero, ArtifactRecharge.class).prolong( 8 ).ignoreHornOfPlenty = false;
@@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ArtifactRecharge;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
@@ -33,7 +34,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.ArcaneResin; import com.shatteredpixel.shatteredpixeldungeon.items.ArcaneResin;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag; import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.MagicalHolster; import com.shatteredpixel.shatteredpixeldungeon.items.bags.MagicalHolster;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
@@ -168,11 +168,7 @@ public class MagesStaff extends MeleeWeapon {
public int proc(Char attacker, Char defender, int damage) { public int proc(Char attacker, Char defender, int damage) {
if (attacker instanceof Hero && ((Hero) attacker).hasTalent(Talent.MYSTICAL_CHARGE)){ if (attacker instanceof Hero && ((Hero) attacker).hasTalent(Talent.MYSTICAL_CHARGE)){
Hero hero = (Hero) attacker; Hero hero = (Hero) attacker;
for (Buff b : hero.buffs()){ ArtifactRecharge.chargeArtifacts(hero, hero.pointsInTalent(Talent.MYSTICAL_CHARGE)/2f);
if (b instanceof Artifact.ArtifactBuff && !((Artifact.ArtifactBuff) b).isCursed() ) {
((Artifact.ArtifactBuff) b).charge(hero, hero.pointsInTalent(Talent.MYSTICAL_CHARGE)/2f);
}
}
} }
Talent.EmpoweredStrikeTracker empoweredStrike = attacker.buff(Talent.EmpoweredStrikeTracker.class); Talent.EmpoweredStrikeTracker empoweredStrike = attacker.buff(Talent.EmpoweredStrikeTracker.class);
@@ -651,13 +651,11 @@ public class ItemSpriteSheet {
public static final int CARPACCIO = FOOD+4; public static final int CARPACCIO = FOOD+4;
public static final int RATION = FOOD+5; public static final int RATION = FOOD+5;
public static final int PASTY = FOOD+6; public static final int PASTY = FOOD+6;
public static final int PUMPKIN_PIE = FOOD+7; public static final int MEAT_PIE = FOOD+7;
public static final int CANDY_CANE = FOOD+8; public static final int BLANDFRUIT = FOOD+8;
public static final int MEAT_PIE = FOOD+9; public static final int BLAND_CHUNKS= FOOD+9;
public static final int BLANDFRUIT = FOOD+10; public static final int BERRY = FOOD+10;
public static final int BLAND_CHUNKS= FOOD+11; public static final int PHANTOM_MEAT= FOOD+11;
public static final int BERRY = FOOD+12;
public static final int PHANTOM_MEAT= FOOD+13;
static{ static{
assignItemRect(MEAT, 15, 11); assignItemRect(MEAT, 15, 11);
assignItemRect(STEAK, 15, 11); assignItemRect(STEAK, 15, 11);
@@ -666,8 +664,6 @@ public class ItemSpriteSheet {
assignItemRect(CARPACCIO, 15, 11); assignItemRect(CARPACCIO, 15, 11);
assignItemRect(RATION, 16, 12); assignItemRect(RATION, 16, 12);
assignItemRect(PASTY, 16, 11); assignItemRect(PASTY, 16, 11);
assignItemRect(PUMPKIN_PIE, 16, 12);
assignItemRect(CANDY_CANE, 13, 16);
assignItemRect(MEAT_PIE, 16, 12); assignItemRect(MEAT_PIE, 16, 12);
assignItemRect(BLANDFRUIT, 9, 12); assignItemRect(BLANDFRUIT, 9, 12);
assignItemRect(BLAND_CHUNKS,14, 6); assignItemRect(BLAND_CHUNKS,14, 6);
@@ -675,7 +671,31 @@ public class ItemSpriteSheet {
assignItemRect(PHANTOM_MEAT,15, 11); assignItemRect(PHANTOM_MEAT,15, 11);
} }
private static final int QUEST = xy(1, 29); //32 slots private static final int HOLIDAY_FOOD = xy(1, 29); //16 slots
public static final int STEAMED_FISH = HOLIDAY_FOOD+0;
public static final int FISH_LEFTOVER = HOLIDAY_FOOD+1;
public static final int CHOC_AMULET = HOLIDAY_FOOD+2;
public static final int EASTER_EGG = HOLIDAY_FOOD+3;
public static final int RAINBOW_POTION = HOLIDAY_FOOD+4;
public static final int SHATTERED_CAKE = HOLIDAY_FOOD+5;
public static final int PUMPKIN_PIE = HOLIDAY_FOOD+6;
public static final int VANILLA_CAKE = HOLIDAY_FOOD+7;
public static final int CANDY_CANE = HOLIDAY_FOOD+8;
public static final int SPARKLING_POTION= HOLIDAY_FOOD+9;
static{
assignItemRect(STEAMED_FISH, 15, 11);
assignItemRect(FISH_LEFTOVER, 15, 11);
assignItemRect(CHOC_AMULET, 16, 16);
assignItemRect(EASTER_EGG, 15, 11);
assignItemRect(RAINBOW_POTION, 12, 14);
assignItemRect(SHATTERED_CAKE, 15, 11);
assignItemRect(PUMPKIN_PIE, 16, 12);
assignItemRect(VANILLA_CAKE, 15, 11);
assignItemRect(CANDY_CANE, 13, 16);
assignItemRect(SPARKLING_POTION,12, 14);
}
private static final int QUEST = xy(1, 30); //16 slots
public static final int SKULL = QUEST+0; public static final int SKULL = QUEST+0;
public static final int DUST = QUEST+1; public static final int DUST = QUEST+1;
public static final int CANDLE = QUEST+2; public static final int CANDLE = QUEST+2;