Skip to content

Commit c2c0cac

Browse files
committed
Added coupon
1 parent ea9a313 commit c2c0cac

5 files changed

Lines changed: 54 additions & 1 deletion

File tree

1.14 KB
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://c7kegse3tt25t"
6+
path="res://.godot/imported/Relic_Coupon.png-fbc4593b2a2e278d51828d9813481a77.ctex"
7+
metadata={
8+
"vram_texture": false
9+
}
10+
11+
[deps]
12+
13+
source_file="res://Classes/Relics/Assets/Relic_Coupon.png"
14+
dest_files=["res://.godot/imported/Relic_Coupon.png-fbc4593b2a2e278d51828d9813481a77.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
@@ -524,6 +524,23 @@ e is BattleDirector.Harbinger.OnDamageInstanceArgs dmgArgs
524524
),
525525
}
526526
),
527+
new RelicTemplate(
528+
17,
529+
"Coupon",
530+
Rarity.Common,
531+
GD.Load<Texture2D>("res://Classes/Relics/Assets/Relic_Coupon.png"),
532+
new RelicEffect[]
533+
{
534+
new RelicEffect(
535+
BattleEffectTrigger.OnPickup,
536+
10,
537+
(e, self, val) =>
538+
{
539+
StageProducer.PlayerStats.DiscountPercent += val;
540+
}
541+
),
542+
}
543+
),
527544
};
528545

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

Scenes/Puppets/Scripts/PlayerStats.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public partial class PlayerStats : Resource
1515
public int RewardAmountModifier = 0;
1616
public int Rerolls = 0;
1717
public int Shortcuts = 0;
18+
public int DiscountPercent = 0;
1819

1920
//Array in order of descending rarities, Legendary -> ... Common. Int odds out of 100.
2021
public int[] RarityOdds = [1, 5, 10, 20, 100];
@@ -77,6 +78,7 @@ public void RemoveNote(int index)
7778

7879
CurNotes = CurNotes.Where((_, i) => i != index).ToArray();
7980
}
81+
8082
public void RemoveNote(Note nSelection)
8183
{
8284
CurNotes = CurNotes.Where(n => n != nSelection).ToArray();

Scenes/ShopScene/Scripts/ShopScene.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private void AddShopItem(GridContainer container, IDisplayable item, int price)
133133
GD.PushError("AddShopItem called with null!");
134134
return;
135135
}
136-
price = Math.Max(price, 0); //Price can't go negative.
136+
price = Math.Max(price - (price * StageProducer.PlayerStats.DiscountPercent / 100), 0); //Price can't go negative.
137137
ShopItem newItem = GD.Load<PackedScene>(ShopItem.LoadPath).Instantiate<ShopItem>();
138138
newItem.Display(price, item.Texture, item.Name);
139139
newItem.DisplayButton.Pressed += () => SetPurchasable(item, newItem);

0 commit comments

Comments
 (0)