v2.4.0: implemented the eye of newt trinket
This commit is contained in:
@@ -1301,7 +1301,10 @@ items.trinkets.dimensionalsundial.warning=Your sundial isn't casting a shadow, y
|
||||
items.trinkets.dimensionalsundial.desc=This small handheld sundial is somehow able to cast a shadow in the depths of the dungeon, even if you aren't holding it upright. 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).\n\nThis trinket costs relatively little energy to upgrade.
|
||||
|
||||
items.trinkets.exoticcrystals.name=exotic crystals
|
||||
items.trinkets.exoticcrystals.desc=These small pink crystals have the same shape as crystals of alchemical energy. While they can't be used for energy directly, they seem to be somehow influencing the potions and scrolls you find.\n\nAt its current level this trinket will replace _%d%%_ of potion or scroll drops with their exotic equivalents. This does not affect potions of strength, scrolls of upgrade, or items that are generated to help solve hazard rooms.
|
||||
items.trinkets.exoticcrystals.desc=These small pink crystals have the same shape as crystals of alchemical energy. While they can't be used for energy directly, they seem to be somehow influencing the potions and scrolls you find.\n\nAt its current level this trinket will replace _%s%%_ of potion or scroll drops with their exotic equivalents. This does not affect potions of strength, scrolls of upgrade, or items that are generated to help solve hazard rooms.
|
||||
|
||||
items.trinkets.eyeofnewt.name=eye of newt
|
||||
items.trinkets.eyeofnewt.desc=This golden and black newt's eye is a common ingredient, now enhanced into a trinket. The eye seems to be reducing your vision in exchange for letting you see things in other ways.\n\nAt its current level this trinket will reduce your vision range by _%1$s%%_, but will also grant you mind vision on enemies within _%2$d_ tiles.
|
||||
|
||||
items.trinkets.mimictooth.name=mimic tooth
|
||||
items.trinkets.mimictooth.desc=This large sharp tooth must have been pulled from a very unhappy mimic. It seems to be influencing the mimics of the dungeon, making them more frequent and dangerous.\n\nAt its current level this trinket will make all kinds of mimic _%1$sx_ more common, will make mimics much more difficult to detect, and will give each floor a _%2$s%%_ chance to contain an ebony mimic.
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
@@ -942,6 +942,11 @@ public class Dungeon {
|
||||
BArray.or( level.visited, level.heroFOV, pos, width, level.visited );
|
||||
pos+=level.width();
|
||||
}
|
||||
|
||||
//always visit adjacent tiles, even if they aren't seen
|
||||
for (int i : PathFinder.NEIGHBOURS9){
|
||||
level.visited[hero.pos+i] = true;
|
||||
}
|
||||
|
||||
GameScene.updateFog(l, t, width, height);
|
||||
|
||||
|
||||
@@ -108,6 +108,7 @@ 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.EyeOfNewt;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.MimicTooth;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.MossyClump;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.ParchmentScrap;
|
||||
@@ -563,14 +564,15 @@ public class Generator {
|
||||
ParchmentScrap.class,
|
||||
PetrifiedSeed.class,
|
||||
ExoticCrystals.class,
|
||||
MimicTooth.class,
|
||||
MossyClump.class,
|
||||
DimensionalSundial.class,
|
||||
ThirteenLeafClover.class,
|
||||
TrapMechanism.class,
|
||||
WondrousResin.class
|
||||
MimicTooth.class,
|
||||
WondrousResin.class,
|
||||
EyeOfNewt.class
|
||||
};
|
||||
TRINKET.defaultProbs = new float[]{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
|
||||
TRINKET.defaultProbs = new float[]{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
|
||||
TRINKET.probs = TRINKET.defaultProbs.clone();
|
||||
|
||||
for (Category cat : Category.values()){
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
public class EyeOfNewt extends Trinket {
|
||||
|
||||
{
|
||||
image = ItemSpriteSheet.EYE_OF_NEWT;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int upgradeEnergyCost() {
|
||||
//5 -> 8(13) -> 10(23) -> 12(35)
|
||||
return 6+2*level();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return Messages.get(this, "desc",
|
||||
Messages.decimalFormat("#.##", 100*(1f-visionRangeMultiplier(buffedLvl()))),
|
||||
mindVisionRange(buffedLvl()));
|
||||
}
|
||||
|
||||
public static float visionRangeMultiplier(){
|
||||
return visionRangeMultiplier(trinketLevel(EyeOfNewt.class));
|
||||
}
|
||||
|
||||
public static float visionRangeMultiplier( int level ){
|
||||
if (level < 0){
|
||||
return 1;
|
||||
} else {
|
||||
return 0.875f - 0.125f*level;
|
||||
}
|
||||
}
|
||||
|
||||
public static int mindVisionRange(){
|
||||
return mindVisionRange(trinketLevel(EyeOfNewt.class));
|
||||
}
|
||||
|
||||
public static int mindVisionRange( int level ){
|
||||
if (level < 0){
|
||||
return 0;
|
||||
} else {
|
||||
return 2+level;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -68,6 +68,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength;
|
||||
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.EyeOfNewt;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.MimicTooth;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.MossyClump;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.DimensionalSundial;
|
||||
@@ -1286,13 +1287,14 @@ public abstract class Level implements Bundlable {
|
||||
if (blocking == null){
|
||||
blocking = Dungeon.level.losBlocking;
|
||||
}
|
||||
|
||||
int viewDist = c.viewDistance;
|
||||
|
||||
float viewDist = c.viewDistance;
|
||||
if (c instanceof Hero){
|
||||
viewDist *= 1f + 0.25f*((Hero) c).pointsInTalent(Talent.FARSIGHT);
|
||||
viewDist *= EyeOfNewt.visionRangeMultiplier();
|
||||
}
|
||||
|
||||
ShadowCaster.castShadow( cx, cy, width(), fieldOfView, blocking, viewDist );
|
||||
ShadowCaster.castShadow( cx, cy, width(), fieldOfView, blocking, Math.round(viewDist) );
|
||||
} else {
|
||||
BArray.setFalse(fieldOfView);
|
||||
}
|
||||
@@ -1364,17 +1366,24 @@ public abstract class Level implements Bundlable {
|
||||
heroMindFov[mob.pos + i] = true;
|
||||
}
|
||||
}
|
||||
} else if (((Hero) c).hasTalent(Talent.HEIGHTENED_SENSES)) {
|
||||
Hero h = (Hero) c;
|
||||
int range = 1+h.pointsInTalent(Talent.HEIGHTENED_SENSES);
|
||||
for (Mob mob : mobs) {
|
||||
if (stealthyMimics && mob instanceof Mimic && mob.alignment == Char.Alignment.NEUTRAL){
|
||||
continue;
|
||||
}
|
||||
int p = mob.pos;
|
||||
if (!fieldOfView[p] && distance(c.pos, p) <= range) {
|
||||
for (int i : PathFinder.NEIGHBOURS9) {
|
||||
heroMindFov[mob.pos + i] = true;
|
||||
} else {
|
||||
|
||||
int mindVisRange = 0;
|
||||
if (((Hero) c).hasTalent(Talent.HEIGHTENED_SENSES)){
|
||||
mindVisRange = 1+((Hero) c).pointsInTalent(Talent.HEIGHTENED_SENSES);
|
||||
}
|
||||
mindVisRange = Math.max(mindVisRange, EyeOfNewt.mindVisionRange());
|
||||
|
||||
if (mindVisRange >= 1) {
|
||||
for (Mob mob : mobs) {
|
||||
if (stealthyMimics && mob instanceof Mimic && mob.alignment == Char.Alignment.NEUTRAL) {
|
||||
continue;
|
||||
}
|
||||
int p = mob.pos;
|
||||
if (!fieldOfView[p] && distance(c.pos, p) <= mindVisRange) {
|
||||
for (int i : PathFinder.NEIGHBOURS9) {
|
||||
heroMindFov[mob.pos + i] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -482,6 +482,7 @@ public class ItemSpriteSheet {
|
||||
public static final int TRAP_MECHANISM = TRINKETS+7;
|
||||
public static final int MIMIC_TOOTH = TRINKETS+8;
|
||||
public static final int WONDROUS_RESIN = TRINKETS+9;
|
||||
public static final int EYE_OF_NEWT = TRINKETS+10;
|
||||
static{
|
||||
assignItemRect(RAT_SKULL, 16, 11);
|
||||
assignItemRect(PARCHMENT_SCRAP, 10, 14);
|
||||
@@ -493,6 +494,7 @@ public class ItemSpriteSheet {
|
||||
assignItemRect(TRAP_MECHANISM, 13, 15);
|
||||
assignItemRect(MIMIC_TOOTH, 8, 15);
|
||||
assignItemRect(WONDROUS_RESIN, 12, 11);
|
||||
assignItemRect(EYE_OF_NEWT, 12, 12);
|
||||
}
|
||||
|
||||
private static final int SCROLLS = xy(1, 19); //16 slots
|
||||
|
||||
Reference in New Issue
Block a user