Skip to content

Commit ceef20a

Browse files
committed
feat: 'Dive->','Dive-> (Sensitive)' trigger flags
1 parent 5eb173a commit ceef20a

File tree

4 files changed

+57
-0
lines changed

4 files changed

+57
-0
lines changed

resources/include/std_zh/std_constants.zh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3572,6 +3572,8 @@ enum ComboTrigFlag
35723572
TRIGFLAG_TGROUP_LESS,
35733573
TRIGFLAG_TGROUP_GREATER,
35743574
TRIGFLAG_TRIG_PUSHED,
3575+
TRIGFLAG_TRIG_DIVE,
3576+
TRIGFLAG_TRIG_DIVE_SENS,
35753577

35763578
TRIGFLAG_MAX_IN_USE,
35773579
TRIGFLAG_MAX = 32*6

src/base/combo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,8 @@ struct newcombo
271271
#define combotriggerTGROUP_LESS 0x00004000
272272
#define combotriggerTGROUP_GREATER 0x00008000
273273
#define combotriggerPUSHEDTRIG 0x00010000
274+
#define combotriggerDIVETRIG 0x00020000
275+
#define combotriggerDIVESENSTRIG 0x00040000
274276

275277
#define ctrigNONE 0x00
276278
#define ctrigIGNORE_SIGN 0x01

src/dialog/comboeditor.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2735,6 +2735,10 @@ std::shared_ptr<GUI::Widget> ComboEditorDialog::view()
27352735
TRIGFLAG(19,"Invert Proximity Req"),
27362736
INFOBTN("Triggers when all enemies are defeated"),
27372737
TRIGFLAG(87, "Enemies->"),
2738+
INFOBTN("Triggers when the player dives on this combo"),
2739+
TRIGFLAG(113, "Dive->"),
2740+
INFOBTN("Triggers when the player dives on this combo (more sensitive hitbox)"),
2741+
TRIGFLAG(114, "Dive-> (Sensitive)"),
27382742
INFOBTN("Triggers when screen secrets trigger"),
27392743
TRIGFLAG(88, "Secrets->")
27402744
),

src/zc/hero.cpp

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23419,6 +23419,55 @@ void HeroClass::checkspecial2(int32_t *ls)
2341923419
}
2342023420
}
2342123421
}
23422+
if(isDiving()) //Dive-> triggerflag
23423+
{
23424+
int pos = COMBOPOS(x+8,y+8);
23425+
int x1=x,x2=x+15,y1=y+(bigHitbox?0:8),y2=y+15;
23426+
int xposes[] = {x1,x1,x2,x2};
23427+
int yposes[] = {y1,y2,y1,y2};
23428+
int32_t poses[4];
23429+
getPoses(poses,x1,y1,x2,y2);
23430+
for(auto lyr = 0; lyr < 7; ++lyr)
23431+
{
23432+
mapscr* s = FFCore.tempScreens[lyr];
23433+
newcombo const& cmb = combobuf[s->data[pos]];
23434+
bool didtrig = false;
23435+
if (cmb.triggerflags[3] & combotriggerDIVETRIG)
23436+
{
23437+
do_trigger_combo(lyr,pos);
23438+
didtrig = true;
23439+
}
23440+
for(auto q = 0; q < 4; ++q)
23441+
{
23442+
if(poses[q] < 0) continue;
23443+
if(poses[q] == pos && didtrig) continue;
23444+
newcombo const& cmb = combobuf[s->data[poses[q]]];
23445+
if (cmb.triggerflags[3] & combotriggerDIVESENSTRIG)
23446+
do_trigger_combo(lyr,poses[q]);
23447+
}
23448+
}
23449+
word c = tmpscr->numFFC();
23450+
for(word i=0; i<c; i++)
23451+
{
23452+
ffcdata& ffc = tmpscr->ffcs[i];
23453+
newcombo const& cmb = combobuf[ffc.getData()];
23454+
if ((cmb.triggerflags[3] & combotriggerDIVETRIG) && ffcIsAt(i, x+8, y+8))
23455+
{
23456+
do_trigger_combo_ffc(i);
23457+
}
23458+
else if(cmb.triggerflags[3] & combotriggerDIVESENSTRIG)
23459+
{
23460+
for(auto q = 0; q < 4; ++q)
23461+
{
23462+
if(ffcIsAt(i, xposes[q], yposes[q]))
23463+
{
23464+
do_trigger_combo_ffc(i);
23465+
break;
23466+
}
23467+
}
23468+
}
23469+
}
23470+
}
2342223471

2342323472
//
2342423473
// Now, let's check for Save combos...

0 commit comments

Comments
 (0)