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

Added Solar Brace skill #613

Merged
merged 2 commits into from
Apr 14, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ POIN Proc_StealHP
POIN CombatArt_Sol
#endif // COMBAT_ARTS

POIN Proc_SolarBrace

POIN Proc_AetherHeal //skills that heal based on final damage

POIN Proc_BlackMagic Proc_Petrify Proc_Enrage Proc_Deadeye //skills that apply a status effect
Expand Down
Binary file added EngineHacks/SkillSystem/SkillIcons/SolarBrace.dmp
Binary file not shown.
Binary file added EngineHacks/SkillSystem/SkillIcons/SolarBrace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions EngineHacks/SkillSystem/Skills/ProcSkills/ProcSkills.event
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ POIN SkillTester
WORD SolID
WORD LiquidOozeID

Proc_SolarBrace:
#incbin "SolarBrace/proc_solarbrace.dmp"
POIN SkillTester
WORD SolarBraceID
WORD LiquidOozeID

Proc_Luna:
#incbin "Luna/proc_luna.dmp"
POIN SkillTester
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@echo off

SET startDir=C:\devkitPro\devkitARM\bin\

@rem Assemble into an elf
SET as="%startDir%arm-none-eabi-as"
%as% -g -mcpu=arm7tdmi -mthumb-interwork %1 -o "%~n1.elf"

@rem Print symbol table
SET readelf="%startDir%arm-none-eabi-readelf"
%readelf% -s "%~n1.elf" > "%~n1.symbols.log"

@rem Extract raw assembly binary (text section) from elf
SET objcopy="%startDir%arm-none-eabi-objcopy"
%objcopy% -S "%~n1.elf" -O binary "%~n1.dmp"

echo y | del "%~n1.elf"

echo y | del "%~n1.symbols.log"
pause
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
.thumb
.macro blh to, reg=r3
ldr \reg, =\to
mov lr, \reg
.short 0xf800
.endm
.equ SolarBraceID, SkillTester+4
.equ LiquidOozeID, SolarBraceID+4
@ r0 is attacker, r1 is defender, r2 is current buffer, r3 is battle data
push {r4-r7,lr}
mov r4, r0 @attacker
mov r5, r1 @defender
mov r6, r2 @battle buffer
mov r7, r3 @battle data
ldr r0,[r2] @r0 = battle buffer @ 0802B40A 6800
lsl r0,r0,#0xD @ 0802B40C 0340
lsr r0,r0,#0xD @Without damage data @ 0802B40E 0B40
mov r1, #0xC0 @skill flag
lsl r1, #8 @0xC000
add r1, #0x82 @miss OR devil
tst r0, r1
bne End
@if another skill already activated, don't do anything

@check for Solar Brace
ldr r0, SkillTester
mov lr, r0
mov r0, r4 @attacker data
ldr r1, SolarBraceID
.short 0xf800
cmp r0, #0
beq End

@skip if unit isn't the attacker
mov r0, r4
ldr r2,=0x203a4ec @attacker
cmp r0,r2
bne End



@if we proc, set the offensive skill flag
ldr r2,[r6]
lsl r1,r2,#0xD @ 0802B42C 0351
lsr r1,r1,#0xD @ 0802B42E 0B49
mov r0, #0x41
lsl r0, #8 @0x4100, attacker skill activated and hp draining
orr r1, r0
ldr r0,=0xFFF80000 @ 0802B434 4804
and r0,r2 @ 0802B436 4010
orr r0,r1 @ 0802B438 4308
str r0,[r6] @ 0802B43A 6018

ldrb r0, SolarBraceID
strb r0, [r6,#4]

@check liquid ooze
mov r0,r5
ldr r1,LiquidOozeID
ldr r3,SkillTester
mov lr,r3
.short 0xF800
mov r1, #4
ldsh r1, [r7, r1] @ damage
lsr r1, r1, #0x2 @divide damage by 4
ldrb r2, [r5, #0x13] @ defender's curr hp
cmp r1, r2
ble defLives @ Damage taken / HP healed by attacker
mov r1, r2 @ can't exceed damage dealt to defender.
defLives:
cmp r0,#0
beq noOoze
neg r1, r1
noOoze:
mov r2, #0x5
ldsb r2,[r6,r2] @hp change
add r2, r1
strb r2,[r6,#5] @hp change


End:
pop {r4-r7}
pop {r15}

.align
.ltorg
SkillTester:
@POIN SkillTester
@WORD SolarBraceID
@WORD LiquidOozeID
4 changes: 4 additions & 0 deletions EngineHacks/SkillSystem/skill_definitions.event
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,10 @@
//Author Unknown (Initial Commit)
#define SolID 12

//Solar Brace: When attacking, restore 25% of damage dealt as HP.
//By Snerdels
#define SolarBraceID 255

//Sure Shot: A precision attack that always hits and does 1.5x damage. (Skill % activation)
//Author Unknown (Initial Commit)
#define SureShotID 10
Expand Down
1 change: 1 addition & 0 deletions EngineHacks/SkillSystem/skill_descriptions.event
Original file line number Diff line number Diff line change
Expand Up @@ -397,5 +397,6 @@ SkillDescription(HighGroundID,SD_HighGround)
SkillDescription(NoGuardID,SD_NoGuard)
SkillDescription(SpeedBoostID,SD_SpeedBoost)
SkillDescription(WonderGuardID, SD_WonderGuard)
SkillDescription(SolarBraceID, SD_SolarBrace)
SkillDescription(AnalyticID, SD_Analytic)

3 changes: 3 additions & 0 deletions EngineHacks/SkillSystem/skill_icons.event
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,9 @@ ORG SkillIcon(WonderGuardID)
ORG SkillIcon(AnalyticID)
#incbin "SkillIcons/Acrobat.dmp"

ORG SkillIcon(SolarBraceID)
#incbin "SkillIcons/SolarBrace.dmp"


ORG SkillIcons+0x8000

7 changes: 6 additions & 1 deletion Text/skilldesc_text.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,12 @@ Speed Boost: Boosts movement by[N]
Wonder Guard: Cannot be damaged by[N]
weapons of the same type as the user's.[X]

## SD_SolarBrace
Solar Brace: When initiating[N]
combat, heal 25% of damage dealt.[X]

## SD_Analytic
Analytic: +10 attack if speed is less than[N]
opponent's by 4 or more, if between 1-3[N]
poits, then +5 attack.[X]
poits, then +5 attack.[X]