Skip to content

Commit 17eca84

Browse files
committed
Added shortcut
Possible fixes: - should maybe show on the map that the player has a charge of this relic - I don't know if the tooltip is strangely worded, maybe could use a change
1 parent 42bb1f1 commit 17eca84

6 files changed

Lines changed: 72 additions & 3 deletions

File tree

998 Bytes
Loading
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="CompressedTexture2D"
5+
uid="uid://cgcc27uov731g"
6+
path="res://.godot/imported/Relic_Shortcut.png-d03004b4d7d0b125c8da23d3a2ca0db2.ctex"
7+
metadata={
8+
"vram_texture": false
9+
}
10+
11+
[deps]
12+
13+
source_file="res://Classes/Relics/Assets/Relic_Shortcut.png"
14+
dest_files=["res://.godot/imported/Relic_Shortcut.png-d03004b4d7d0b125c8da23d3a2ca0db2.ctex"]
15+
16+
[params]
17+
18+
compress/mode=0
19+
compress/high_quality=false
20+
compress/lossy_quality=0.7
21+
compress/hdr_compression=1
22+
compress/normal_map=0
23+
compress/channel_pack=0
24+
mipmaps/generate=false
25+
mipmaps/limit=-1
26+
roughness/mode=0
27+
roughness/src_normal=""
28+
process/fix_alpha_border=true
29+
process/premult_alpha=false
30+
process/normal_map_invert_y=false
31+
process/hdr_as_srgb=false
32+
process/hdr_clamp_exposure=false
33+
process/size_limit=0
34+
detect_3d/compress_to=1

Globals/Scribe.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,23 @@ e is BattleDirector.Harbinger.OnDamageInstanceArgs dmgArgs
391391
),
392392
}
393393
),
394+
new RelicTemplate(
395+
13,
396+
"Shortcut",
397+
Rarity.Uncommon,
398+
GD.Load<Texture2D>("res://Classes/Relics/Assets/Relic_Shortcut.png"),
399+
new RelicEffect[]
400+
{
401+
new RelicEffect(
402+
BattleEffectTrigger.OnPickup,
403+
1,
404+
(e, self, val) =>
405+
{
406+
StageProducer.PlayerStats.MapLaneChanges = 1;
407+
}
408+
),
409+
}
410+
),
394411
};
395412

396413
public static readonly SongTemplate[] SongDictionary = new[] //Generalize and make pools for areas/room types

Globals/Translations/Translations.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ RELIC_SPIKEDSHIELD_NAME,Spiked Shield,尖刺之盾
8686
RELIC_SPIKEDSHIELD_TOOLTIP,"Deal damage when you lose a charge of block.","失去格挡层数时造成伤害。"
8787
RELIC_LUCKYDICE_NAME,Lucky Dice,幸运骰子
8888
RELIC_LUCKYDICE_TOOLTIP,"Gain one reroll for reward selections.","获得一次奖励重选。"
89+
RELIC_SHORTCUT_NAME,Shortcut,捷径
90+
RELIC_SHORTCUT_TOOLTIP,"Can choose any path regardless of connections, but only once.","可无视路径连接选择任意路线,但仅限一次。"
8991
INVENTORY_TAB_NOTES,Notes,乐谱
9092
INVENTORY_TAB_RELICS,Relics,遗物
9193
OPTIONS_VOLUME_LABEL,Master Volume,最终音量设置

Scenes/Maps/Scripts/Cartographer.cs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,33 @@ private void DrawMapSprite(MapGrid.Room room)
8585
newButton.CustomMinimumSize = MapIconSize;
8686
newButton.IconAlignment = HorizontalAlignment.Center;
8787
AddChild(newButton);
88+
bool isChild = StageProducer.GetCurRoom().Children.Contains(room.Idx);
89+
90+
// checks if the next room is one below current room, and player has charges of maplanechanges
91+
bool isLaneChangeAllowed =
92+
room.Y == StageProducer.GetCurRoom().Y + 1
93+
&& StageProducer.PlayerStats.MapLaneChanges > 0;
94+
8895
//button is disabled if it is not a child of current room.
89-
if (!StageProducer.GetCurRoom().Children.Contains(room.Idx))
96+
//unless player has charges of lane changing
97+
if (!isChild && !isLaneChangeAllowed)
9098
{
9199
newButton.Disabled = true;
92100
newButton.FocusMode = Control.FocusModeEnum.None;
93101
}
94102
else
95103
{
96-
newButton.GrabFocus();
97-
_focusedButton = newButton;
104+
//grab focus on children paths, to really make sure user wants to use a charge of maplanechanges
105+
if (isChild)
106+
{
107+
newButton.GrabFocus();
108+
_focusedButton = newButton;
109+
}
98110
newButton.Pressed += () =>
99111
{
112+
if (!isChild)
113+
StageProducer.PlayerStats.MapLaneChanges--;
114+
100115
EnterStage(room.Idx, newButton);
101116
};
102117
_validButtons = _validButtons.Append(newButton).ToArray();

Scenes/Puppets/Scripts/PlayerStats.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public partial class PlayerStats : Resource
1414
public int NotesToIncreaseCombo = 4;
1515
public int RewardAmountModifier = 0;
1616
public int Rerolls = 0;
17+
public int MapLaneChanges = 0;
1718

1819
//Array in order of descending rarities, Legendary -> ... Common. Int odds out of 100.
1920
public int[] RarityOdds = [1, 5, 10, 20, 100];

0 commit comments

Comments
 (0)