Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSL Script conversion #562

Merged
merged 7 commits into from
Dec 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions include/enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -1544,37 +1544,6 @@ enum DamageTypes {
DAMAGE_TYPE_TRIGGER_LUCKY = 0x80000000,
};

enum damageType {
DAMAGETYPE_FIRE = 0x00000002,
DAMAGETYPE_WATER = 0x00000004,
DAMAGETYPE_ICE = 0x00000008,
DAMAGETYPE_MAGIC = 0x00000010,
DAMAGETYPE_ELECTRIC = 0x00000020,
DAMAGETYPE_SMASH = 0x00000040,
DAMAGETYPE_JUMP = 0x00000080,
DAMAGETYPE_COSMIC = 0x00000100,
DAMAGETYPE_BLAST = 0x00000200,
DAMAGETYPE_POW = 0x00000400,
DAMAGETYPE_QUAKE = 0x00000800,
DAMAGETYPE_FEAR = 0x00001000,
DAMAGETYPE_AIR_LIFT = 0x00008000,
DAMAGETYPE_SPINY_SURGE = 0x00010000,
DAMAGETYPE_SHELL_CRACK = 0x00020000,
DAMAGETYPE_THROW = 0x00040000,
DAMAGETYPE_POWER_BOUNCE = 0x00100000,
DAMAGETYPE_QUAKE_HAMMER = 0x00200000,
DAMAGETYPE_REMOVE_BUFFS = 0x00400000,
DAMAGETYPE_PEACH_BEAM = 0x00800000,
DAMAGETYPE_MULTI_BOUNCE = 0x01000000,
DAMAGETYPE_UNBLOCKABLE = 0x02000000,
DAMAGETYPE_SPIN_SMASH = 0x04000000,
DAMAGETYPE_IGNORE_DEFENSE = 0x08000000,
DAMAGETYPE_NO_CONTACT = 0x10000000,
DAMAGETYPE_NO_OTHER_DAMAGE_POPUPS = 0x20000000,
DAMAGETYPE_STATUS_ALWAYS_HITS = 0x40000000,
DAMAGETYPE_TRIGGER_LUCKY = 0x80000000,
};
bates64 marked this conversation as resolved.
Show resolved Hide resolved

enum PartnerIDs {
PARTNER_NONE = 0x00000000,
PARTNER_GOOMBARIO = 0x00000001,
Expand Down
2 changes: 1 addition & 1 deletion include/script_api/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@

/// An entity index. Entities are assigned indices in the order they are created with EVT_CALL(MakeEntity, ...).
/// Supported in EVT_BIND_TRIGGER and EVT_BIND_PADLOCK only.
#define EVT_ENTITY_INDEX(entityIndex) (((((entityIndex)) + 0x400)))
#define EVT_ENTITY_INDEX(entityIndex) (((((entityIndex)) + 0x4000)))


/****** INSTRUCTIONS **************************************************************************************************/
Expand Down
78 changes: 44 additions & 34 deletions src/world/area_arn/arn_02/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,45 @@ EvtSource N(exitWalk_802410F0) = EXIT_WALK_SCRIPT(60, 0, "arn_05", 1);

EvtSource N(exitWalk_8024114C) = EXIT_WALK_SCRIPT(60, 1, "arn_04", 0);

EvtSource N(802411A8) = SCRIPT({
bind N(exitWalk_802410F0) TRIGGER_FLOOR_ABOVE 1;
bind N(exitWalk_8024114C) TRIGGER_FLOOR_ABOVE 6;
});

EvtSource N(main) = SCRIPT({
EVT_WORLD_LOCATION = LOCATION_GUSTY_GULCH;
SetSpriteShading(-1);
SetCamPerspective(0, 3, 25, 16, 4096);
SetCamBGColor(0, 0, 0, 0);
SetCamEnabled(0, 1);
MakeNpcs(0, N(npcGroupList_80241A9C));
await N(makeEntities);
spawn N(80241040);
EVT_VAR(0) = N(802411A8);
spawn EnterWalk;
sleep 1;
});
EvtSource N(802411A8) = {
EVT_BIND_TRIGGER(N(exitWalk_802410F0), TRIGGER_FLOOR_ABOVE, 1, 1, 0)
EVT_BIND_TRIGGER(N(exitWalk_8024114C), TRIGGER_FLOOR_ABOVE, 6, 1, 0)
EVT_RETURN
EVT_END
};

EvtSource N(main) = {
EVT_SET(EVT_SAVE_VAR(425), 34)
EVT_CALL(SetSpriteShading, -1)
EVT_CALL(SetCamPerspective, 0, 3, 25, 16, 4096)
EVT_CALL(SetCamBGColor, 0, 0, 0, 0)
EVT_CALL(SetCamEnabled, 0, 1)
EVT_CALL(MakeNpcs, 0, EVT_PTR(N(npcGroupList_80241A9C)))
EVT_EXEC_WAIT(N(makeEntities))
EVT_EXEC(N(80241040))
EVT_SET(EVT_VAR(0), EVT_PTR(N(802411A8)))
EVT_EXEC(EnterWalk)
EVT_WAIT_FRAMES(1)
EVT_RETURN
EVT_END
};

static s32 N(pad_12C4)[] = {
0x00000000, 0x00000000, 0x00000000,
};

EvtSource N(makeEntities) = SCRIPT({
MakeItemEntity(ITEM_DIZZY_DIAL, -248, 193, 45, 17, EVT_SAVE_FLAG(1005));
MakeItemEntity(ITEM_LETTER07, 536, 260, 227, 17, EVT_SAVE_FLAG(1006));
MakeEntity(0x802EA564, -350, 172, 170, 0, ITEM_COIN, MAKE_ENTITY_END);
AssignBlockFlag(EVT_SAVE_FLAG(1002));
MakeEntity(0x802EA564, 225, 265, 30, 0, ITEM_COIN, MAKE_ENTITY_END);
AssignBlockFlag(EVT_SAVE_FLAG(1003));
MakeEntity(0x802EA564, 275, 265, 150, 0, ITEM_REPEL_GEL, MAKE_ENTITY_END);
AssignBlockFlag(EVT_SAVE_FLAG(1004));
});
EvtSource N(makeEntities) = {
EVT_CALL(MakeItemEntity, ITEM_DIZZY_DIAL, -248, 193, 45, 17, EVT_SAVE_FLAG(1005))
EVT_CALL(MakeItemEntity, ITEM_LETTER07, 536, 260, 227, 17, EVT_SAVE_FLAG(1006))
EVT_CALL(MakeEntity, 0x802EA564, -350, 172, 170, 0, 343, MAKE_ENTITY_END)
EVT_CALL(AssignBlockFlag, EVT_SAVE_FLAG(1002))
EVT_CALL(MakeEntity, 0x802EA564, 225, 265, 30, 0, 343, MAKE_ENTITY_END)
EVT_CALL(AssignBlockFlag, EVT_SAVE_FLAG(1003))
EVT_CALL(MakeEntity, 0x802EA564, 275, 265, 150, 0, 151, MAKE_ENTITY_END)
EVT_CALL(AssignBlockFlag, EVT_SAVE_FLAG(1004))
EVT_RETURN
EVT_END
};

NpcAISettings N(npcAISettings_802413D0) = {
.moveSpeed = 1.8f,
Expand All @@ -54,9 +60,11 @@ NpcAISettings N(npcAISettings_802413D0) = {
.unk_2C = 1,
};

EvtSource N(npcAI_80241400) = SCRIPT({
DoBasicAI(N(npcAISettings_802413D0));
});
EvtSource N(npcAI_80241400) = {
EVT_CALL(DoBasicAI, EVT_PTR(N(npcAISettings_802413D0)))
EVT_RETURN
EVT_END
};

NpcSettings N(npcSettings_80241420) = {
.height = 20,
Expand All @@ -81,9 +89,11 @@ NpcAISettings N(npcAISettings_8024144C) = {
.unk_2C = 1,
};

EvtSource N(npcAI_8024147C) = SCRIPT({
N(func_80240C90_BDDE40)(N(npcAISettings_8024144C), 8);
});
EvtSource N(npcAI_8024147C) = {
EVT_CALL(N(func_80240C90_BDDE40), EVT_PTR(N(npcAISettings_8024144C)), 8)
EVT_RETURN
EVT_END
};

NpcSettings N(npcSettings_802414A0) = {
.height = 24,
Expand Down
26 changes: 13 additions & 13 deletions src/world/area_arn/arn_02/header.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ MapConfig N(config) = {
.tattle = { MSG_arn_02_tattle },
};

EvtSource N(80241040) = SCRIPT({
match EVT_STORY_PROGRESS {
< STORY_CH3_TUBBA_WOKE_UP {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}
PlayAmbientSounds(AMBIENT_WIND);
});
EvtSource N(80241040) = {
EVT_SWITCH(EVT_SAVE_VAR(0))
EVT_CASE_LT(-29)
EVT_CALL(SetMusicTrack, 0, SONG_GUSTY_GULCH, 0, 8)
EVT_CASE_LT(-16)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_ESCAPE, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_GUSTY_GULCH, 0, 8)
EVT_END_SWITCH
EVT_CALL(PlayAmbientSounds, AMBIENT_WIND)
EVT_RETURN
EVT_END
};
Loading