Skip to content

Commit

Permalink
Port omake's autopickup feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruin0x11 committed Oct 2, 2022
1 parent d63d79b commit 15a11e0
Show file tree
Hide file tree
Showing 10 changed files with 949 additions and 8 deletions.
33 changes: 29 additions & 4 deletions 2.05-custom-gx/action.hsp
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,9 @@

********** ORIGINAL - ENDING **********/

snd SOUNDLIST_GETGOLD1
if ( locvar_is_autopick == FALSE | cfg_autopicksound ) {
snd SOUNDLIST_GETGOLD1
}
ti = ci
in = inv(INV_ITEM_NUM, ci)
inv(INV_ITEM_NUM, ci) = 0
Expand Down Expand Up @@ -895,7 +897,7 @@
}
}
}
if ( inv(INV_ITEM_PROPERTY, ci) == PROP_CONSTRUCT ) {
if ( inv(INV_ITEM_PROPERTY, ci) == PROP_CONSTRUCT & locvar_is_autopick == FALSE ) {
txt lang(itemname(ci) + "を撤去する? ", "Do you want to remove " + itemname(ci) + "? ")
promptYesNo
if ( rtval == 0 ) {
Expand All @@ -919,6 +921,9 @@
}
}
if ( inv_getfreeid(cc) == (-1) ) {
if ( locvar_is_autopick ) {
txt lang("[自動拾い]", "[Autopickup]")
}
txt_invfull2
return 0
}
Expand Down Expand Up @@ -982,6 +987,9 @@
txt lang("店の倉庫が一杯のため売れない。", "Shopkeeper's inventory is full.")
}
else {
if ( locvar_is_autopick ) {
txt lang("[自動拾い]", "[Autopickup]")
}
txt_invfull2
}
return 0
Expand Down Expand Up @@ -1107,7 +1115,12 @@
else {
cell_refresh inv(INV_ITEM_X, ci), inv(INV_ITEM_Y, ci)
map(inv(INV_ITEM_X, ci), inv(INV_ITEM_Y, ci), 5) = map(inv(INV_ITEM_X, ci), inv(INV_ITEM_Y, ci), 4)
snd SOUNDLIST_GET1 + rnd(2)
if( locvar_is_autopick == FALSE | cfg_autopicksound ) {
snd SOUNDLIST_GET1 + rnd(2)
}
if ( locvar_is_autopick ) {
txt lang("[自動拾い]", "[Autopickup]")
}
msgkeep = 1
txt lang(name(cc) + "は" + itemname(ti, in) + "を拾った。", name(cc) + " pick" + _s(cc) + " up " + itemname(ti, in) + ".")
}
Expand Down Expand Up @@ -2375,7 +2388,19 @@
}
if ( map(x, y, 4) != 0 ) {
if ( cdata(CDATA_CONDITION_BLIND, CHARA_PLAYER) == 0 ) {
txt txtitemoncell(x, y)
if ( cfg_autopick ) {
if ( adata(ADATA_TYPE, gdata(GDATA_AREA)) != MAP_TYPE_HOME | adata(ADATA_TYPE, gdata(GDATA_AREA)) == AREA_RANCH | adata(ADATA_TYPE, gdata(GDATA_AREA)) == AREA_SHELTER ) {
if ( key_ctrl != 1 ) {
x = cdata(CDATA_X, CHARA_PLAYER)
y = cdata(CDATA_Y, CHARA_PLAYER)
cnt3 = 0
gosub *AutoPickTest
}
}
}
if ( map(x, y, 4) != 0 ) {
txt txtitemoncell(x, y)
}
}
else {
txt lang("地面に何かがあるようだ。", "You sense something under your foot.")
Expand Down
46 changes: 42 additions & 4 deletions 2.05-custom-gx/config.hsp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,12 @@
cfgRead "dmgPopupFontSize.", cfg_dmgfont = int(rtvaln)
cfgRead "dmgPopupSpeed.", cfg_dmgspeed = int(rtvaln)

// Autopickup options

cfgRead "autopick.", cfg_autopick = int(rtvaln)
cfgRead "autopick_sound.", cfg_autopicksound = int(rtvaln)
cfgRead "autodestroy_sound.", cfg_autodestroysound = int(rtvaln)

// Other options

cfgRead "showFps.", cfg_showfps = int(rtvaln)
Expand Down Expand Up @@ -468,7 +474,7 @@

dim monitorInfo, 10 + 8 ; MONITORINFOEX
monitorInfo(0) = 40 + 32
dim devMode, 44 ; DEVMODEA
dim devMode, 44 ; DEVMODEA
MonitorFromPoint 0, 0, 0 ; Get primary monitor at (0, 0)
if ( stat ) {
GetMonitorInfo stat, varptr(monitorInfo)
Expand Down Expand Up @@ -543,7 +549,7 @@
}
if ( submenu == 0 ) {
q = lang("オプション", "Option")
s = lang("ゲームの設定", "Game Setting"), lang("画面と音の設定", "Screen & Sound"), lang("ネット機能の設定", "Network Setting"), lang("詳細な設定", "Detailed Setting"), lang("ゲームパッド", "Game Pad"), lang("メッセージとログ", "Message & Log"), lang("言語(Language)", "Language"), lang("拡張設定1(表示)", "EX Setting 1 (Display)"), ""
s = lang("ゲームの設定", "Game Setting"), lang("画面と音の設定", "Screen & Sound"), lang("ネット機能の設定", "Network Setting"), lang("詳細な設定", "Detailed Setting"), lang("ゲームパッド", "Game Pad"), lang("メッセージとログ", "Message & Log"), lang("言語(Language)", "Language"), lang("拡張設定1", "EX Setting 1"), lang("拡張設定2(表示)", "EX Setting 2 (Display)"), ""

dx = 370
dy = 290
Expand Down Expand Up @@ -591,7 +597,13 @@
dy = 300
}
if ( submenu == 8 ) {
q = lang("拡張設定1(表示)", "EX Setting 1 (Display)")
q = lang("拡張設定1", "EX Setting 1")
s = lang("自動拾い&自動破壊", "Auto pickup & destroy"), lang("自動拾い時の効果音", "Autopick sound"), lang("自動破壊時の効果音", "Autodestroy sound"), ""
dx = 440
dy = 300
}
if ( submenu == 9 ) {
q = lang("拡張設定2(表示)", "EX Setting 2 (Display)")
s = lang("ダメージ表示", "Damage Popups"), lang(" HEX+バフ", " Hexes/Buffs"), lang(" 状態異常", " Ailments"), lang(" 回避", " Evade"), lang(" フォントサイズ", " Font Size"), lang(" 表示速度", " Display Duration"), ""
dx = 440
dy = 300
Expand Down Expand Up @@ -891,6 +903,20 @@
}
}
if ( submenu == 8 ) {
if ( cnt == 0 ) {
s = lang("使わない", "Disable"), lang("使う", "Enable")
mes s(cfg_autopick)
}
if ( cnt == 1 ) {
s = lang("なし", "Off"), lang("あり", "On")
mes s(cfg_autopicksound)
}
if ( cnt == 2 ) {
s = lang("なし", "Off"), lang("あり", "On")
mes s(cfg_autodestroysound)
}
}
if ( submenu == 9 ) {
if ( cnt == 0 ) {
s = lang("しない", "Off"), lang("する", "On")
mes s(cfg_dmgpopups)
Expand Down Expand Up @@ -1720,7 +1746,19 @@
}
}
if ( submenu == 8 ) {
snd SOUNDLIST_OK1
snd SOUNDLIST_OK1
if ( cs == 0 ) {
setBoolOption cfg_autopick, "autopick"
}
if ( cs == 1 ) {
setBoolOption cfg_autopicksound, "autopick_sound"
}
if ( cs == 2 ) {
setBoolOption cfg_autodestroysound, "autodestroy_sound"
}
}
if ( submenu == 9 ) {
snd SOUNDLIST_OK1
if ( cs == 0 ) {
setBoolOption cfg_dmgpopups, "dmgPopups"
}
Expand Down
Loading

0 comments on commit 15a11e0

Please sign in to comment.