public void ShowContractObjective(ContractObjectiveGameLogic contractObjectiveGameLogic)
 {
     contractObjectiveGameLogic.LogObjective("Contract Objective Shown");
     contractObjectiveGameLogic.displayToUser = true;
     AccessTools.Field(typeof(ContractObjectiveGameLogic), "currentObjectiveStatus").SetValue(contractObjectiveGameLogic, ObjectiveStatus.Active);
     EncounterLayerParent.EnqueueLoadAwareMessage(new ObjectiveUpdated(contractObjectiveGameLogic.encounterObjectGuid));
 }
        protected override void SpawnUnits(bool offScreen)
        {
            base.SpawnUnits(offScreen);

            if (this.teamDefinitionGuid == EncounterRules.PLAYER_TEAM_ID)
            {
                EncounterLayerParent.EnqueueLoadAwareMessage(new RefreshPortraitsMessage());
            }
        }
        static void Prefix(LanceSpawnerGameLogic __instance)
        {
            // Main.LogDebug($"[LanceSpawnerGameLogicOnUnitSpawnCompletePatch] Patching Prefix");
            if (HasLanceSpawnCompleted(__instance))
            {
                LanceSpawnedMessage lanceSpawnedMessage = new LanceSpawnedMessage(__instance.encounterObjectGuid, __instance.LanceGuid);
                EncounterLayerParent.EnqueueLoadAwareMessage(lanceSpawnedMessage);

                /*
                 * // From the unit spawn message - might need a similar one for lance spawning to interrupt
                 * if (this.triggerInterruptPhaseOnSpawn) {
                 * abstractActor.IsInterruptActor = true;
                 * base.Combat.StackManager.InsertInterruptPhase(team.GUID, unitSpawnedMessage.messageIndex);
                 * }
                 */
            }
        }
Exemplo n.º 4
0
        private void DestroyBuildingsUnderLanceSpawns(UnitSpawnPointGameLogic[] unitSpawns, BuildingRepresentation[] buildings, float radius)
        {
            foreach (UnitSpawnPointGameLogic unitSpawn in unitSpawns)
            {
                Vector3 position = unitSpawn.transform.position;

                foreach (BuildingRepresentation building in buildings)
                {
                    if (!building.IsDead)
                    {
                        if (position.DistanceFlat(building.transform.position) <= Radius)
                        {
                            EncounterLayerParent.EnqueueLoadAwareMessage(new DestroyActorMessage(EncounterLayerData.MapLogicGuid, building.parentCombatant.GUID));
                        }
                    }
                }
            }
        }