v2.4.0: added a new trinket: Dimensional Sundial

This commit is contained in:
Evan Debenham
2024-03-28 17:17:27 -04:00
parent bfee2fb98d
commit d64bf7c422
6 changed files with 82 additions and 6 deletions

View File

@@ -1309,6 +1309,9 @@ items.trinkets.petrifiedseed.desc=This seed has been fossilised, either by slow
items.trinkets.ratskull.name=rat skull
items.trinkets.ratskull.desc=This macabre trinket isn't much larger than the skull of a normal rat, which is somehow a rarity down in this dungeon. The skull's magical influence seems to attract the more rare denizens of the dungeon, making them appear far more often.\n\nAt its current level this trinket will make rare exotic enemies _%dx_ as likely to appear. The skull is only half as effective at attracting crystal mimics and armored statues, however.
items.trinkets.dimensionalsundial.name=dimensional sundial
items.trinkets.dimensionalsundial.desc=Despite being underground, this sundial is still casting a shadow according to the sun's position. Even more strangely, the shadow's position seems to have no relation to the sun in this world. When no shadow is cast, the sundial seems to attract danger.\n\nAt its current level, this trinket will increase the spawning rate of enemies by _%d%%_ when it is nighttime in real life (9pm to 7am).
items.trinkets.trinketcatalyst.name=trinket catalyst
items.trinkets.trinketcatalyst.window_text=The water begins to glow as you use the catalyst. There are a few nearby items you could imbue with magical energy.
items.trinkets.trinketcatalyst.desc=TODO

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -102,6 +102,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfFear;
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfFlock;
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfIntuition;
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfShock;
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.DimensionalSundial;
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.ExoticCrystals;
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.MossyClump;
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.ParchmentScrap;
@@ -526,9 +527,10 @@ public class Generator {
ParchmentScrap.class,
PetrifiedSeed.class,
ExoticCrystals.class,
MossyClump.class
MossyClump.class,
DimensionalSundial.class
};
TRINKET.defaultProbs = new float[]{ 1, 1, 1, 1, 1 };
TRINKET.defaultProbs = new float[]{ 1, 1, 1, 1, 1, 1 };
TRINKET.probs = TRINKET.defaultProbs.clone();
for (Category cat : Category.values()){

View File

@@ -0,0 +1,66 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2024 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.items.trinkets;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import java.util.Calendar;
import java.util.GregorianCalendar;
public class DimensionalSundial extends Trinket {
{
image = ItemSpriteSheet.SUNDIAL;
}
@Override
protected int upgradeEnergyCost() {
return 1+level(); //TODO
}
@Override
public String desc() {
return Messages.get(this, "desc", (int)(100*(enemySpawnMultiplier(buffedLvl())-1f)));
}
public static float spawnMultiplierAtCurrentTime(){
Calendar cal = GregorianCalendar.getInstance();
if (cal.get(Calendar.HOUR_OF_DAY) >= 21 || cal.get(Calendar.HOUR_OF_DAY) <= 6 ){
return enemySpawnMultiplier();
} else {
return 1f;
}
}
public static float enemySpawnMultiplier(){
return enemySpawnMultiplier(trinketLevel(DimensionalSundial.class));
}
public static float enemySpawnMultiplier( int level ){
if (level == -1){
return 1f;
} else {
return 1.25f + 0.25f*level;
}
}
}

View File

@@ -68,6 +68,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfEnchantment;
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfIntuition;
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.MossyClump;
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.DimensionalSundial;
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.TrinketCatalyst;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfRegrowth;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfWarding;
@@ -711,19 +712,21 @@ public abstract class Level implements Bundlable {
}
public float respawnCooldown(){
float cooldown;
if (Statistics.amuletObtained){
if (Dungeon.depth == 1){
//very fast spawns on floor 1! 0/2/4/6/8/10/12, etc.
return (Dungeon.level.mobCount()) * (TIME_TO_RESPAWN / 25f);
cooldown = (Dungeon.level.mobCount()) * (TIME_TO_RESPAWN / 25f);
} else {
//respawn time is 5/5/10/15/20/25/25, etc.
return Math.round(GameMath.gate( TIME_TO_RESPAWN/10f, Dungeon.level.mobCount() * (TIME_TO_RESPAWN / 10f), TIME_TO_RESPAWN / 2f));
cooldown = Math.round(GameMath.gate( TIME_TO_RESPAWN/10f, Dungeon.level.mobCount() * (TIME_TO_RESPAWN / 10f), TIME_TO_RESPAWN / 2f));
}
} else if (Dungeon.level.feeling == Feeling.DARK){
return 2*TIME_TO_RESPAWN/3f;
cooldown = 2*TIME_TO_RESPAWN/3f;
} else {
return TIME_TO_RESPAWN;
cooldown = TIME_TO_RESPAWN;
}
return cooldown / DimensionalSundial.spawnMultiplierAtCurrentTime();
}
public boolean spawnMob(int disLimit){

View File

@@ -474,12 +474,14 @@ public class ItemSpriteSheet {
public static final int PETRIFIED_SEED = TRINKETS+2;
public static final int EXOTIC_CRYSTALS = TRINKETS+3;
public static final int MOSSY_CLUMP = TRINKETS+4;
public static final int SUNDIAL = TRINKETS+5;
static{
assignItemRect(RAT_SKULL, 16, 11);
assignItemRect(PARCHMENT_SCRAP, 10, 14);
assignItemRect(PETRIFIED_SEED, 10, 10);
assignItemRect(EXOTIC_CRYSTALS, 11, 11);
assignItemRect(MOSSY_CLUMP, 12, 11);
assignItemRect(SUNDIAL, 16, 12);
}
private static final int SCROLLS = xy(1, 19); //16 slots