fork/training-mode-ce
git clone https://git.julia.blue/fork/training-mode-ce
305b2f6
techchase-camera
1#ifndef MEX_H_ITEM 2#define MEX_H_ITEM 3 4#include "structs.h" 5#include "datatypes.h" 6#include "obj.h" 7#include "gx.h" 8#include "color.h" 9#include "dynamics.h" 10#include <stdbool.h> 11 12// Item IDs 13enum ItemID 14{ 15ITEM_CAPSULE , 16ITEM_BOX , 17ITEM_BARREL , 18ITEM_EGG , 19ITEM_PARTYBALL , 20ITEM_BARRELCANNON , 21ITEM_BOBOMB , 22ITEM_MRSATURN , 23ITEM_HEARTCONTAINER , 24ITEM_MAXIMTOMATO , 25ITEM_STARMAN , 26ITEM_HOMERUNBAT , 27ITEM_BEAMSWORD , 28ITEM_PARASOL , 29ITEM_GREENSHELL , 30ITEM_REDSHELL , 31ITEM_RAYGUN , 32ITEM_FREEZIE , 33ITEM_FOOD , 34ITEM_MOTIONSENSORBOMB , 35ITEM_FLIPPER , 36ITEM_SUPERSCOPE , 37ITEM_STARROD , 38ITEM_LIPSSTICK , 39ITEM_FAN , 40ITEM_FIREFLOWER , 41ITEM_SUPERMUSHROOM , 42ITEM_POISONMUSHROOM , 43ITEM_HAMMER , 44ITEM_WARPSTAR , 45ITEM_SCREWATTACK , 46ITEM_BUNNYHOOD , 47ITEM_METALBOX , 48ITEM_CLOAKINGDEVICE , 49ITEM_POKEBALL , 50ITEM_RAYGUNUNK , 51ITEM_STARRODSTAR , 52ITEM_LIPSSTICKDUST , 53ITEM_SUPERSCOPEBEAM , 54ITEM_RAYGUNBEAM , 55ITEM_HAMMERHEAD , 56ITEM_FLOWER , 57ITEM_YOSHISEGG , 58ITEM_GOOMBA , 59ITEM_REDEAD , 60ITEM_OCTAROK , 61ITEM_OTTOSEA , 62ITEM_STONE , 63ITEM_MARIOFIRE , 64ITEM_DRMARIOPILL , 65ITEM_KIRBYCUTTER , 66ITEM_KIRBYHAMMER , 67ITEM_KIRBYABILITYSTAR , 68ITEM_53 , 69ITEM_FOXLASER , 70ITEM_FALCOLASER , 71ITEM_FOXILLUSION , 72ITEM_FALCOPHANTASM , 73ITEM_LINKBOMB , 74ITEM_CLINKBOMB , 75ITEM_LINKBOOMERANG , 76ITEM_CLINKBOOMERANG , 77ITEM_LINKHOOKSHOT , 78ITEM_CLINKHOOKSHOT , 79ITEM_LINKARROW , 80ITEM_CLINKARROW , 81ITEM_NESSPKFIRE , 82ITEM_NESSPKFIREEXPLODE , 83ITEM_NESSPKFLASH , 84ITEM_NESSPKTHUNDER , 85ITEM_NESSPKTHUNDER1 , 86ITEM_NESSPKTHUNDER2 , 87ITEM_NESSPKTHUNDER3 , 88ITEM_NESSPKTHUNDER4 , 89ITEM_FOXGUN , 90ITEM_FALCOGUN , 91ITEM_LINKBOW , 92ITEM_CLINKBOW , 93ITEM_NESSPKFLASHEXPLODE , 94ITEM_SHEIKNEEDLETHROWN , 95ITEM_SHEIKNEEDLEHELD , 96ITEM_PIKACHUTHUNDER , 97ITEM_PICHUTHUNDER , 98ITEM_MARIOCAPE , 99ITEM_DRMARIOCAPE , 100ITEM_SHEIKSMOKE , 101ITEM_YOSHIEGGTHROWN , 102ITEM_87 , 103ITEM_YOSHISTAR , 104ITEM_89 , 105ITEM_90 , 106ITEM_91 , 107ITEM_92 , 108ITEM_SAMUSBOMB , 109ITEM_SAMUSCHARGESHOT , 110ITEM_SAMUSMISSILE , 111ITEM_SAMUSGRAPPLE , 112ITEM_SHEIKCHAIN , 113ITEM_PEACHBOMBER , 114ITEM_PEACHTURNIP , 115ITEM_BOWSERFLAME , 116ITEM_NESSBAT , 117ITEM_NESSYOYO , 118ITEM_PEACHPARASOL , 119ITEM_PEACHTOAD , 120ITEM_LUIGIFIRE , 121ITEM_ICECLIMBERICE , 122ITEM_ICECLIMBERBLIZZARD , 123ITEM_ZELDAFIRE , 124ITEM_ZELDAFIREEXPLODE , 125ITEM_110 , 126ITEM_PEACHTOADSPORE , 127ITEM_MEWTWOSHADOWBALL , 128ITEM_ICECLIMBERROPE , 129ITEM_GAWPESTICIDE , 130ITEM_GAWMANHOLE , 131ITEM_GAWFIRE , 132ITEM_GAWPARACHUTE , 133ITEM_GAWTURTLE , 134ITEM_GAWSPERKY , 135ITEM_GAWJUDGE , 136ITEM_119 , 137ITEM_GAWSAUSAGE , 138ITEM_CLINKMILK , 139ITEM_GAWFIREFIGHTER , 140 141// pokemon 142ITEM_POKERANDOM = 160 , 143ITEM_GOLDEEN , 144ITEM_CHICORITA , 145ITEM_SNORLAX , 146ITEM_BLASTOISE , 147ITEM_WEEZING , 148ITEM_CHARIZARD , 149ITEM_MOLTRES , 150ITEM_ZAPDOS , 151ITEM_ARCTICUNO , 152ITEM_WOBBUFFET , 153ITEM_SCIZOR , 154ITEM_UNOWN , 155ITEM_ENTEI , 156ITEM_RAIKOU , 157ITEM_SUICUNE , 158ITEM_BELLOSSOM , 159ITEM_ELECTRODE , 160ITEM_LUGIA , 161ITEM_HOOH , 162ITEM_DITTO , 163ITEM_CLEFAIRY , 164ITEM_TOGEPI , 165ITEM_MEW , 166ITEM_CELEBI , 167ITEM_STARYU , 168ITEM_CHANSEY , 169ITEM_PORYGON2 , 170ITEM_CYNDAQUIL , 171ITEM_MARILL , 172ITEM_VENUSAUR , 173 174// stage 175ITEM_OLDGOOMBA = 208 , 176ITEM_TARGET , 177ITEM_BIRDOEGG = 236 , 178}; 179 180// ItemStateChange Flags 181#define ITEMSTATE_UPDATEANIM 0x2 182#define ITEMSTATE_GRAB 0x4 183#define ITEMSTATE_KEEPHIT 0x10 // dont remove hitboxes on state change 184 185// Item hold_kind definitions 186enum ItHoldKind 187{ 188ITHOLD_NONE ,// no hand change 189ITHOLD_OPENIN ,// open palm, facing inwards (towards fighter) 190ITHOLD_SWORD ,// closed palm, holding thin long object 191ITHOLD_OPENDOWN ,// open palm, facing down 192ITHOLD_OPENFRONT ,// open palm, facing forward 193}; 194enum ItUnkKind 195{ 196ITUNK_HAND ,// held item, like a capsule 197ITUNK_HEAVY ,// overhead item, like a crate 198ITUNK_2 , 199ITUNK_3 , 200ITUNK_4 , 201ITUNK_5 , 202ITUNK_6 , 203ITUNK_7 , 204ITUNK_NONE ,// unable to be held 205}; 206 207/*** Structs ***/ 208 209struct ItemModelDesc 210{ 211JOBJ * model ; 212int bone_count ; 213int bone_attach_id ; 214int bit_field ; 215}; 216 217struct ItemStateDesc 218{ 219void * anim_joint ; 220void * matanim_joint ; 221void * param ; 222void * script ; 223}; 224 225struct ItemDesc 226{ 227int * common_attributes ; 228int * unqiue_attributes ; 229int * hurtboxes ; 230ItemStateDesc * states ; 231ItemModelDesc * model ; 232int * dynamics ; 233}; 234 235struct itCommonData 236{ 237int x00 ; 238int x04 ; 239int x08 ; 240int x0C ; 241int x10 ; 242int x14 ; 243int x18 ; 244int x1C ; 245int x20 ; 246int x24 ; 247int x28 ; 248int x2C ; 249int x30 ; 250int x34 ; 251int x38 ; 252int x3C ; 253int x40 ; 254int x44 ; 255float x48 ; 256float x4C ; 257float x50 ; 258float x54 ; 259float x58 ; 260float x5C ; 261float x60 ; 262float x64 ; 263float x68 ; 264float x6C ; 265float x70 ; 266float x74 ; 267float x78 ; 268float x7C ; 269float x80 ; 270float x84 ; 271float x88 ; 272float x8C ; 273float x90 ; 274float x94 ; 275float x98 ; 276float x9C ; 277float xA0 ; 278float xA4 ; 279float xA8 ; 280float xAC ; 281float xB0 ; 282int xB4 ; 283float xB8 ; 284float xBC ; 285float xC0 ; 286float xC4 ; 287float xC8 ; 288float xCC ; 289float xD0 ; 290float xD4 ; 291int xD8 ; 292int xDC ; 293float xE0 ; 294float xE4 ; 295float xE8 ; 296float xEC ; 297float xF0 ; 298float xF4 ; 299float xF8 ; 300int xFC ; 301int x100 ; 302int x104 ; 303int x108 ; 304int x10C ; 305int x110 ; 306int x114 ; 307int x118 ; 308int x11C ; 309int x120 ; 310int x124 ; 311int x128 ; 312int x12C ; 313int x130 ; 314int x134 ; 315int x138 ; 316int x13C ; 317int x140 ; 318float x144 ; 319int x148 ; 320float x14C ; 321float x150 ; 322float x154 ; 323float x158 ; 324float x15C ; 325}; 326 327struct itPublicData 328{ 329itCommonData * common_data ; 330ItemDesc ** common_items ; 331ItemDesc ** adventure_items ; 332ItemDesc ** pokemon_items ; 333int * x10 ; 334int * x14 ; 335}; 336 337struct itData 338{ 339itCommonAttr * param ;// 0x00 340float * param_ext ;// 0x04 341void * hurtboxes ;// 0x08 342void * states ;// 0x0C 343void * model ;// 0x10 344ItDynamics * dynamics ;// 0x14 345}; 346 347struct itCommonAttr 348{ 349char is_heavy :1 ;// 0x0, bit 0x80, is heavy item (crate) 350char x0_78 :4 ;// unk 351char hold_kind :3 ;// defines hand hold behavior 352unsigned char x1_1 :1 ;// 0x1 0x80 353unsigned char x1_2 :1 ;// 0x1 0x40 354unsigned char x1_3 :1 ;// 0x1 0x20 355unsigned char x1_4 :1 ;// 0x1 0x10 356unsigned char x1_5 :1 ;// 0x1 0x08 357unsigned char cam_kind :2 ;// 0x1 0x06, is stored to 0xdcd 358unsigned char x1_8 :1 ;// 0x1 0x01 char flags3; //0x2 359char flags4 ;// 0x3 360float throw_speed_mult ;// 0x4, speed multiplier at which this item is thrown at 361int x8 ;// 362float spin_speed ;// 363float fall_speed ;// 0x10 364float fall_speed_max ;// 0x14 365float x18 ;// 366float dmg_mult ;// collision related? referenced on taking damage @ 80270f90 367int x20 ;// 0x20 368int x24 ;// 0x24 369int x28 ;// 0x28 370int x2c ;// 0x2c 371int x30 ;// 0x30 372float x34 ;// 0x34 373Vec2 grab_range ;// 0x38 374float ecb_top ;// 0x40 375float ecb_bot ;// 0x44 376float ecb_right ;// 0x48 377float ecb_left ;// 0x4c 378float weight ;// 0x50 379int x54 ;// 0x54 380int x58 ;// 0x58 381int x5c ;// 0x5c 382float scale ;// 0x60, does not affect hitboxes 383int destroy_gfx ;// 0x64, ID of a gfx to play on destroy 384int x68 ;// 0x68 385int x6c ;// 0x6c 386int x70 ;// 0x70 387int x74 ;// 0x74 388int destroy_sfx ;// 0x78 389int x7c ;// 0x7c 390int x80 ;// 0x80 391int x84 ;// 0x84 392int x88 ;// 0x88 393int x8c ;// 0x8c 394int x90 ;// 0x90 395int x94 ;// 0x94 396int x98 ;// 0x98 397int x9c ;// 0x9c 398}; 399 400struct ItemState 401{ 402int state ; 403void * animCallback ; 404void * physCallback ; 405void * collCallback ; 406}; 407 408struct SpawnItem 409{ 410GOBJ * parent_gobj ;// 0x0 411GOBJ * parent_gobj2 ;// 0x4 412int it_kind ;// 0x8, id of the item to spawn 413int hold_kind ;// 0xC, defines the behavior of the item, such as thrown and pickup. 0 = capsule 414int unk2 ;// 0x10 415Vec3 pos ;// 0x14 416Vec3 pos2 ;// 0x20 417Vec3 vel ;// 0x2C 418float facing_direction ;// 0x38 419short damage ;// 0x3C 420short unk5 ;// 0x3E 421int unk6 ;// 0x40, 1 = correct initial position 422unsigned char is_raycast_below :1 ;// 0x44, 0x80 = perform initial collision check 423int is_spin ;// 0x48, enables item spinning 424}; 425 426struct itHit 427{ 428int active ;// 0x0 429int x4 ;// 0x4, depends on 430int dmg ;// 0x8, projected damage 431float dmg_f ;// 0xc, staled damage, actually applied 432Vec3 offset ;// 0x10 433float size ;// 0x1c 434int angle ;// 0x20 435int kb_growth ;// 0x24 436int wdsk ;// 0x28 437int kb ;// 0x2c 438int attribute ;// 0x30 439int shield_dmg ;// 0x34 440int hitsound_severity ;// 0x38. hurtbox interaction. 0 = none, 1 = grounded, 2 = aerial, 3 = both 441int hitsound_kind ;// 0x3c 442unsigned char x401 :1 ;// 0x40 0x80 443unsigned char x402 :1 ;// 0x40 0x40 444unsigned char hit_air :1 ;// 0x40 0x20. bool to check against aerial fighters 445unsigned char hit_ground :1 ;// 0x40 0x10. bool to check against grounded fighters 446unsigned char x405 :1 ;// 0x40 0x08 447unsigned char x406 :1 ;// 0x40 0x04 448unsigned char x407 :1 ;// 0x40 0x02 449unsigned char x408 :1 ;// 0x40 0x01 450unsigned char x41_80 :1 ;// 0x41 0x80 451unsigned char x41_40 :1 ;// 0x41 0x40 452unsigned char x41_20 :1 ;// 0x41 0x20 453unsigned char x41_10 :1 ;// 0x41 0x10 454unsigned char timed_rehit_on_item :1 ;// 0x41 0x08 455unsigned char timed_rehit_on_fighter :1 ;// 0x41 0x04 456unsigned char timed_rehit_on_shield :1 ;// 0x41 0x02 457unsigned char can_reflect :1 ;// 0x41 0x01 458unsigned char can_absorb :1 ;// 0x42 0x80 459unsigned char x42_40 :1 ;// 0x42 0x40 460unsigned char hit_facing :1 ;// 0x42 0x20. bool to only hit fighters facing the item 461unsigned char can_deflect :1 ;// 0x42 0x10 462unsigned char unk_reflect :1 ;// 0x42 0x08 ignore reflect? 463unsigned char no_hurt :1 ;// 0x42 0x04 ignore hurtbox 464unsigned char ignore_ungrab_hurtbox :1 ;// 0x42 0x02 465unsigned char x42_01 :1 ;// 0x42 0x01 466unsigned char hit_item :1 ;// 0x43 0x80 467unsigned char x432 :1 ;// 0x43 0x40 468unsigned char hit_all :1 ;// 0x43 0x20 469unsigned char x434 :1 ;// 0x43 0x10 470unsigned char x435 :1 ;// 0x43 0x08 471unsigned char x436 :1 ;// 0x43 0x04 472unsigned char x437 :1 ;// 0x43 0x02 473unsigned char x438 :1 ;// 0x43 0x01 474int x44 ;// 0x44 475JOBJ * bone ;// 0x48 476Vec3 pos ;// 0x4c 477Vec3 pos_prev ;// 0x58 478Vec3 pos_coll ;// 0x64 position of hurt collision 479float coll_distance ;// 0x70 Distance From Collding Hurtbox (Used for phantom hit collision calculation) 480HitVictim victims [24 ];// 0x74 481int x134 ;// 0x134 482int x138 ;// 0x138 483}; 484 485struct ItHurt 486{ 487int hurt_status ;// 0x0 488Vec3 hurt1_offset ;// 0x4 489Vec3 hurt2_offset ;// 0x10 490float scale ;// 0x1c 491JOBJ * jobj ;// 0x20 492unsigned char is_updated :1 ;// 0x24, if enabled, wont update position 493unsigned char x24_2 :1 ;// 0x24 0x40 494unsigned char x24_3 :1 ;// 0x24 0x20 495unsigned char x24_4 :1 ;// 0x24 0x10 496unsigned char x24_5 :1 ;// 0x24 0x08 497unsigned char x24_6 :1 ;// 0x24 0x04 498unsigned char x24_7 :1 ;// 0x24 0x02 499unsigned char x24_8 :1 ;// 0x24 0x01 500Vec3 hurt1_pos ;// 0x28 501Vec3 hurt2_pos ;// 0x34 502int bone_index ;// 0x40 503}; 504 505struct ItDynamics 506{ 507int dynamics_num ;// 0x8 number of dynamic bonesets for this fighter 508DynamicsDesc * dynamics_desc ;// 0x4 boneset data array (one for each boneset) 509}; 510 511struct ItDynamicBoneset 512{ 513int apply_phys_num ;// if this is 256, dyanmics are not processed 514JOBJ * root_bone ;// 0x4, is referenced when adding aobjs @ 80268c24, im guessing to skip adding the anims for dyn bones 515DynamicBoneset boneset ;// 0x8 516}; 517 518struct ItemData 519{ 520int x0 ;// 0x0 521GOBJ * item ;// 0x0 522int x8 ;// 0x8 523int spawn_kind ;// 0xC 524int kind ;// 0x10 525int x14 ;// 0x14 526int x18 ;// 0x18 527int x1c ;// 0x1c 528u8 team_id ;// 0x20 529int state ;// 0x24 530int x28 ;// 0x28 531float facing_direction ;// 0x2c 532int x30 ;// 0x30 533float spin_unk ;// 0x34 534float scale ;// 0x38 535int x3c ;// 0x3c 536Vec3 self_vel ;// 0x40 537Vec3 pos ;// 0x4C 538Vec3 vel_unk ;// 0x58 - 0x64 539Vec3 vel_unk2 ;// 0x64 - 0x70 540Vec3 vel_nudge ;// 0x70 - 0x7C 541Vec3 x7c ;// 0x7c 542Vec3 x88 ;// 0x88 543int x94 ;// 0x94 544int x98 ;// 0x98 545int x9c ;// 0x9c 546int xa0 ;// 0xa0 547int xa4 ;// 0xa4 548int xa8 ;// 0xa8 549int xac ;// 0xac 550int xb0 ;// 0xb0 551int xb4 ;// 0xb4 552struct // 553 {// 554ItemState * item_states ;// 0x0 555void (* OnCreate )(GOBJ * item );// 0x4 556void (* OnDestroy )(GOBJ * item );// 0x8 557void (* OnPickup )(GOBJ * item );// 0xC 558void (* OnDrop )(GOBJ * item );// 0x10 559void (* OnThrow )(GOBJ * item );// 0x14 560int (* OnGiveDamage )(GOBJ * item );// 0x18, returns isDestroy 561int (* OnTakeDamage )(GOBJ * item );// 0x1c, returns isDestroy 562void (* OnEnterAir )(GOBJ * item );// 0x20 563void (* OnReflect )(GOBJ * item );// 0x24 564void (* x28 )(GOBJ * item );// 0x28 565void (* x2c )(GOBJ * item );// 0x2c 566int (* OnShieldBounce )(GOBJ * item );// 0x30, returns isDestroy 567int (* OnShieldHit )(GOBJ * item );// 0x34, returns isDestroy 568void (* x38 )(GOBJ * item );// 0x38 569 }* it_func ;// 0xb8, persistent item callbacks 570ItemState * item_states ;// 0xbc 571int air_state ;// 0xc0 572itData * itData ;// 0xc4 573JOBJ * joint ;// 0xc8 574itCommonAttr * common_attr ;// 0xcc 575int xd0 ;// 0xd0 576ItDynamicBoneset dynamics_boneset [24 ];// 0xd4 577int dynamics_num ;// 0x374 578CollData coll_data ;// 0x378 -> 0x518 579GOBJ * fighter_gobj ;// 0x518 580int x51c ;// 0x51c 581CmSubject * camera_subject ;// 0x520 582int x524 ;// 0x524 583int x528 ;// 0x528 584int * script_parse ;// 0x52c 585int x530 ;// 0x530 586int x534 ;// 0x534 587int x538 ;// 0x538 588int x53c ;// 0x53c 589int x540 ;// 0x540 590int x544 ;// 0x544 591ColorOverlay color ;// 0x548 592int x5c8 ;// 0x5c8 593float current_frame ;// 0x5cc 594float framerate ;// 0x5d0 595itHit hitbox [4 ];// 0x5d4 596int hit_exception_id ;// 0xac4, cannot hit items with a matching index 597int hurt_num ;// 0xac8 598ItHurt it_hurt [2 ];// 0xacc 599struct 600 { 601int xb54 ;// 0xb54 602int xb58 ;// 0xb58 603float x1 ;// 0xb5c 604float x2 ;// 0xb60 605float y ;// 0xb64 606 }footstool ; 607int dynamics_xb68 ;// 0xb68, dynamic_hit_num? 608int xb6c ;// 0xb6c, dynamic hit 609int xb70 ;// 0xb70 610int xb74 ;// 0xb74 611int xb78 ;// 0xb78 612int xb7c ;// 0xb7c 613int xb80 ;// 0xb80 614int xb84 ;// 0xb84 615int xb88 ;// 0xb88 616int xb8c ;// 0xb8c 617int xb90 ;// 0xb90 618int xb94 ;// 0xb94 619int xb98 ;// 0xb98 620int xb9c ;// 0xb9c 621int xba0 ;// 0xba0 622int xba4 ;// 0xba4 623int xba8 ;// 0xba8 624int xbac ;// 0xbac 625int xbb0 ;// 0xbb0 626int xbb4 ;// 0xbb4 627int xbb8 ;// 0xbb8 628JOBJ ** bones ;// 0xbbc 629Effect effect ;// 0xbc0 630int xbec ;// 0xbec 631int xbf0 ;// 0xbf0 632int xbf4 ;// 0xbf4 633int xbf8 ;// 0xbf8 634int xbfc ;// 0xbfc 635int xc00 ;// 0xc00 636int xc04 ;// 0xc04 637int xc08 ;// 0xc08 638int xc0c ;// 0xc0c 639int xc10 ;// 0xc10 640int xc14 ;// 0xc14 641int xc18 ;// 0xc18 642float ecb_top ;// 0xc1c 643float ecb_bottom ;// 0xc20 644float ecb_right ;// 0xc24 645float ecb_left ;// 0xc28 646int xc2c ;// 0xc2c 647int xc30 ;// 0xc30 648struct // dmg, 0xc9c 649 {// 650int dealt ;// 0xc34, rounded down 651int xc38 ;// 0xc38 652int xc3c ;// 0xc3c 653int xc40 ;// 0xc40 654int xc44 ;// 0xc44 655int xc48 ;// 0xc48 656int xc4c ;// 0xc4c 657int xc50 ;// 0xc50 658float shield_hit_angle ;// 0xc54, angle at which the projectile touched the shield? 80077854 659float shield_hit_xc58 ;// 0xc58 660float shield_hit_xc5c ;// 0xc5c 661float shield_hit_xc60 ;// 0xc60 662GOBJ * reflect ;// 0xc64, pointer to the gobj that reflected this item, is removed after processing the reflection 663float xc68 ;// 0xc68 664int xc6c ;// 0xc6c 665int xc70 ;// 0xc70 666int xc74 ;// 0xc74 667int xc78 ;// 0xc78 668int xc7c ;// 0xc7c 669int xc80 ;// 0xc80 670int xc84 ;// 0xc84 671int xc88 ;// 0xc88 672int xc8c ;// 0xc8c 673GOBJ * xc90 ;// 0xc90 674int xc94 ;// 0xc94 675int xc98 ;// 0xc98 676int total ;// 0xc9c 677int recent ;// 0xca0 678int xca4 ;// 0xca4 679int xca8 ;// 0xca8, hitlag related, stems from the damage dealt 8026a41c 680int angle ;// 0xcac 681int source_ply ;// 0xcb0, damage source ply number 682int xcb4 ;// 0xcb4 683float givedmg_direction ;// 0xcb8, updated @ 80078184 684float hitlag_frames ;// 0xcbc, hitlag frames remaining 685int xcc0 ;// 0xcc0 686int xcc4 ;// 0xcc4 687float kb ;// 0xcc8 688float takedmg_direction ;// 0xccc 689float xcd0 ;// 0xcd0 690float xcd4 ;// 0xcd4 691float xcd8 ;// 0xcd8 692float xcdc ;// 0xcdc 693float xce0 ;// 0xce0 694float xce4 ;// 0xce4 695float xce8 ;// 0xce8 696GOBJ * source_fighter ;// 0xcec 697GOBJ * source_item ;// 0xcf0, is a fighter gobj, but is the owner of the item that hit the item 698 }dmg ;// 699GOBJ * hit_fighter ;// 0xcf4, fighter that got hit by, shielded, or hit this item. is removed after processing the damage callbacks 700GOBJ * detected_fighter ;// 0xcf8, fighter that touched the items detect box. updated @ 800798d4 701int xcfc ;// 0xcfc 702GOBJ * grabbed_fighter ;// 0xd00 703GOBJ * attacker_item ;// 0xd04 704u8 xd08 ;// 0xd08 705u8 xd09 ;// 0xd09 706u8 xd0A ;// 0xd0A 707u8 xd0B ;// 0xd0B 708int xd0c ;// 0xd0c 709int xd10 ;// 0xd10 710struct // cb 711 {// 712void (* anim )(GOBJ * item );// 0xd14 713void (* phys )(GOBJ * item );// 0xd18 714void (* coll )(GOBJ * item );// 0xd1c 715void (* accessory )(GOBJ * item );// 0xd20 716void (* on_detect )(GOBJ * item );// 0xd24 717void (* on_enter_hitlag )(GOBJ * item );// 0xd28, runs after applying hitlag in damage apply proc 8026a62c 718void (* on_exit_hitlag )(GOBJ * item );// 0xd2c, runs after exiting hitlag in hitlag update proc 8026a200 719void * jumped_on ;// 0xd30, runs when the item is "jumped on", 80269bac 720void (* grabFt_onIt )(GOBJ * item );// 0xd34, when grabbing a fighter, run this function on self 721void (* grabFt_onFt )(GOBJ * fighter ,GOBJ * item );// 0xd38, when grabbing a fighter, run this function on fighter 722 }cb ;// 723float spin_speed ;// 0xd3c 724int xd40 ;// 0xd40 725float lifetime ;// 0xd44 726int xd48 ;// 0xd48 727int xd4c ;// 0xd4c 728int land_num ;// 0xd50 729int throw_num ;// 0xd54 730int xd58 ;// 0xd58 731int xd5c ;// 0xd5c 732int xd60 ;// 0xd60 733int xd64 ;// 0xd64 734int xd68 ;// 0xd68 735int xd6c ;// 0xd6c 736int xd70 ;// 0xd70 737int xd74 ;// 0xd74 738int xd78 ;// 0xd78 739int destroy_sfx ;// 0xd7c 740int xd80 ;// 0xd80 741int xd84 ;// 0xd84 742int atk_kind ;// 0xd88, copied from fighter atk_kind 743u16 atk_instance ;// 0xd8c, Contains an ID unique to the current move instance. e.g, if two dairs are done back to back, this ID will differ to tell them apart from each other. It is stored to 0x18EC of the victim upon colliding with someone. 744int xd90 ;// 0xd90 745int xd94 ;// 0xd94 746int xd98 ;// 0xd98 747float xd9c ;// 0xd9c 748int xda0 ;// 0xda0 749unsigned char xda4_80 :1 ;// 0xda4, 0x80 750unsigned char xda4_40 :1 ;// 0xda4, 0x40 751unsigned char xda4_20 :1 ;// 0xda4, 0x20 752unsigned char xda4_10 :1 ;// 0xda4, 0x10 753unsigned char xda4_08 :1 ;// 0xda4, 0x08 754unsigned char xda4_04 :1 ;// 0xda4, 0x04 755unsigned char xda4_02 :1 ;// 0xda4, 0x02 756unsigned char xda4_01 :1 ;// 0xda4, 0x01 757unsigned char xda5_80 :1 ;// 0xda5, 0x80 758unsigned char xda5_40 :1 ;// 0xda5, 0x40 759unsigned char xda5_20 :1 ;// 0xda5, 0x20 760unsigned char xda5_10 :1 ;// 0xda5, 0x10 761unsigned char xda5_08 :1 ;// 0xda5, 0x08 762unsigned char xda5_04 :1 ;// 0xda5, 0x04 763unsigned char xda5_02 :1 ;// 0xda5, 0x02 764unsigned char xda5_01 :1 ;// 0xda5, 0x01 765char xda6 ;// 0xda6 766char xda7 ;// 0xda7 767char xda8 ;// 0xda8 768char xda9 ;// 0xda9 769unsigned char xdaa1 :1 ;// 0x80 - 0xdaa 770unsigned char show_center_sphere :1 ;// 0x40 - 0xdaa 771unsigned char show_item_pickup :1 ;// 0x20 - 0xdaa 772unsigned char show_footstool :1 ;// 0x10 - 0xdaa 773unsigned char xda8_x8 :1 ;// 0x8 - 0xdaa 774unsigned char show_dynamics :1 ;// 0x4 - 0xdaa 775unsigned char show_hit :1 ;// 0x2 - 0xdaa 776unsigned char show_model :1 ;// 0x1 - 0xdaa 777char xdab ;// 0xdab 778struct // 779 {// 780int flag1 ;// 0xdac 781int flag2 ;// 0xdb0 782int flag3 ;// 0xdb4 783int flag4 ;// 0xdb8 784int flag5 ;// 0xdbc 785 }itcmd_var ;// 786int xdc0 ;// 0xdc0 787int xdc4 ;// 0xdc4 788u8 xdc8 :8 ;// 0xdc8 789u8 xdc9_1 :1 ;// 0xdc9, 0x80 790u8 is_hitlag :1 ;// 0xdc9, 0x40 791u8 freeze :1 ;// 0xdc9, 0x20 792u8 xdc9_10 :1 ;// 0xdc9, 0x10 793u8 xdc9_f :4 ;// 0xdc9, 0xF 794u16 xdca1 :1 ;// 0xdca 0x80 795u16 xdca2 :1 ;// 0xdca 0x40 796u16 xdca3 :1 ;// 0xdca 0x20 797u16 xdca4 :1 ;// 0xdca 0x10 798u16 xdca5 :1 ;// 0xdca 0x08 799u16 can_hold :1 ;// 0xdca 0x04 800u16 xdca7 :1 ;// 0xdca 0x02 801u16 rotate_axis :2 ;// 0xdca, 0x180 802u16 rotate_axis_enable :1 ;// 0xdcb, 0x40 803u16 xdcb_x20 :1 ;// 0xdcb, 0x20 804u16 xdcb_x10 :1 ;// 0xdcb, 0x10 805u16 can_nudge :1 ;// 0xdcb, 0x08 806u16 xdcb_5 :2 ;// 0xdcb, 0x06 807u16 xdcb_7 :1 ;// 0xdcb, 0x01 808unsigned char xdcc1 :1 ;// 0xdcc, 0x80 809unsigned char xdcc2 :1 ;// 0xdcc, 0x40 810unsigned char xdcc3 :1 ;// 0xdcc, 0x20 811unsigned char isCheckBlastzone :1 ;// 0xdcc, 0x10 812unsigned char isCheckRightBlastzone :1 ;// 0xdcc, 0x08 813unsigned char isCheckLeftBlastzone :1 ;// 0xdcc, 0x04 814unsigned char isCheckUpBlastzone :1 ;// 0xdcc, 0x02 815unsigned char isCheckDownBlastzone :1 ;// 0xdcc, 0x01 816unsigned char cam_kind :2 ;// 0xdcd, 0xc0. indicates this item has a camera box 817unsigned char no_play_hold_drop_throw_sfx :1 ;// 0xdcd, 0x20 818unsigned char xdcd4 :1 ;// 0xdcd, 0x10 819unsigned char xdcd5 :1 ;// 0xdcd, 0x08 820unsigned char xdcd6 :1 ;// 0xdcd, 0x04 (function 80275444 sets this when some items hit ground) 821unsigned char xdcd7 :1 ;// 0xdcd, 0x02 (function 80275444 sets this when some items hit ground) 822unsigned char xdcd8 :1 ;// 0xdcd, 0x01 (function 80275444 sets this when some items hit ground) 823unsigned char xdce1 :1 ;// 0xdce, 0x80 824unsigned char xdce2 :1 ;// 0xdce, 0x40 825unsigned char xdce3 :1 ;// 0xdce, 0x20 826unsigned char xdce4 :1 ;// 0xdce, 0x10 827unsigned char xdce5 :1 ;// 0xdce, 0x08 828unsigned char xdce6 :1 ;// 0xdce, 0x04, is checked when determining if an item should bounce off a shield 80269df0 829unsigned char is_detect :1 ;// 0xdce, 0x02, is flipped when a detect hitbox comes in contact with a hurtbox 830unsigned char xdce8 :1 ;// 0xdce, 0x01 831unsigned char xdcf1 :1 ;// 0xdcf, 0x80 832unsigned char xdcf2 :1 ;// 0xdcf, 0x40 833unsigned char xdcf3 :1 ;// 0xdcf, 0x20 834unsigned char xdcf4 :1 ;// 0xdcf, 0x10 835unsigned char xdcf5 :1 ;// 0xdcf, 0x08 836unsigned char xdcf6 :1 ;// 0xdcf, 0x04 837unsigned char is_hurt_by_fighter :1 ;// 0xdcf, 0x02, metal box checks this to make sure it was hit directly by a fighter and not their item 838unsigned char xdcf8 :1 ;// 0xdcf, 0x01 839unsigned char is_footstool :1 ;// 0xdd0, 0x80 840unsigned char xdd0_x40 :1 ;// 0xdd0, 0x40 841unsigned char xdd0_x20 :1 ;// 0xdd0, 0x20 842unsigned char xdd0_x10 :1 ;// 0xdd0, 0x10 843unsigned char is_grabbable :1 ;// 0xdd0, 0x08 844unsigned char xdd0_x04 :1 ;// 0xdd0, 0x04 845unsigned char xdd0_x02 :1 ;// 0xdd0, 0x02 846unsigned char xdd0_x01 :1 ;// 0xdd0, 0x01 847struct // 0xdd4 848 {// 849int var1 ;// 0xdd4 850int var2 ;// 0xdd8 851int var3 ;// 0xddc 852int var4 ;// 0xde0 853int var5 ;// 0xde4 854int var6 ;// 0xde8 855int var7 ;// 0xdec 856int var8 ;// 0xdf0 857int var9 ;// 0xdf4 858int var10 ;// 0xdf8 859int var11 ;// 0xdfc 860int var12 ;// 0xe00 861int xe04 ;// 0xe04 862int xe08 ;// 0xe08 863int xe0c ;// 0xe0c 864int xe10 ;// 0xe10 865int xe14 ;// 0xe14 866int xe18 ;// 0xe18 867int xe1c ;// 0xe1c 868int xe20 ;// 0xe20 869int xe24 ;// 0xe24 870int xe28 ;// 0xe28 871int xe2c ;// 0xe2c 872int xe30 ;// 0xe30 873int xe34 ;// 0xe34 874int xe38 ;// 0xe38 875int xe3c ;// 0xe3c 876int xe40 ;// 0xe40 877int xe44 ;// 0xe44 878int xe48 ;// 0xe48 879int xe4c ;// 0xe4c 880int xe50 ;// 0xe50 881int xe54 ;// 0xe54 882int xe58 ;// 0xe58 883int xe5c ;// 0xe5c 884int xe60 ;// 0xe60 885int xe64 ;// 0xe64 886int xe68 ;// 0xe68 887int xe6c ;// 0xe6c 888int xe70 ;// 0xe70 889int xe74 ;// 0xe74 890int xe78 ;// 0xe78 891int xe7c ;// 0xe7c 892int xe80 ;// 0xe80 893int xe84 ;// 0xe84 894int xe88 ;// 0xe88 895int xe8c ;// 0xe8c 896int xe90 ;// 0xe90 897int xe94 ;// 0xe94 898int xe98 ;// 0xe98 899int xe9c ;// 0xe9c 900int xea0 ;// 0xea0 901int xea4 ;// 0xea4 902int xea8 ;// 0xea8 903int xeac ;// 0xeac 904int xeb0 ;// 0xeb0 905int xeb4 ;// 0xeb4 906int xeb8 ;// 0xeb8 907int xebc ;// 0xebc 908int xec0 ;// 0xec0 909int xec4 ;// 0xec4 910int xec8 ;// 0xec8 911int xecc ;// 0xecc 912int xed0 ;// 0xed0 913int xed4 ;// 0xed4 914int xed8 ;// 0xed8 915int xedc ;// 0xedc 916int xee0 ;// 0xee0 917int xee4 ;// 0xee4 918int xee8 ;// 0xee8 919int xeec ;// 0xeec 920int xef0 ;// 0xef0 921int xef4 ;// 0xef4 922int xef8 ;// 0xef8 923int xefc ;// 0xefc 924int xf00 ;// 0xf00 925int xf04 ;// 0xf04 926int xf08 ;// 0xf08 927int xf0c ;// 0xf0c 928int xf10 ;// 0xf10 929int xf14 ;// 0xf14 930int xf18 ;// 0xf18 931int xf1c ;// 0xf1c 932int xf20 ;// 0xf20 933int xf24 ;// 0xf24 934int xf28 ;// 0xf28 935int xf2c ;// 0xf2c 936int xf30 ;// 0xf30 937int xf34 ;// 0xf34 938int xf38 ;// 0xf38 939int xf3c ;// 0xf3c 940int xf40 ;// 0xf40 941int xf44 ;// 0xf44 942int xf48 ;// 0xf48 943int xf4c ;// 0xf4c 944int xf50 ;// 0xf50 945int xf54 ;// 0xf54 946int xf58 ;// 0xf58 947int xf5c ;// 0xf5c 948int xf60 ;// 0xf60 949int xf64 ;// 0xf64 950int xf68 ;// 0xf68 951int xf6c ;// 0xf6c 952int xf70 ;// 0xf70 953int xf74 ;// 0xf74 954int xf78 ;// 0xf78 955int xf7c ;// 0xf7c 956int xf80 ;// 0xf80 957int xf84 ;// 0xf84 958int xf88 ;// 0xf88 959int xf8c ;// 0xf8c 960int xf90 ;// 0xf90 961int xf94 ;// 0xf94 962int xf98 ;// 0xf98 963int xf9c ;// 0xf9c 964int xfa0 ;// 0xfa0 965int xfa4 ;// 0xfa4 966int xfa8 ;// 0xfa8 967int xfac ;// 0xfac 968int xfb0 ;// 0xfb0 969int xfb4 ;// 0xfb4 970int xfb8 ;// 0xfb8 971int xfbc ;// 0xfbc 972int xfc0 ;// 0xfc0 973int xfc4 ;// 0xfc4 974int xfc8 ;// 0xfc8 975 }item_var ;// 976}; 977 978/*** static reference ***/ 979 980static itPublicData ** stc_itPublicData = R13_OFFSET (-0x4978 ); 981static ItemDesc ** stc_itdesc_enemies = R13_OFFSET (-0x4968 ); 982 983/*** Functions ***/ 984void Item_IndexStageItem (ItemDesc * item_desc ,int index ); 985void Item_Hold (GOBJ * item ,GOBJ * fighter ,int boneID ); 986void Item_Catch (GOBJ * fighter ,int unk ); 987void Item_StoreItemDataToCharItemTable (int articleData ,int articleID ); 988void Items_StoreTimeout (GOBJ * item ,float timeout ); 989GOBJ * Item_CreateItem (SpawnItem * item_spawn );// sorry for confusion, use this one for best results 990GOBJ * Item_CreateItem1 (SpawnItem * item_spawn ); 991GOBJ * Item_CreateItem2 (SpawnItem * item_spawn ); 992GOBJ * Item_CreateItem3 (SpawnItem * item_spawn ); 993GOBJ * Item_CreateMapItem (int index ,int initial_state ,void * data ,JOBJ * jobj ,void * onHit ,void * onHurt ,void * onUnk ); 994void Item_Destroy (GOBJ * item ); 995int Item_CollGround_PassLedge (GOBJ * item ,void * callback ); 996int Item_CollGround_StopLedge (GOBJ * item ,void * callback ); 997int Item_CollAir_Bounce (GOBJ * item ,void * callback ); 998int Item_CollAir_Land (GOBJ * item ,void * callback ); 999int Item_CollAir_NoCB (GOBJ * item ); 1000void Item_SetGroundedUpright (GOBJ * item ); 1001void ItemStateChange (GOBJ * item ,int stateID ,int flags ); 1002int ItemFrameTimer (GOBJ * item ); 1003void Item_PlaceOnGroundBelow (GOBJ * item ); 1004int Item_CheckIfTouchingWall (GOBJ * item ,float * unk []); 1005void Item_InitGrab (ItemData * item ,int unk ,void * OnItem ,void * OnFighter ); 1006void Item_ResetAllHitPlayers (ItemData * item ); 1007int Item_CountActiveItems (int itemID ); 1008void Item_CopyDevelopState (GOBJ * item ,GOBJ * fighter ); 1009void GXLink_Item (GOBJ * gobj ,int pass ); 1010void Item_UpdateSpin (GOBJ * item ,float unk ); 1011void Item_SetAirborne (ItemData * ip ); 1012void Item_SetGrounded (ItemData * ip ); 1013void Item_SetLifeTimer (GOBJ * item ,float lifetime );// sets frames until item is destroyed 1014int Item_DecLifeTimer (GOBJ * item );// returns isEnd bool 1015JOBJ * Item_GetBoneJOBJ (GOBJ * item ,int bone_index ); 1016int Item_CheckIfEnabled ();// returns bool regarding if items are enabled for this match 1017int Item_GetGroundAirState (GOBJ * item ); 1018void Item_UpdatePhysAndColl (GOBJ * item ); 1019void Item_ProjectileVelocityCalculate (GOBJ * item ,float fall_speed ,float max_fall_speed ); 1020void Item_PlayOnDestroySFXAgain (ItemData * ,int sfxid ,int volume ,int panning ); 1021void Item_UpdatePositionCollision (GOBJ * item ); 1022void Item_ScaleToPlayerSize (GOBJ * item ); 1023void Item_AnimateAndUpdateSubactions (GOBJ * item ); 1024void Barrel_EnterBreak (GOBJ * item ); 1025void Item_EnableHitlagFlag (GOBJ * item ); 1026void Item_ReflectVelocity (GOBJ * item ); 1027void Item_Throw (GOBJ * item ,float unk ,Vec3 * pos ,Vec3 * vel ); 1028JOBJ * Item_GetHeldBone (GOBJ * item ); 1029void Item_BounceOffVictim (GOBJ * item ); 1030void Item_BounceOffShield (GOBJ * item ); 1031int Item_GenerateHitExceptionID (); 1032int Item_CheckHeavy (GOBJ * item ); 1033void Item_SetUngrabbable (GOBJ * item ); 1034void Item_SetJobjHidden (GOBJ * item ); 1035float Item_GetHitboxDamage (GOBJ * item ); 1036void Item_SetHitboxDamage (itHit * hitbox ,int damage ,GOBJ * item ); 1037void Item_RemoveAllHitboxes (GOBJ * item ); 1038void Item_SetHurtboxTangibility (GOBJ * item ,int tangibility ); 1039void Item_CreateHurtbox (GOBJ * item ,float x1 ,float y1 ,float z1 ,float x2 ,float y2 ,float z2 ,float size ); 1040void Item_UpdateHurtboxes (GOBJ * item ); 1041void Item_UpdateAnimationAndScriptTimers (GOBJ * item ); 1042void Item_ClearVelocity (GOBJ * item ); 1043void Item_ResetVelocity (GOBJ * item ); 1044void Item_UpdateECBTopN (GOBJ * item ); 1045int Item_GetWallCollFlags (GOBJ * item ); 1046void Item_UpdateHitboxDamage (itHit * hit ,int dmg ,GOBJ * item ); 1047GOBJ * Item_GiveOwnershipToAttacker (GOBJ * item ); 1048char Item_GetHoldKind (GOBJ * item ); 1049float Item_GetDistanceFromPointSquared (GOBJ * item ,Vec3 * position ); 1050void Item_DestroyAndRemovedGrabbed (GOBJ * item ,int flag ,float damage ); 1051bool Item_RemoveFighterReference (GOBJ * item ,GOBJ * fighter ); 1052void Item_ClearHitlagFlag (GOBJ * item ); 1053 1054void Egg_Destroy (GOBJ * egg_gobj ); 1055#endif