Skip to content

Commit

Permalink
TCG winstreaks is now saved. Addresses #21.
Browse files Browse the repository at this point in the history
Version increment.
  • Loading branch information
JianmengYu committed Jul 16, 2024
1 parent 78642ae commit 26dec5b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 12 deletions.
5 changes: 5 additions & 0 deletions 2.05-custom-gx/defines/mod.hsp
Original file line number Diff line number Diff line change
Expand Up @@ -7095,6 +7095,7 @@
#define global TWEAK_CATEGORY_GAMEPLAY 2
#define global TWEAK_CATEGORY_AI 3
#define global TWEAK_CATEGORY_CHALLENGE 3
#define global TWEAK_CATEGORY_TCG 3
#define global TWEAK_CATEGORY_MISC 4
#define global TWEAK_CATEGORY_MAX (TWEAK_CATEGORY_MISC + 1)

Expand Down Expand Up @@ -7183,6 +7184,10 @@
#define global TWEAK_CHALLENGE_HARCORE_TRAVELLING 103
#define global TWEAK_CHALLENGE_VANILLA_MONSTER_SPLIT 104
#define global TWEAK_CHALLENGE_SUPERAMBUSH 105
// Use the following 3 to track TCG progress.
#define global TWEAK_TCG_WIN_STREAK 106
#define global TWEAK_TCG_WIN_UNIQUE 107
#define global TWEAK_TCG_WIN_LETHAL 108

#define global TWEAK_MISC_RANDOM_START_MP3 0
#define global TWEAK_MISC_WEATHER_EVERYWHERE 1
Expand Down
4 changes: 2 additions & 2 deletions 2.05-custom-gx/main.hsp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#include "mock_defines.hsp"
#endif

#define global VARIANT_NAME "ElonaPlus Custom-GX 2.23.1.0"
#define global VARIANT_TITLE "Elona+ Custom-GX 2.23.1.0"
#define global VARIANT_NAME "ElonaPlus Custom-GX 2.23.1.1"
#define global VARIANT_TITLE "Elona+ Custom-GX 2.23.1.1"
#define global VERSION_STRING "6.33"
#define global VERSION_NUMBER int(double(VERSION_STRING) * 1000)
#define global NET_VERSION 200000
Expand Down
24 changes: 14 additions & 10 deletions 2.05-custom-gx/tcg_custom.hsp
Original file line number Diff line number Diff line change
Expand Up @@ -1079,18 +1079,19 @@
if ( yaminogemu@tcg == 1 ) {
if ( gameresult@tcg == -1 ) {
txtef COLOR_RED
txt "You escaped from the cursed game, but your soul is severedly damaged in the process!"
txt "You escaped from the lethal game, but your soul is severedly damaged in the process!"
cdata(CDATA_HP, CHARA_PLAYER) = 0
TweakData(TWEAK_TCG_WIN_LETHAL, TWEAK_CATEGORY_TCG) = 0
}
if ( gameresult@tcg > 0 ) {
if ( gameresult@tcg \ 2 == 1 ) {
cdata(CDATA_EMO_ICON, cc) = 6 + 100 * 3
cdata(CDATA_EMO_ICON, tc) = 13 + 100 * 3
cdata(CDATA_INTEREST, tc) -= 80
cdata(CDATA_INTEREST_RENEW, tc) = gdata(GDATA_HOUR) + gdata(GDATA_DAY) * 24 + gdata(GDATA_MONTH) * 24 * 30 + gdata(GDATA_YEAR) * 24 * 30 * 12 + 12
winconsecutiveyami@tcg++
TweakData(TWEAK_TCG_WIN_LETHAL, TWEAK_CATEGORY_TCG)++
txtef COLOR_YELLOW
txt "" + winconsecutiveyami@tcg + " consecutive cursed game victory!"
txt "" + TweakData(TWEAK_TCG_WIN_LETHAL, TWEAK_CATEGORY_TCG) + " consecutive lethal game victory!"
healthrate@tcg = limit(lifestakestart@tcg(0) * 10 / lifestakeend@tcg(0), 10, 300)
cdata(CDATA_HP, CHARA_PLAYER) = cdata(CDATA_HP, CHARA_PLAYER) * 10 / healthrate@tcg
cdata(CDATA_HP, tc) = (-1)
Expand Down Expand Up @@ -1120,10 +1121,12 @@
cdata(CDATA_HP, CHARA_PLAYER) = (-1)
cdata(CDATA_MP, CHARA_PLAYER) = 0
dmghp CHARA_PLAYER, 10, DAMAGE_FROM_CARD_GAME - tc
TweakData(TWEAK_TCG_WIN_LETHAL, TWEAK_CATEGORY_TCG) = 0
}
} else {
cdata(CDATA_INTEREST, tc) = 0
cdata(CDATA_INTEREST_RENEW, tc) = gdata(GDATA_HOUR) + gdata(GDATA_DAY) * 24 + gdata(GDATA_MONTH) * 24 * 30 + gdata(GDATA_YEAR) * 24 * 30 * 12 + 12
TweakData(TWEAK_TCG_WIN_LETHAL, TWEAK_CATEGORY_TCG) = 0
}
} else {
if ( gameresult@tcg > 0 ) {
Expand All @@ -1133,19 +1136,19 @@
modimp tc, 7
cdata(CDATA_INTEREST, tc) -= 80
cdata(CDATA_INTEREST_RENEW, tc) = gdata(GDATA_HOUR) + gdata(GDATA_DAY) * 24 + gdata(GDATA_MONTH) * 24 * 30 + gdata(GDATA_YEAR) * 24 * 30 * 12 + 12
winconsecutive@tcg++
TweakData(TWEAK_TCG_WIN_STREAK, TWEAK_CATEGORY_TCG)++
txtef COLOR_YELLOW
txt "" + winconsecutive@tcg + " consecutive wins!"
ticketreward@tcg = limit(limit(winconsecutive@tcg, 1, 10) * 20, 1, cdata(CDATA_LEVEL, tc))
txt "" + TweakData(TWEAK_TCG_WIN_STREAK, TWEAK_CATEGORY_TCG) + " consecutive wins!"
ticketreward@tcg = limit(limit(TweakData(TWEAK_TCG_WIN_STREAK, TWEAK_CATEGORY_TCG), 1, 10) * 20, 1, cdata(CDATA_LEVEL, tc))
txtef COLOR_YELLOW
txt "You get " + ticketreward@tcg + " music tickets!"
flt
itemcreate -1, ITEM_ID_MUSIC_TICKET, cdata(CDATA_X, CHARA_PLAYER), cdata(CDATA_Y, CHARA_PLAYER), ticketreward@tcg
if ( cdata(CDATA_QUALITY, tc) == FIX_QUALITY_UNIQUE | (cdata(CDATA_ID, tc) == CREATURE_ID_USER & cdata(CDATA_QUALITY, tc) >= FIX_QUALITY_MIRACLE) ) {
winagainstunique@tcg++
TweakData(TWEAK_TCG_WIN_UNIQUE, TWEAK_CATEGORY_TCG)++
txtef COLOR_YELLOW
txt "" + winagainstunique@tcg + " wins against Unique NPCs!"
if ( winagainstunique@tcg \ 5 == 0 ) {
txt "" + TweakData(TWEAK_TCG_WIN_UNIQUE, TWEAK_CATEGORY_TCG) + " wins against Unique NPCs!"
if ( TweakData(TWEAK_TCG_WIN_UNIQUE, TWEAK_CATEGORY_TCG) \ 5 == 0 ) {
txtef COLOR_YELLOW
txt "You get a Card Pack!"
flt
Expand All @@ -1157,12 +1160,13 @@
cdata(CDATA_EMO_ICON, tc) = 6 + 100 * 3
cdata(CDATA_INTEREST, tc) -= 10
cdata(CDATA_INTEREST_RENEW, tc) = gdata(GDATA_HOUR) + gdata(GDATA_DAY) * 24 + gdata(GDATA_MONTH) * 24 * 30 + gdata(GDATA_YEAR) * 24 * 30 * 12 + 12
winconsecutive@tcg = 0
TweakData(TWEAK_TCG_WIN_STREAK, TWEAK_CATEGORY_TCG) = 0
}
} else {
cdata(CDATA_EMO_ICON, tc) = 18 + 100 * 3
cdata(CDATA_INTEREST, tc) = 0
cdata(CDATA_INTEREST_RENEW, tc) = gdata(GDATA_HOUR) + gdata(GDATA_DAY) * 24 + gdata(GDATA_MONTH) * 24 * 30 + gdata(GDATA_YEAR) * 24 * 30 * 12 + 12
TweakData(TWEAK_TCG_WIN_STREAK, TWEAK_CATEGORY_TCG) = 0
}
}
return
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# 2.23.1.1

# Added
- Tweak for stronger ambush spawns.

# Fixed
- PV/DV fixer messages thanks to @air1068
- 's'earch not disarming quest traps.
- Saint blade not being PVDV damage.
- TCG winstreaks not being persistent.

# 2.23.1.0

# Added
Expand Down

0 comments on commit 26dec5b

Please sign in to comment.