//Function called externally from LandTile.cs to initiate combat public void InitiateCombat(LandType combatLandType_, PartyGroup charactersInCombat_, EnemyEncounter encounter_) { //Creating the event data that we'll pass to the TransitionFade through the EventManager EVTData transitionEvent = new EVTData(); //Setting the transition to take 0.5 sec to fade out, stay on black for 1 sec, fade in for 0.5 sec, and call our initialize event to display the combat canvas transitionEvent.combatTransition = new CombatTransitionEVT(true, 0.5f, 1, 0.5f, this.combatInitializeEvent); //Invoking the transition event through the EventManager EventManager.TriggerEvent(CombatTransitionEVT.eventNum, transitionEvent); //Resetting all of the combat tiles to their default values this.tileHandler.ResetCombatTiles(); //Setting the combat positions for the player characters and enemies based on their distances this.characterHandler.InitializeCharactersForCombat(charactersInCombat_, encounter_); //Resetting the combat UI and cameras this.initiativeHandler.ResetForCombatStart(); this.uiHandler.ResetForCombatStart(); this.cameraHandler.ResetForCombatStart(); //Setting the state to start increasing initiatives after a brief wait this.SetWaitTime(3, CombatState.IncreaseInitiative); //Looping through and copying the loot table from the encounter this.lootTable = new List <EncounterLoot>(); foreach (EncounterLoot drop in encounter_.lootTable) { EncounterLoot loot = new EncounterLoot(); loot.lootItem = drop.lootItem; loot.dropChance = drop.dropChance; loot.stackSizeMinMax = drop.stackSizeMinMax; this.lootTable.Add(loot); } }
public ActionResult DeleteConfirmed(int id) { EncounterLoot encounterLoot = db.EncounterLoot.Find(id); db.EncounterLoot.Remove(encounterLoot); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "PlayerID,LootID,EncounterID,Disenchanted")] EncounterLoot encounterLoot) { if (ModelState.IsValid) { db.Entry(encounterLoot).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.LootID = new SelectList(db.Loot, "LootID", "LootName", encounterLoot.LootID); ViewBag.PlayerID = new SelectList(db.Player, "PlayerID", "PlayerName", encounterLoot.PlayerID); return(View("~/Views/Admin/EncounterLoots/Edit.cshtml", encounterLoot)); }
// GET: EncounterLoots/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EncounterLoot encounterLoot = db.EncounterLoot.Find(id); if (encounterLoot == null) { return(HttpNotFound()); } return(View("~/Views/Admin/EncounterLoots/Details.cshtml", encounterLoot)); }
// GET: EncounterLoots/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EncounterLoot encounterLoot = db.EncounterLoot.Find(id); if (encounterLoot == null) { return(HttpNotFound()); } ViewBag.LootID = new SelectList(db.Loot, "LootID", "LootName", encounterLoot.LootID); ViewBag.PlayerID = new SelectList(db.Player, "PlayerID", "PlayerName", encounterLoot.PlayerID); return(View("~/Views/Admin/EncounterLoots/Edit.cshtml", encounterLoot)); }