From 40760bb7977bd1caa821b5cae82ab1ba119f4d60 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 16 Dec 2014 22:34:31 -0500 Subject: [PATCH] v0.2.3: added festive rat king =) --- .../actors/mobs/npcs/RatKing.java | 6 ++++-- .../sprites/RatKingSprite.java | 20 ++++++++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/RatKing.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/RatKing.java index bb789c612..aa2935aca 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/RatKing.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/RatKing.java @@ -74,8 +74,10 @@ public class RatKing extends NPC { @Override public String description() { - return - "This rat is a little bigger than a regular marsupial rat " + + return ((RatKingSprite)sprite).festive ? + "This rat is a little bigger than a regular marsupial rat. " + + "It's wearing a tiny festive hat instead of its usual crown. Happy Holidays!" + : "This rat is a little bigger than a regular marsupial rat " + "and it's wearing a tiny crown on its head."; } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/sprites/RatKingSprite.java b/src/com/shatteredpixel/shatteredpixeldungeon/sprites/RatKingSprite.java index ec3fead5e..577a8b0ad 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/sprites/RatKingSprite.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/sprites/RatKingSprite.java @@ -20,26 +20,36 @@ package com.shatteredpixel.shatteredpixeldungeon.sprites; import com.watabou.noosa.TextureFilm; import com.shatteredpixel.shatteredpixeldungeon.Assets; +import java.util.Calendar; + public class RatKingSprite extends MobSprite { + + public boolean festive; public RatKingSprite() { super(); + + final Calendar calendar = Calendar.getInstance(); + //once a year the rat king feels a bit festive! + festive = (calendar.get(Calendar.MONTH) == 11 && calendar.get(Calendar.WEEK_OF_MONTH) > 2); + + final int c = festive ? 8 : 0; texture( Assets.RATKING ); - TextureFilm frames = new TextureFilm( texture, 16, 16 ); + TextureFilm frames = new TextureFilm( texture, 16, 17 ); idle = new Animation( 2, true ); - idle.frames( frames, 0, 0, 0, 1 ); + idle.frames( frames, c+0, c+0, c+0, c+1 ); run = new Animation( 10, true ); - run.frames( frames, 2, 3, 4, 5, 6 ); + run.frames( frames, c+2, c+3, c+4, c+5, c+6 ); attack = new Animation( 15, false ); - attack.frames( frames, 0 ); + attack.frames( frames, c+0 ); die = new Animation( 10, false ); - die.frames( frames, 0 ); + die.frames( frames, c+0 ); play( idle ); }