public void AddMission(MissionTypes type, int target, int start) { mission = new MissionHandler(this); mission.enemiesToKill = target; mission.enemiesKilled = start; OnMissionAdd.Invoke(mission); }
public Mission GenerateBaseMission(MissionTypes missionType, GameStage s) { var settings = missionSettings; var query = settings.Scenarios.Where(mission => mission.MissionType == missionType); if (!query.Any()) { Debug.LogErrorFormat("Incorrect MissionSettings. No Scenarios for {0}", missionType); return(null); } var count = query.Count(); var m = query.ElementAt(Rand.Range(0, count)); var newMission = new Mission() { StageInfo = s, MissionType = m.MissionType, TotalSeconds = m.TotalSeconds, BaseRecoverySeconds = m.BaseRecoverySeconds, Rounds = m.Rounds, Chances = m.Chances, PrizePurse = m.PrizePurse, Cost = m.Cost, ComboReward = m.ComboReward, RewardComboInterval = m.RewardComboInterval, BaseRecoveryFalloff = m.BaseRecoveryFalloff }; return(newMission); }
public Mission() { GameReference = GameObject.FindGameObjectWithTag("GameController").GetComponent <Game>(); MissionName = MissionStrings.GetMissionName(); MissionDescription = MissionStrings.GetMissionDescription(); MissionDificulty = Random.Range(1, 10); MissionTime = Random.Range(5, 10) * 0.5; RemainingTime = MissionTime; int tmp = StaticValues.NumberOfKingdoms; Kingdoms = Random.Range(1, (1 << tmp) - 1); ParticipatingHeroes = new List <Hero>(); ChaosReduction = MissionDificulty; GoldEarned = 10 * Random.Range(1 << (MissionDificulty - 1), 1 << (MissionDificulty)); ExpEarned = 10 * Random.Range(1 << (MissionDificulty - 1), 1 << (MissionDificulty)); FameEarned = 10 * MissionDificulty; MissionType = Utils.generateRandomEnum <MissionTypes>(new System.Random()); Debug.Log(string.Format("MissionTime {0}, Kingdoms {1}, ChaosReduction {2}, GoldEarned {3}, ExpEarned {4}, FameEarned {5}, MissionDificulty {6} MissionType {7}", MissionTime, Kingdoms, ChaosReduction, GoldEarned, ExpEarned, FameEarned, MissionDificulty, MissionType)); }
public Mission(MissionTypes missionType, Droid agent, Func<Point, bool> target, Func<Point, bool> isWalkable, Func<Point, bool> attackAlongTheWay) { this.missionType = missionType; this.agent = agent; this.target = target; this.isWalkable = isWalkable; this.attackAlongTheWay = attackAlongTheWay; }
public ActionResult GetMissions(Player currentPlayer, MissionTypes missionType) { var missions = _targetRepository.Get.ValidTargetsFor(currentPlayer); var map = _mapGenerator.GenerateTargetMap(missions); var json = Json(map); json.JsonRequestBehavior = JsonRequestBehavior.AllowGet; return json; }
private string GetMissionProgressString(MissionTypes missionType) { switch (missionType) { case MissionTypes.MTKILLRats: default: return("{0}/{1}"); } }
private string GetMissionDescriptionString(MissionTypes missionType) { switch (missionType) { case MissionTypes.MTKILLRats: return("Defeat {0} of units!"); default: return("INVALID_MISSION_TYPE_{0}"); } }
public void CreateMission() { MissionTypes type = (MissionTypes)Enum.Parse(typeof(MissionTypes), missionTypesDropdown.captionText.text); switch (type) { case MissionTypes.Travel: Travel mission = new Travel(vehicle); mission.SetDestination(colonyRef[destinationsDropdown.captionText.text].transform); mission.SetTravelTime(3); mission.Init(); UIHandler.UpdateUI(); break; default: break; } }
public Mission(string missionName, string missionDescription, double missionTime, int kingdoms, int chaosReduction, int goldEarned, int expEarned, int fameEarned, int missionDificulty, MissionTypes missionType) { GameReference = GameObject.FindGameObjectWithTag("GameController").GetComponent <Game>(); ParticipatingHeroes = new List <Hero>(); MissionName = missionName; MissionDescription = missionDescription; MissionTime = missionTime; RemainingTime = MissionTime; Kingdoms = kingdoms; ChaosReduction = chaosReduction; GoldEarned = goldEarned; ExpEarned = expEarned; FameEarned = fameEarned; MissionDificulty = missionDificulty; MissionType = missionType; }
void OnGUI() { GUILayout.Label("Mission Properties", EditorStyles.boldLabel); //create editor window description = EditorGUILayout.TextField("Description", description); //add description field count = EditorGUILayout.IntField("Count", count); //add count field //add the achievement type drop down field based on the active scripting language if (isJavascriptEnabled) { missionTypeJS = (MissionTypes)EditorGUILayout.EnumPopup("Mission Type", missionTypeJS); } else { missionTypeCS = (MissionsControllerCS.MissionTypes)EditorGUILayout.EnumPopup("Mission Type", missionTypeCS); } if (GUILayout.Button("Add Mission")) { addButtonHandler(); } }
/* * FUNCTION: Increment mission counter by required value. */ public void incrementMissionCount(MissionTypes type, int iVal) { missionsProgress[(int)type] += iVal; checkCompletion(); }
public ActionResult Index(Player currentPlayer, MissionTypes missionType) { //TODO: make sure player is valid for missionType return View(missionType); }