diff --git a/src/game/chr/chr.c b/src/game/chr/chr.c index cd42096d7..bac7b0b61 100644 --- a/src/game/chr/chr.c +++ b/src/game/chr/chr.c @@ -9285,7 +9285,7 @@ glabel func0f027e1c /* f027f90: 0fc0cfe8 */ jal chrGetShield /* f027f94: a7ab0094 */ sh $t3,0x94($sp) /* f027f98: e7a00084 */ swc1 $f0,0x84($sp) -/* f027f9c: 0fc2c74a */ jal func0f0b1d28 +/* f027f9c: 0fc2c74a */ jal handGetDamage /* f027fa0: 8fa40048 */ lw $a0,0x48($sp) /* f027fa4: 3c0c800a */ lui $t4,%hi(g_Vars+0x284) /* f027fa8: 8d8ca244 */ lw $t4,%lo(g_Vars+0x284)($t4) @@ -9388,7 +9388,7 @@ glabel func0f027e1c /* f028118: 8d4b0014 */ lw $t3,0x14($t2) /* f02811c: 356c0001 */ ori $t4,$t3,0x1 /* f028120: ad4c0014 */ sw $t4,0x14($t2) -/* f028124: 0fc2c74a */ jal func0f0b1d28 +/* f028124: 0fc2c74a */ jal handGetDamage /* f028128: 8fa40048 */ lw $a0,0x48($sp) /* f02812c: 8fad00f8 */ lw $t5,0xf8($sp) /* f028130: 3c0e800a */ lui $t6,%hi(g_Vars+0x28c) diff --git a/src/game/chr/chraction.c b/src/game/chr/chraction.c index 7f2bbea1b..f2a25f968 100644 --- a/src/game/chr/chraction.c +++ b/src/game/chr/chraction.c @@ -5526,7 +5526,7 @@ glabel func0f0341dc /* f03432c: 00000000 */ nop ); -void func0f034330(struct chrdata *chr, f32 arg1, struct coord *vector, u8 *arg3, struct prop *prop, s32 arg5) +void func0f034330(struct chrdata *chr, f32 damage, struct coord *vector, u8 *arg3, struct prop *prop, s32 arg5) { s32 sp76 = 0; s32 sp72 = 0; @@ -5536,7 +5536,7 @@ void func0f034330(struct chrdata *chr, f32 arg1, struct coord *vector, u8 *arg3, func0f03ff2c(chr, &chr->prop->pos, vector, &sp76, &arg5, &sp72, &sp68); } - func0f034524(chr, arg1, vector, arg3, prop, arg5, 1, chr->prop, sp76, sp72, sp68, 0, 0, 0); + func0f034524(chr, damage, vector, arg3, prop, arg5, 1, chr->prop, sp76, sp72, sp68, 0, 0, 0); } GLOBAL_ASM( @@ -11599,7 +11599,7 @@ glabel func0f03ba44 /* f03bb60: 54410012 */ bnel $v0,$at,.L0f03bbac /* f03bb64: 93a40040 */ lbu $a0,0x40($sp) .L0f03bb68: -/* f03bb68: 0fc2c74a */ jal func0f0b1d28 +/* f03bb68: 0fc2c74a */ jal handGetDamage /* f03bb6c: 27a40040 */ addiu $a0,$sp,0x40 /* f03bb70: 8fad004c */ lw $t5,0x4c($sp) /* f03bb74: 8e0e001c */ lw $t6,0x1c($s0) @@ -16912,7 +16912,7 @@ glabel var7f1a9184 /* f0413ec: 8faa01cc */ lw $t2,0x1cc($sp) /* f0413f0: 13200065 */ beqz $t9,.L0f041588 /* f0413f4: 00000000 */ nop -/* f0413f8: 0fc2c74a */ jal func0f0b1d28 +/* f0413f8: 0fc2c74a */ jal handGetDamage /* f0413fc: 27a40260 */ addiu $a0,$sp,0x260 /* f041400: 8fab025c */ lw $t3,0x25c($sp) /* f041404: 240cffff */ addiu $t4,$zero,-1 @@ -17070,7 +17070,7 @@ glabel var7f1a9184 /* f041634: afa00080 */ sw $zero,0x80($sp) /* f041638: afaf007c */ sw $t7,0x7c($sp) /* f04163c: afb80078 */ sw $t8,0x78($sp) -/* f041640: 0fc2c74a */ jal func0f0b1d28 +/* f041640: 0fc2c74a */ jal handGetDamage /* f041644: 27a40260 */ addiu $a0,$sp,0x260 /* f041648: 8fa501cc */ lw $a1,0x1cc($sp) /* f04164c: e7a00074 */ swc1 $f0,0x74($sp) @@ -17203,7 +17203,7 @@ glabel var7f1a9184 /* f041828: 5560002e */ bnezl $t3,.L0f0418e4 /* f04182c: 93ac0260 */ lbu $t4,0x260($sp) .L0f041830: -/* f041830: 0fc2c74a */ jal func0f0b1d28 +/* f041830: 0fc2c74a */ jal handGetDamage /* f041834: 27a40260 */ addiu $a0,$sp,0x260 /* f041838: 8faa0068 */ lw $t2,0x68($sp) /* f04183c: 44050000 */ mfc1 $a1,$f0 diff --git a/src/game/chr/chraicommands.c b/src/game/chr/chraicommands.c index 9d15f9c64..18fd90987 100644 --- a/src/game/chr/chraicommands.c +++ b/src/game/chr/chraicommands.c @@ -816,8 +816,8 @@ bool ai0019(void) struct coord pos = {0, 0, 0}; if (chr && chr->prop) { - f32 value = func0f0b1d28((struct hand *)&cmd[4]); - func0f034330(chr, value, &pos, &cmd[4], NULL, (s8)cmd[3]); + f32 damage = handGetDamage((struct hand *)&cmd[4]); + func0f034330(chr, damage, &pos, &cmd[4], NULL, (s8)cmd[3]); } g_Vars.aioffset += 8; @@ -836,7 +836,7 @@ bool ai001a(void) if (chr1 && chr2 && chr1->prop && chr2->prop) { struct prop *prop = chrGetEquippedWeaponPropWithCheck(chr1, 0); - f32 thing; + f32 damage; struct coord vector = {0, 0, 0}; struct weaponobj *weapon; @@ -850,8 +850,8 @@ bool ai001a(void) vector.z = chr2->prop->pos.z - chr1->prop->pos.z; scaleTo1(&vector.x, &vector.y, &vector.z); weapon = prop->weapon; - thing = func0f0b1d28((struct hand *)&weapon->weaponnum); - func0f034330(chr2, thing, &vector, &weapon->weaponnum, chr1->prop, (s8)cmd[4]); + damage = handGetDamage((struct hand *)&weapon->weaponnum); + func0f034330(chr2, damage, &vector, &weapon->weaponnum, chr1->prop, (s8)cmd[4]); } } diff --git a/src/game/game_0601b0.c b/src/game/game_0601b0.c index e93a03830..fa9b998f2 100644 --- a/src/game/game_0601b0.c +++ b/src/game/game_0601b0.c @@ -2330,10 +2330,10 @@ void handInflictCloseRangeDamage(s32 handnum, struct hand *hand, bool arg2) func0f0a0cb0(&spd8, &spcc, handnum, true); if (func000225d4(spe4, &spd8, &spcc, &spc8) > 0) { - f32 somefloat = func0f0b1d28(hand) * 2.5f; + f32 damage = handGetDamage(hand) * 2.5f; skipthething = true; func0f0a8404(&playerprop->pos, playerprop->rooms, -1); - func0f085270(obj, somefloat, &prop->pos, hand->weaponnum, g_Vars.currentplayernum); + func0f085270(obj, damage, &prop->pos, hand->weaponnum, g_Vars.currentplayernum); func0f070698(prop, false); } } else if (arg2) { @@ -2364,7 +2364,7 @@ void handInflictCloseRangeDamage(s32 handnum, struct hand *hand, bool arg2) sp9c = 15; } - func0f0341dc(chr, func0f0b1d28(hand), &spac, hand, + func0f0341dc(chr, handGetDamage(hand), &spac, hand, g_Vars.currentplayer->prop, sp9c, chr->prop, spa8, spa4, spa0, 0); } } diff --git a/src/game/game_0b0fd0.c b/src/game/game_0b0fd0.c index 5aa36c722..7ac8f33fc 100644 --- a/src/game/game_0b0fd0.c +++ b/src/game/game_0b0fd0.c @@ -543,81 +543,42 @@ f32 handGetSingleUnk34(struct hand *hand) return result; } -GLOBAL_ASM( -glabel func0f0b1d28 -/* f0b1d28: 27bdffe0 */ addiu $sp,$sp,-32 -/* f0b1d2c: afbf0014 */ sw $ra,0x14($sp) -/* f0b1d30: 0fc2c41f */ jal handGetWeaponFunction -/* f0b1d34: afa40020 */ sw $a0,0x20($sp) -/* f0b1d38: 44801000 */ mtc1 $zero,$f2 -/* f0b1d3c: 10400016 */ beqz $v0,.L0f0b1d98 -/* f0b1d40: 8fa40020 */ lw $a0,0x20($sp) -/* f0b1d44: 8c430000 */ lw $v1,0x0($v0) -/* f0b1d48: 24010001 */ addiu $at,$zero,0x1 -/* f0b1d4c: 306e00ff */ andi $t6,$v1,0xff -/* f0b1d50: 15c10002 */ bne $t6,$at,.L0f0b1d5c -/* f0b1d54: 01c01825 */ or $v1,$t6,$zero -/* f0b1d58: c442001c */ lwc1 $f2,0x1c($v0) -.L0f0b1d5c: -/* f0b1d5c: 24010003 */ addiu $at,$zero,0x3 -/* f0b1d60: 5461000a */ bnel $v1,$at,.L0f0b1d8c -/* f0b1d64: 24010002 */ addiu $at,$zero,0x2 -/* f0b1d68: 908f0000 */ lbu $t7,0x0($a0) -/* f0b1d6c: 24010014 */ addiu $at,$zero,0x14 -/* f0b1d70: c4420014 */ lwc1 $f2,0x14($v0) -/* f0b1d74: 15e10004 */ bne $t7,$at,.L0f0b1d88 -/* f0b1d78: 3c01800a */ lui $at,%hi(g_Vars+0x44) -/* f0b1d7c: c424a004 */ lwc1 $f4,%lo(g_Vars+0x44)($at) -/* f0b1d80: 46041082 */ mul.s $f2,$f2,$f4 -/* f0b1d84: 00000000 */ nop -.L0f0b1d88: -/* f0b1d88: 24010002 */ addiu $at,$zero,0x2 -.L0f0b1d8c: -/* f0b1d8c: 54610003 */ bnel $v1,$at,.L0f0b1d9c -/* f0b1d90: 90980000 */ lbu $t8,0x0($a0) -/* f0b1d94: c4420020 */ lwc1 $f2,0x20($v0) -.L0f0b1d98: -/* f0b1d98: 90980000 */ lbu $t8,0x0($a0) -.L0f0b1d9c: -/* f0b1d9c: 24010006 */ addiu $at,$zero,0x6 -/* f0b1da0: 57010012 */ bnel $t8,$at,.L0f0b1dec -/* f0b1da4: 24040001 */ addiu $a0,$zero,0x1 -/* f0b1da8: 90990002 */ lbu $t9,0x2($a0) -/* f0b1dac: 3c014f80 */ lui $at,0x4f80 -/* f0b1db0: 44993000 */ mtc1 $t9,$f6 -/* f0b1db4: 07210004 */ bgez $t9,.L0f0b1dc8 -/* f0b1db8: 46803220 */ cvt.s.w $f8,$f6 -/* f0b1dbc: 44815000 */ mtc1 $at,$f10 -/* f0b1dc0: 00000000 */ nop -/* f0b1dc4: 460a4200 */ add.s $f8,$f8,$f10 -.L0f0b1dc8: -/* f0b1dc8: 3c014040 */ lui $at,0x4040 -/* f0b1dcc: 44818000 */ mtc1 $at,$f16 -/* f0b1dd0: 3c013f80 */ lui $at,0x3f80 -/* f0b1dd4: 44812000 */ mtc1 $at,$f4 -/* f0b1dd8: 46104483 */ div.s $f18,$f8,$f16 -/* f0b1ddc: 46049180 */ add.s $f6,$f18,$f4 -/* f0b1de0: 46023082 */ mul.s $f2,$f6,$f2 -/* f0b1de4: 00000000 */ nop -/* f0b1de8: 24040001 */ addiu $a0,$zero,0x1 -.L0f0b1dec: -/* f0b1dec: 0fc2883f */ jal handIsAttackingOnThisTick -/* f0b1df0: e7a20018 */ swc1 $f2,0x18($sp) -/* f0b1df4: 10400007 */ beqz $v0,.L0f0b1e14 -/* f0b1df8: c7a20018 */ lwc1 $f2,0x18($sp) -/* f0b1dfc: 00002025 */ or $a0,$zero,$zero -/* f0b1e00: 0fc2883f */ jal handIsAttackingOnThisTick -/* f0b1e04: e7a20018 */ swc1 $f2,0x18($sp) -/* f0b1e08: 10400002 */ beqz $v0,.L0f0b1e14 -/* f0b1e0c: c7a20018 */ lwc1 $f2,0x18($sp) -/* f0b1e10: 46021080 */ add.s $f2,$f2,$f2 -.L0f0b1e14: -/* f0b1e14: 8fbf0014 */ lw $ra,0x14($sp) -/* f0b1e18: 27bd0020 */ addiu $sp,$sp,0x20 -/* f0b1e1c: 46001006 */ mov.s $f0,$f2 -/* f0b1e20: 03e00008 */ jr $ra -/* f0b1e24: 00000000 */ nop -); +f32 handGetDamage(struct hand *hand) +{ + struct weaponfunc *func = handGetWeaponFunction(hand); + f32 damage = 0; + + if (func) { + if ((func->type & 0xff) == INVENTORYFUNCTYPE_SHOOT_SINGLE) { + struct weaponfunc_shootsingle *fullfunc = (struct weaponfunc_shootsingle *)func; + damage = fullfunc->damage; + } + + if ((func->type & 0xff) == INVENTORYFUNCTYPE_CLOSE) { + struct weaponfunc_close *fullfunc = (struct weaponfunc_close *)func; + damage = fullfunc->damage; + + if (hand->weaponnum == WEAPON_REAPER) { + damage *= g_Vars.lvupdate240f; + } + } + + if ((func->type & 0xff) == INVENTORYFUNCTYPE_THROW) { + struct weaponfunc_throw *fullfunc = (struct weaponfunc_throw *)func; + damage = fullfunc->damage; + } + } + + if (hand->weaponnum == WEAPON_MAULER) { + damage = (hand->unk063a / 3.0f + 1.0f) * damage; + } + + if (handIsAttackingOnThisTick(HAND_LEFT) && handIsAttackingOnThisTick(HAND_RIGHT)) { + damage += damage; + } + + return damage; +} u8 handGetSingleUnk38(struct hand *hand) { diff --git a/src/game/game_1999b0.c b/src/game/game_1999b0.c index f08e25095..83ccff5e5 100644 --- a/src/game/game_1999b0.c +++ b/src/game/game_1999b0.c @@ -237,7 +237,7 @@ bool aibotDoFarsightThing(struct chrdata *chr, u32 arg1, struct coord *arg2, str s32 sp164 = -1; s32 sp160 = 200; u8 sp156[] = {WEAPON_FARSIGHTXR20, 0, 0, 0}; - f32 fVar14 = func0f0b1d28((struct hand *)sp156); + f32 damage = handGetDamage((struct hand *)sp156); s32 fallback = 30; s32 value = fallback; @@ -272,7 +272,7 @@ bool aibotDoFarsightThing(struct chrdata *chr, u32 arg1, struct coord *arg2, str } chrEmitSparks(oppchr, oppprop, sp160, &oppprop->pos, arg2, chr); - func0f0341dc(oppchr, fVar14, arg2, (struct hand *)sp156, chr->prop, 200, oppprop, sp172, sp168, sp164, 0); + func0f0341dc(oppchr, damage, arg2, (struct hand *)sp156, chr->prop, 200, oppprop, sp172, sp168, sp164, 0); } } diff --git a/src/game/inventory/items.c b/src/game/inventory/items.c index 8be522df4..b63ea9f4e 100644 --- a/src/game/inventory/items.c +++ b/src/game/inventory/items.c @@ -119,7 +119,7 @@ struct weaponfunc_shootsingle invfunc_00011160 = { 0x00000000, // flags &invmenupos_00011098, 0x00000000, - 0x3f800000, + 1, // damage 0x40c00000, 6, 18, 2, 8, 0x40a00000, @@ -232,7 +232,7 @@ struct weaponfunc_close invfunc_unarmed_punch = { &invmenupos_00010fd0, // menupos invanim_punch, // fire animation 0x0041a200, // flags - 0x3f000000, + 0.5, // damage 60, 0x00000069, 0x00000069, @@ -256,7 +256,7 @@ struct weaponfunc_close invfunc_unarmed_disarm = { &invmenupos_00010fd0, // menupos invanim_punch, // fire animation 0x0041a600, // flags - 0x3e99999a, + 0.3, // damage 60, 0x00000069, 0x00000069, @@ -442,7 +442,7 @@ struct weaponfunc_shootsingle invfunc_falcon2_singleshot = { 0x00000000, // flags &invmenupos_00011098, 0x10000000, - 0x3f800000, + 1, // damage 0x3f800000, 3, 5, 2, 0, 0x41200000, @@ -464,7 +464,7 @@ struct weaponfunc_shootsingle invfunc_falcon2silenced_singleshot = { 0x00002000, // flags &invmenupos_00011098, 0x10000000, - 0x3f800000, + 1, // damage 0x3f800000, 3, 5, 2, 0, 0x41200000, @@ -484,7 +484,7 @@ struct weaponfunc_close invfunc_falcon2_pistolwhip = { &invmenupos_00010fd0, // menupos invanim_falcon2_pistolwhip, // fire animation 0x0041a200, // flags - 0x3f666666, + 0.9, // damage 60, 0x00000069, 0x00000069, @@ -671,7 +671,7 @@ struct weaponfunc_shootsingle invfunc_magsec_singleshot = { 0x00000000, // flags &invmenupos_00011098, 0x10000000, - 0x3f8ccccd, + 1.1, // damage 0x40c00000, 4, 8, 3, 0, 0x40a00000, @@ -693,7 +693,7 @@ struct weaponfunc_shootsingle invfunc_magsec_burst = { 0x00000002, // flags &invmenupos_00011098, 0x10000000, - 0x3f8ccccd, + 1.1, // damage 0x41200000, 9, 14, 0, 0, 0x41000000, @@ -838,7 +838,7 @@ struct weaponfunc_shootsingle invfunc_dy357_singleshot = { 0x00000000, // flags &invmenupos_00011098, 0x14000000, - 0x40000000, + 2, // damage 0x00000000, 8, 16, 0, -1, 0x41400000, @@ -860,7 +860,7 @@ struct weaponfunc_shootsingle invfunc_dy357lx_singleshot = { 0x00000000, // flags &invmenupos_00011098, 0x1e000000, - 0x43480000, + 200, // damage 0x00000000, 8, 24, 0, -1, 0x41400000, @@ -880,7 +880,7 @@ struct weaponfunc_close invfunc_dy357_pistolwhip = { &invmenupos_00010fd0, // menupos invanim_dy357_pistolwhip, // fire animation 0x0041a200, // flags - 0x3f666666, + 0.9, // damage 60, 0x00000069, 0x00000069, @@ -1007,7 +1007,7 @@ struct weaponfunc_shootsingle invfunc_phoenix_singleshot = { 0x00000000, // flags &invmenupos_00011098, 0x10000000, - 0x3f8ccccd, + 1.1, // damage 0x40400000, 3, 5, 2, 0, 0x41200000, @@ -1029,7 +1029,7 @@ struct weaponfunc_shootsingle invfunc_phoenix_explosiveshells = { 0x00004000, // flags &invmenupos_00011098, 0x10000000, - 0x3f99999a, + 1.2, // damage 0x40a00000, 13, 15, 25, 0, 0x41700000, @@ -1147,7 +1147,7 @@ struct weaponfunc_shootsingle invfunc_mauler_singleshot = { 0x00000000, // flags &invmenupos_00011098, 0x00000000, - 0x3f99999a, + 1.2, // damage 0x40c00000, 3, 9, 32, 28, 0x00000000, @@ -1169,7 +1169,7 @@ struct weaponfunc_shootsingle invfunc_mauler_chargeshot = { 0x00000000, // flags &invmenupos_00011098, 0x00000000, - 0x3f99999a, + 1.2, // damage 0x40c00000, 3, 9, 32, 28, 0x00000000, @@ -1771,7 +1771,7 @@ struct weaponfunc_throw invfunc_dragon_selfdestruct = { 0x000000ff, 0x00f00000, 0x0000003c, - 0x00000000, + 0, // damage }; struct inventory_ammo invammo_dragon = { @@ -2319,7 +2319,7 @@ struct weaponfunc_throw invfunc_laptopgun_deploy = { 0x00000157, 0x00f00000, 0x0000003c, - 0x00000000, + 0, // damage }; struct inventory_ammo invammo_laptopgun = { @@ -2401,7 +2401,7 @@ struct weaponfunc_shootsingle invfunc_shotgun_single = { 0x00000000, // flags &invmenupos_00011098, 0x00000000, - 0x3f19999a, + 0.6, // damage 0x41f00000, 20, 28, 0, 0, 0x00000000, @@ -2423,7 +2423,7 @@ struct weaponfunc_shootsingle invfunc_shotgun_double = { 0x00001000, // flags &invmenupos_00011098, 0x00000000, - 0x3f19999a, + 0.6, // damage 0x41800000, 20, 28, 0, 0, 0x00000000, @@ -2546,7 +2546,7 @@ struct weaponfunc_close invfunc_reaper_grind = { &invmenupos_0001100c, // menupos NULL, // fire animation 0x00002000, // flags - 0x3d4ccccd, + 0.05, // damage 80, 0x00000069, 0x00000069, @@ -2999,7 +2999,7 @@ struct weaponfunc_throw invfunc_timedmine_throw = { 0x00000113, 0x00f00000, 0x00000000, - 0x00000000, + 0, // damage }; struct inventory_ammo invammo_timedmine = { @@ -3071,7 +3071,7 @@ struct weaponfunc_throw invfunc_remotemine_throw = { 0x00000115, 0x00f00000, 0x00000000, - 0x00000000, + 0, // damage }; struct weaponfunc_special invfunc_remotemine_detonate = { @@ -3136,7 +3136,7 @@ struct weaponfunc_throw invfunc_proxymine_throw = { 0x00000114, 0x00f00000, 0x00000000, - 0x00000000, + 0, // damage }; struct inventory_ammo invammo_proximitymine = { @@ -3199,7 +3199,7 @@ struct weaponfunc_throw invfunc_ecmmine_throw = { 0x00000116, 0x00f00000, 0x0000003c, - 0x00000000, + 0, // damage }; struct inventory_ammo invammo_ecmmine = { @@ -3292,7 +3292,7 @@ struct weaponfunc_throw invfunc_grenade_throw = { 0x00000112, 0x00f00000, 0x0000003c, - 0x00000000, + 0, // damage }; struct weaponfunc_throw invfunc_grenade_pinball = { @@ -3306,7 +3306,7 @@ struct weaponfunc_throw invfunc_grenade_pinball = { 0x00000112, 0x005a0000, 0x0000003c, - 0x00000000, + 0, // damage }; struct inventory_ammo invammo_grenade = { @@ -3353,7 +3353,7 @@ struct weaponfunc_throw invfunc_nbomb_throw = { 0x00000110, 0x00f00000, 0x0000003c, - 0x00000000, + 0, // damage }; struct weaponfunc_throw invfunc_nbomb_proxy = { @@ -3367,7 +3367,7 @@ struct weaponfunc_throw invfunc_nbomb_proxy = { 0x00000110, 0x00f00000, 0x0000003c, - 0x00000000, + 0, // damage }; struct inventory_ammo invammo_nbomb = { @@ -3443,7 +3443,7 @@ struct weaponfunc_shootsingle invfunc_farsight_shoot = { 0x00000000, // flags &invmenupos_00011098, 0x00000000, - 0x42c80000, + 100, // damage 0x00000000, 70, 40, 0, 0, 0x00000000, @@ -3465,7 +3465,7 @@ struct weaponfunc_shootsingle invfunc_farsight_targetlocator = { 0x00000000, // flags &invmenupos_00011098, 0x00000000, - 0x42c80000, + 100, // damage 0x00000000, 70, 40, 0, 0, 0x00000000, @@ -3706,7 +3706,7 @@ struct weaponfunc_shootsingle invfunc_tranquilizer_shoot = { 0x00000200, // flags &invmenupos_00011098, 0x10000000, - 0x3e800000, + 0.25, // damage 0x40400000, 3, 5, 5, 0, 0x3f800000, @@ -3726,7 +3726,7 @@ struct weaponfunc_close invfunc_tranquilizer_lethal = { &invmenupos_00010fe4, // menupos invanim_tranquilizer_lethalinject, // fire animation 0x00002000, // flags - 0x42c80000, + 100, // damage 60, 0x00000069, 0x00000069, @@ -3800,7 +3800,7 @@ struct weaponfunc_shootsingle invfunc_psychosisgun_shoot = { 0x00200200, // flags &invmenupos_00011098, 0x10000000, - 0x3f000000, + 0.5, // damage 0x40400000, 3, 5, 5, 0, 0x3f800000, @@ -3882,7 +3882,7 @@ struct weaponfunc_shootsingle invfunc_sniperrifle_singleshot = { 0x00002000, // flags &invmenupos_00011098, 0x10000000, - 0x3f99999a, + 1.2, // damage 0x00000000, 6, 10, 0, 0, 0x41000000, @@ -3965,7 +3965,7 @@ struct weaponfunc_shootsingle invfunc_laser_pulse = { 0x00000000, // flags &invmenupos_00011098, 0x00000000, - 0x3f800000, + 1, // damage 0x00000000, 6, 18, 24, -1, 0x00000000, @@ -4054,7 +4054,7 @@ struct weaponfunc_shootsingle invfunc_pp9i_shoot = { 0x00000000, // flags &invmenupos_00011098, 0x10000000, - 0x3f800000, + 1, // damage 0x3f800000, 4, 8, 3, 0, 0x40400000, @@ -4115,7 +4115,7 @@ struct weaponfunc_shootsingle invfunc_cc13_shoot = { 0x00000000, // flags &invmenupos_00011098, 0x10000000, - 0x3f800000, + 1, // damage 0x40c00000, 4, 8, 3, 0, 0x40a00000, @@ -4736,7 +4736,7 @@ struct weaponfunc_close invfunc_combatknife_slash = { &invmenupos_00010fd0, // menupos invanim_combatknife_slash, // fire animation 0x00002000, // flags - 0x40000000, + 2, // damage 70, 0x00000069, 0x00000069, @@ -4763,7 +4763,7 @@ struct weaponfunc_throw invfunc_combatknife_throw = { 0x0000010f, 0x00f00000, 0x0000003c, - 0x3f800000, + 1, // damage }; struct inventory_ammo invammo_combatknife = { @@ -4810,7 +4810,7 @@ struct weaponfunc_throw invfunc_bug_throw = { 0x00000012, 0x00f00000, 0x0000003c, - 0x00000000, + 0, // damage }; struct weaponfunc_throw invfunc_targetamplifier_throw = { @@ -4824,7 +4824,7 @@ struct weaponfunc_throw invfunc_targetamplifier_throw = { 0x000001b1, 0x00f00000, 0x0000003c, - 0x00000000, + 0, // damage }; struct inventory_ammo invammo_bug = { @@ -5929,7 +5929,7 @@ struct weaponfunc_shootsingle invfunc_tester_primary = { 0x00000000, // flags &invmenupos_00011070, 0x10000000, - 0x3f800000, + 1, // damage 0x40c00000, 4, 8, 3, 0, 0x00000000, diff --git a/src/game/propobj.c b/src/game/propobj.c index 041aa4836..841c551e7 100644 --- a/src/game/propobj.c +++ b/src/game/propobj.c @@ -17487,7 +17487,7 @@ glabel var7f1aa438 /* f0757c8: 0fc0cfe8 */ jal chrGetShield /* f0757cc: afae01d4 */ sw $t6,0x1d4($sp) /* f0757d0: 8fa40070 */ lw $a0,0x70($sp) -/* f0757d4: 0fc2c74a */ jal func0f0b1d28 +/* f0757d4: 0fc2c74a */ jal handGetDamage /* f0757d8: e7a001d8 */ swc1 $f0,0x1d8($sp) /* f0757dc: 3c188007 */ lui $t8,%hi(var80069934) /* f0757e0: 3c098007 */ lui $t1,%hi(var80069930) @@ -22356,7 +22356,7 @@ glabel var7f1aa5a8 /* f07a368: afa000bc */ sw $zero,0xbc($sp) /* f07a36c: afb800b8 */ sw $t8,0xb8($sp) /* f07a370: afb900b4 */ sw $t9,0xb4($sp) -/* f07a374: 0fc2c74a */ jal func0f0b1d28 +/* f07a374: 0fc2c74a */ jal handGetDamage /* f07a378: 27a40118 */ addiu $a0,$sp,0x118 /* f07a37c: 8fa80178 */ lw $t0,0x178($sp) /* f07a380: 3c09800a */ lui $t1,%hi(g_Vars+0x318) @@ -36674,7 +36674,7 @@ glabel func0f085eac /* f086604: 24012710 */ addiu $at,$zero,0x2710 /* f086608: 51a1005b */ beql $t5,$at,.L0f086778 /* f08660c: 8fa80124 */ lw $t0,0x124($sp) -/* f086610: 0fc2c74a */ jal func0f0b1d28 +/* f086610: 0fc2c74a */ jal handGetDamage /* f086614: 8fa40048 */ lw $a0,0x48($sp) /* f086618: 8fac011c */ lw $t4,0x11c($sp) /* f08661c: 2401000d */ addiu $at,$zero,0xd @@ -48174,7 +48174,7 @@ glabel var7f1ab214 /* f091a74: 8fa50214 */ lw $a1,0x214($sp) /* f091a78: 0fc29f66 */ jal func0f0a7d98 /* f091a7c: 2406ffff */ addiu $a2,$zero,-1 -/* f091a80: 0fc2c74a */ jal func0f0b1d28 +/* f091a80: 0fc2c74a */ jal handGetDamage /* f091a84: 27a40094 */ addiu $a0,$sp,0x94 /* f091a88: 8fab0204 */ lw $t3,0x204($sp) /* f091a8c: 8faa0214 */ lw $t2,0x214($sp) @@ -48253,7 +48253,7 @@ glabel var7f1ab214 /* f091b9c: 24091388 */ addiu $t1,$zero,0x1388 /* f091ba0: a54902d8 */ sh $t1,0x2d8($t2) .L0f091ba4: -/* f091ba4: 0fc2c74a */ jal func0f0b1d28 +/* f091ba4: 0fc2c74a */ jal handGetDamage /* f091ba8: 27a40094 */ addiu $a0,$sp,0x94 /* f091bac: 8fa80070 */ lw $t0,0x70($sp) /* f091bb0: 8fac01d8 */ lw $t4,0x1d8($sp) @@ -48306,7 +48306,7 @@ glabel var7f1ab214 /* f091c60: afa00010 */ sw $zero,0x10($sp) /* f091c64: 0fc4be7c */ jal sparksCreate /* f091c68: afa00014 */ sw $zero,0x14($sp) -/* f091c6c: 0fc2c74a */ jal func0f0b1d28 +/* f091c6c: 0fc2c74a */ jal handGetDamage /* f091c70: 27a40094 */ addiu $a0,$sp,0x94 /* f091c74: 8fa901d8 */ lw $t1,0x1d8($sp) /* f091c78: 44050000 */ mfc1 $a1,$f0 diff --git a/src/include/game/chr/chraction.h b/src/include/game/chr/chraction.h index 6eb79ffd5..14f9e0649 100644 --- a/src/include/game/chr/chraction.h +++ b/src/include/game/chr/chraction.h @@ -50,11 +50,11 @@ void chrSetShield(struct chrdata *chr, f32 shield); u32 func0f034080(void); void func0f034124(struct chrdata *chr, f32 arg1, struct coord *coord, u8 *arg3, struct prop *prop); void func0f03417c(struct chrdata *chr, f32 arg1, struct coord *coord, u32 arg3, struct prop *prop); -void func0f0341dc(struct chrdata *chr, f32 arg1, struct coord *coord, struct hand *hand, struct prop *prop, u32 arg5, struct prop *prop2, s32 arg7, s32 arg8, s32 arg9, u32 arg10); -void func0f034330(struct chrdata *chr, f32 arg1, struct coord *vector, u8 *arg3, struct prop *prop, s32 arg5); +void func0f0341dc(struct chrdata *chr, f32 damage, struct coord *coord, struct hand *hand, struct prop *prop, u32 arg5, struct prop *prop2, s32 arg7, s32 arg8, s32 arg9, u32 arg10); +void func0f034330(struct chrdata *chr, f32 damage, struct coord *vector, u8 *arg3, struct prop *prop, s32 arg5); u32 func0f034410(void); u32 func0f034480(void); -void func0f034524(struct chrdata *chr, f32 arg1, struct coord *vector, u8 *arg3, struct prop *prop, u32 arg5, u32 arg6, struct prop *prop2, u32 arg8, u32 arg9, u32 arg10, u32 arg11, u32 arg12, u32 arg13); +void func0f034524(struct chrdata *chr, f32 damage, struct coord *vector, u8 *arg3, struct prop *prop, u32 arg5, u32 arg6, struct prop *prop2, u32 arg8, u32 arg9, u32 arg10, u32 arg11, u32 arg12, u32 arg13); u32 func0f03645c(void); bool func0f03654c(struct chrdata *chr, struct coord *pos, s16 *rooms, struct coord *pos2, s16 *rooms2, struct coord *vector, f32 arg6, u32 types); bool propchrHasClearLineToPos(struct prop *prop, struct coord *dstpos, struct coord *vector); diff --git a/src/include/game/game_0b0fd0.h b/src/include/game/game_0b0fd0.h index 5a71beb1c..4f2ed2452 100644 --- a/src/include/game/game_0b0fd0.h +++ b/src/include/game/game_0b0fd0.h @@ -27,7 +27,7 @@ void func0f0b1af0(s32 handnum, struct hand *hand); struct inventory_ammo *handGetAmmoDefinition(struct hand *hand); u8 handGetSingleUnk3c(struct hand *hand); f32 handGetSingleUnk34(struct hand *hand); -f32 func0f0b1d28(struct hand *hand); +f32 handGetDamage(struct hand *hand); u8 handGetSingleUnk38(struct hand *hand); u16 handGetSingleShootSound(struct hand *hand); bool handHasFunctionFlags(struct hand *hand, u32 flags); diff --git a/src/include/game/propobj.h b/src/include/game/propobj.h index 5e3c56ab5..6cda103da 100644 --- a/src/include/game/propobj.h +++ b/src/include/game/propobj.h @@ -232,7 +232,7 @@ u32 func0f084f64(void); u32 func0f085050(void); bool func0f085194(struct defaultobj *obj); u32 func0f0851ec(void); -void func0f085270(struct defaultobj *obj, f32 arg1, struct coord *pos, s32 weaponnum, s32 playernum); +void func0f085270(struct defaultobj *obj, f32 damage, struct coord *pos, s32 weaponnum, s32 playernum); void func0f0852ac(struct defaultobj *obj, f32 damage, struct coord *pos, s32 arg3, s32 arg4); u32 func0f0859a0(void); u32 func0f085e00(void); diff --git a/src/include/types.h b/src/include/types.h index a2d76241a..3f5d5c139 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -2873,7 +2873,7 @@ struct weaponfunc_shootsingle { struct weaponfunc base; /*0x14*/ struct inventory_menupos *unk14; /*0x18*/ u32 unk18; - /*0x1c*/ u32 unk1c; + /*0x1c*/ f32 damage; /*0x20*/ u32 unk20; /** @@ -2949,12 +2949,12 @@ struct weaponfunc_throw { /*0x14*/ s32 projectilemodelnum; /*0x18*/ u32 unk18; /*0x1c*/ u32 unk1c; - /*0x20*/ u32 unk20; + /*0x20*/ f32 damage; }; struct weaponfunc_close { struct weaponfunc base; - /*0x14*/ u32 unk14; + /*0x14*/ f32 damage; /*0x18*/ f32 range; /*0x1c*/ u32 unk1c; /*0x20*/ u32 unk20;