V0.2.0: Added Horn of Plenty Sprite Switching
This commit is contained in:
parent
c015902f83
commit
b3069feee9
BIN
assets/items.png
BIN
assets/items.png
Binary file not shown.
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
@ -26,7 +26,7 @@ import java.util.ArrayList;
|
||||||
*/
|
*/
|
||||||
public class HornOfPlenty extends Artifact {
|
public class HornOfPlenty extends Artifact {
|
||||||
|
|
||||||
//TODO: add sprite switching, add polish.
|
//TODO: add polish.
|
||||||
|
|
||||||
{
|
{
|
||||||
name = "Horn of Plenty";
|
name = "Horn of Plenty";
|
||||||
|
@ -129,14 +129,22 @@ public class HornOfPlenty extends Artifact {
|
||||||
|
|
||||||
//generates 0.2 food value every round, +0.02 value per level
|
//generates 0.2 food value every round, +0.02 value per level
|
||||||
//to a max of 0.8 food value per round (0.2+0.6, at level 30)
|
//to a max of 0.8 food value per round (0.2+0.6, at level 30)
|
||||||
partialCharge += (1f*(0.2+(0.02*level)));
|
partialCharge += 18;
|
||||||
|
|
||||||
//charge is in increments of 36 food value.
|
//charge is in increments of 36 food value.
|
||||||
if (partialCharge >= 36) {
|
if (partialCharge >= 36) {
|
||||||
charge++;
|
charge++;
|
||||||
//TODO: change sprite based on fullness.
|
|
||||||
//we'll do it at 3/0, 7/10, and 10/10, to relate to food items.
|
|
||||||
partialCharge -= 36;
|
partialCharge -= 36;
|
||||||
|
|
||||||
|
if (charge == chargeCap)
|
||||||
|
image = ItemSpriteSheet.ARTIFACT_HORN4;
|
||||||
|
else if (charge >= 7)
|
||||||
|
image = ItemSpriteSheet.ARTIFACT_HORN3;
|
||||||
|
else if (charge >= 3)
|
||||||
|
image = ItemSpriteSheet.ARTIFACT_HORN2;
|
||||||
|
else
|
||||||
|
image = ItemSpriteSheet.ARTIFACT_HORN1;
|
||||||
|
|
||||||
if (charge == chargeCap){
|
if (charge == chargeCap){
|
||||||
GLog.p("Your horn is full of food.");
|
GLog.p("Your horn is full of food.");
|
||||||
partialCharge = 0;
|
partialCharge = 0;
|
||||||
|
@ -145,7 +153,6 @@ public class HornOfPlenty extends Artifact {
|
||||||
} else
|
} else
|
||||||
partialCharge = 0;
|
partialCharge = 0;
|
||||||
|
|
||||||
|
|
||||||
spend( TICK );
|
spend( TICK );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user