예제 #1
0
        protected County CreateCounty(RegionRef region)
        {
            var county = new County(Guid.NewGuid())
            {
                Code   = "001".RandStr(),
                Name   = "Mombasa".RandStr(),
                Region = region,
                TotalRegisteredVoters = 100000,
                Status = EntityStatus.Active,
            };

            return(county);
        }
예제 #2
0
        public static OccupyRegionObjective CreateOccupyRegionObjective(string objectiveGuid, GameObject parent, string requiredLanceSpawnerGuid, string regionGameLogicGuid,
                                                                        string objectName, string title, string progressFormat, string description, bool useDropship)
        {
            GameObject occupyRegionObjectiveGo = new GameObject($"Objective_{objectName}");

            occupyRegionObjectiveGo.transform.parent        = parent.transform;
            occupyRegionObjectiveGo.transform.localPosition = Vector3.zero;

            OccupyRegionObjective occupyRegionObjective = occupyRegionObjectiveGo.AddComponent <OccupyRegionObjective>();

            occupyRegionObjective.title = occupyRegionObjectiveGo.name;
            occupyRegionObjective.encounterObjectGuid = objectiveGuid;
            occupyRegionObjective.requiredTagsOnUnit  = new TagSet(new string[] { "player_unit" });

            LanceSpawnerRef lanceSpawnerRef = new LanceSpawnerRef();

            lanceSpawnerRef.EncounterObjectGuid = requiredLanceSpawnerGuid;
            occupyRegionObjective.requiredLance = lanceSpawnerRef;

            occupyRegionObjective.durationType     = DurationType.AfterMoveComplete;
            occupyRegionObjective.durationToOccupy = 1;

            occupyRegionObjective.applyTagsWhen = ApplyTagsWhen.OnCompleteObjective;

            occupyRegionObjective.requiredTagsOnOpposingUnits = new TagSet(new string[] { "opposing_unit" });

            RegionRef regionRef = new RegionRef();

            regionRef.EncounterObjectGuid            = regionGameLogicGuid;
            occupyRegionObjective.occupyTargetRegion = regionRef;

            occupyRegionObjective.triggerDropshipFlybyPickupOnSuccess = useDropship;
            occupyRegionObjective.extractViaDropship = useDropship;
            occupyRegionObjective.title                  = title;
            occupyRegionObjective.showProgress           = true;
            occupyRegionObjective.progressFormat         = progressFormat;
            occupyRegionObjective.description            = description;
            occupyRegionObjective.priority               = 3;
            occupyRegionObjective.displayToUser          = true;
            occupyRegionObjective.checkObjectiveFlag     = false;
            occupyRegionObjective.useBeacon              = true;
            occupyRegionObjective.markUnitsWith          = ObjectiveMark.None;
            occupyRegionObjective.enableObjectiveLogging = true;

            occupyRegionObjective.onSuccessDialogue = new DialogueRef();

            return(occupyRegionObjective);
        }
예제 #3
0
        public static OccupyRegionObjective CreateOccupyRegionObjective(string objectiveGuid, GameObject parent, string contractObjectiveGuid, string requiredLanceSpawnerGuid, string regionGameLogicGuid,
                                                                        string objectName, string title, string progressFormat, string description, int numberOfUnitsToOccupy, int durationToOccupy, bool useDropship, string[] requiredTagsOnUnit, string[] requiredTagsOnOpposingUnits)
        {
            GameObject occupyRegionObjectiveGo = CreateGameObject(parent, objectName);

            OccupyRegionObjective occupyRegionObjective = occupyRegionObjectiveGo.AddComponent <OccupyRegionObjective>();

            occupyRegionObjective.title = occupyRegionObjectiveGo.name;
            occupyRegionObjective.encounterObjectGuid = objectiveGuid;
            occupyRegionObjective.requiredTagsOnUnit  = (requiredTagsOnUnit == null) ? new TagSet(new string[] { "player_unit" }) : new TagSet(requiredTagsOnUnit);

            LanceSpawnerRef lanceSpawnerRef = new LanceSpawnerRef();

            lanceSpawnerRef.EncounterObjectGuid = requiredLanceSpawnerGuid;
            occupyRegionObjective.requiredLance = lanceSpawnerRef;

            occupyRegionObjective.durationType     = DurationType.AfterMoveComplete;
            occupyRegionObjective.durationToOccupy = 1;

            occupyRegionObjective.numberOfUnitsToOccupy = numberOfUnitsToOccupy;

            occupyRegionObjective.applyTagsWhen = ApplyTagsWhen.OnCompleteObjective;

            occupyRegionObjective.requiredTagsOnOpposingUnits = (requiredTagsOnOpposingUnits == null) ? new TagSet(new string[] { "opposing_unit" }) : new TagSet(requiredTagsOnOpposingUnits);

            RegionRef regionRef = new RegionRef();

            regionRef.EncounterObjectGuid            = regionGameLogicGuid;
            occupyRegionObjective.occupyTargetRegion = regionRef;

            occupyRegionObjective.triggerDropshipFlybyPickupOnSuccess = useDropship;
            occupyRegionObjective.extractViaDropship = useDropship;
            occupyRegionObjective.title                  = title;
            occupyRegionObjective.showProgress           = true;
            occupyRegionObjective.progressFormat         = progressFormat;
            occupyRegionObjective.description            = description;
            occupyRegionObjective.priority               = 3;
            occupyRegionObjective.displayToUser          = true;
            occupyRegionObjective.checkObjectiveFlag     = false;
            occupyRegionObjective.useBeacon              = true;
            occupyRegionObjective.markUnitsWith          = ObjectiveMark.None;
            occupyRegionObjective.enableObjectiveLogging = true;

            AttachRequiredReferences(occupyRegionObjective, contractObjectiveGuid);

            return(occupyRegionObjective);
        }