public override void Destructor(IntPtr handle)
        {
            ReadOnlySpan <PhysicsData> characterPhysicsArray = new ReadOnlySpan <PhysicsData>((void *)0x9154E8, 8);
            GameObject *characterObject = GetCharacterGameObject(_playerID);

            characterObject->ActorData->CharacterData->PhysicsData = characterPhysicsArray[(int)characterObject->Info->CharacterID];
        }
Exemple #2
0
        // returns 2 bits (b01 == display name, b10 == display hp)
        private byte ShouldDisplayNameplateDetour(IntPtr raptureAtkModule, GameObject *actor, GameObject *localPlayer, float distance)
        {
            if (actor->ObjectKind != (byte)ObjectKind.Pc)
            {
                goto ReturnOriginal;
            }
            var pc = (BattleChara *)actor;

            var targets = TargetSystem.Instance();

            if (actor == localPlayer || // Ignore localplayer
                (((BattleChara *)localPlayer)->Character.StatusFlags & 2) == 0 || // Alternate in combat flag
                GetTargetType(actor) == 3

                || (config.IgnoreParty && (pc->Character.StatusFlags & 16) > 0) || // Ignore party members
                (config.IgnoreAlliance && (pc->Character.StatusFlags & 32) > 0) || // Ignore alliance members
                (config.IgnoreFriends && (pc->Character.StatusFlags & 64) > 0) || // Ignore friends
                (config.IgnoreDead && pc->Character.Health == 0)    // Ignore dead players

                // Ignore targets
                || (config.IgnoreTargets && targets->Target == actor ||
                    targets->SoftTarget == actor ||
                    targets->FocusTarget == actor))
            {
                goto ReturnOriginal;
            }

            return((byte)(config.ShowHP ? (shouldDisplayNameplateHook.Original(raptureAtkModule, actor, localPlayer, distance) & ~1) : 0)); // Ignore HP


ReturnOriginal:
            return(shouldDisplayNameplateHook.Original(raptureAtkModule, actor, localPlayer, distance));
        }
Exemple #3
0
        public Cart(CartColor color) : base()
        {
            // Make sure that the cart is controllable
            _gameHandler.IsCartOnAutoPilot = false;

            // Load cart textures every time
            LoadPVMFile("OBJ_SHAREOBJ", (IntPtr)0x38AEB70);

            // Delete cart that is occupied by player before spawning a new one
            GameObject *NextGameObject = Handle->Next;

            while ((IntPtr)NextGameObject != IntPtr.Zero)
            {
                if (NextGameObject->executor == MainFunction && NextGameObject->Info->Action == (byte)CartAction.OccupiedByPlayer)
                {
                    DeleteNativeGameObject(NextGameObject);
                    break;
                }
                else
                {
                    NextGameObject = NextGameObject->Next;
                }
            }

            // Store information of the player character
            Info *characterInfo = GetCharacterGameObject(Players.P1)->Info;

            // Fixes cart despawning when far away from camera
            SETData->LoadCount      = 1;
            SETData->Flags          = -32767;
            SETData->Distance       = 4000100;
            SETData->ObjectInstance = Handle;

            // Set properties of the cart
            IsUnoccupied = true;
            Color        = color;
            Size         = (characterInfo->CharacterID) switch
            {
                Character.Gamma => CartSize.Long,
                Character.Big => CartSize.Wide,
                _ => CartSize.Normal,
            };

            // Teleport cart to the player's position
            Info->Position = characterInfo->Position;
        }
Exemple #4
0
        public static void ReplacementFunction(GameObject *obj)
        {
            switch (_gameHandler.CurrentStage)
            {
            case Stage.TwinkleCircuit:
            case Stage.TwinkleCircuitOne:
            case Stage.TwinkleCircuitTwo:
            case Stage.TwinkleCircuitThree:
            case Stage.TwinkleCircuitFour:
            case Stage.TwinkleCircuitFive:
            case Stage.TwinkleCircuitSix:
            case Stage.SkyChaseOne:
            case Stage.SkyChaseTwo:
                HookFunction.OriginalFunction(obj);
                break;

            default:
                ChangePlayerAction(Players.P1, PlayerAction.BumperCar);
                obj->Info->Action = 3;
                break;
            }
        }
Exemple #5
0
 public partial void OpenContextMenuFromTarget(GameObject *gameObject);
 public partial bool IsObjectInViewRange(GameObject *obj);
 void setFront(GameObject newFront)
 {
     frontObject = newFront;
 }
 void setBack(GameObject newBack)
 {
     rearObject = newBack;
 }
Exemple #9
0
 public void OpenCharaCard(GameObject *gameObject) => OpenCharaCardForObject(gameObject);
Exemple #10
0
 private partial void OpenCharaCardForObject(GameObject *gameObject);
 public partial ulong InteractWithObject(GameObject *obj, bool checkLineOfSight = true);
 public static partial uint GetActionInRangeOrLoS(uint actionId, GameObject *sourceObject, GameObject *targetObject);