public void LinkToEntity(GameObject link) { mLink = link; mHasLink = true; mLinkedShrine = link.GetComponent <Shrine>(); }
public static void AddMasterKill(Mobile m, Shrine shrine) { var list = _List.FirstOrDefault(x => x.Mobile == m); if (list != null && list.Shrine != null) { if (list.Shrine.Any(y => y.Shrine == shrine)) { _List.FirstOrDefault(x => x.Mobile == m).Shrine.FirstOrDefault(y => y.Shrine == shrine).MasterDeath++; } else { _List.FirstOrDefault(x => x.Mobile == m).Shrine.Add(new ShrineArray { Shrine = shrine, MasterDeath = 1 }); } } else { var sa = new List <ShrineArray> { new ShrineArray { Shrine = shrine, MasterDeath = 1 } }; var ra = new RewardArray(m, sa); _List.Add(ra); } }
public void AddShrine(Shrine shrine) { context.Shrines.Add(shrine); SetAuditFields(shrine); context.SaveChanges(); }
//remove a shrine public void RemoveShrine(Shrine s) { shrines.Remove(s); if (!isOver) { CheckForWin(); } }
public TabardRewardGump(Shrine shrine) : base(100, 100) { _Shrine = shrine; AddPage(0); AddBackground(0, 0, 370, 470, 0x6DB); AddItem(145, 70, 0x2); AddItem(145, 50, 0x376F); AddItem(167, 70, 0x3); AddItem(75, 160, 0xA517); AddItem(50, 110, 0xA519); AddItem(50, 60, 0xA51B); AddItem(75, 20, 0xA51D); AddItem(250, 20, 0xA520); AddItem(275, 60, 0xA522); AddItem(275, 110, 0xA524); AddItem(250, 160, 0xA526); AddHtmlLocalized(10, 250, 350, 72, 1114513, "#1159363", 0x43FF, false, false); // <DIV ALIGN=CENTER>~1_TOKEN~</DIV> AddButton(10, 337, 0x15E1, 0x15E5, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(35, 337, 150, 34, 1159364, 0x7FFF, false, false); // Claim Reward AddButton(185, 337, 0x15E1, 0x15E5, 2, GumpButtonType.Reply, 0); AddHtmlLocalized(210, 337, 200, 34, 1159365, 0x7FFF, false, false); // Convert Existing Reward AddItem(50, 375, 0xA412); AddItem(200, 375, 0x7816); AddTooltip(1156299); AddImage(250, 370, 0x1196); AddItem(300, 385, 0xA412); }
void Start() { shrineScript = shrineInstance.GetComponent <Shrine> (); faith = 0; wood = 0; food = 0; }
public ArenaTeam(Shrine shrine) { Shrine = shrine; Int16 objectId = 0; switch (Shrine.Team) { case Team.Chaos: { objectId = 28000; break; } case Team.Order: { objectId = 28001; break; } case Team.Balance: { objectId = 28002; break; } } ShrineOrb = new CTFOrb(Shrine.Team, objectId); }
// Update is called once per frame void Update() { //do not manually update color if there is an ascend light below this. if (Above == null && !independent) { return; } ParticleSystem ps = GetComponent <ParticleSystem>(); Color c = renderer.sharedMaterial.GetColor("_TintColor"); //if it's not going to be deleted if (!del) { //oscillate the color of the tile float mod = (1 + Mathf.Sin(Time.timeSinceLevelLoad * timeMod * 1.2f)) * .5f; c.a = mod * .1f + .15f; // Decides when to highlight the ascend lights Tile t = ((Tile)this.transform.parent.GetComponent("Tile")); if (t.Resident) { //if theres a unit on the tile, check if it is next to a relted shrine or temple //if it is, highlight it for (int i = 0; i < t._adjacentTiles.Length; i++) { if (t._adjacentTiles[i] && t._adjacentTiles[i].Resident) { Shrine s = (Shrine)t._adjacentTiles[i].Resident.GetComponent("Shrine"); if (isAttached(s) && t.Resident.Player == t._adjacentTiles[i].Resident.Player && t.Resident.GetComponent("Soul") && ((Soul)t.Resident.GetComponent("Soul")).Souls >= s.SOULS_TO_ASCEND) { c.a = .55f; } } } } } else { //if it is ready to be deleted, stop the particles, and fade c.a = 0; ps.enableEmission = false; ps.loop = false; } //"chase" or ease to the destination alpha c = renderer.sharedMaterial.GetColor("_TintColor") - (renderer.sharedMaterial.GetColor("_TintColor") - c) / 10; //once it has faded enough, delete if (c.a <= .025f && del && (!ps.IsAlive() || independent)) { Destroy(this.gameObject); } this.renderer.sharedMaterial.SetColor("_TintColor", c); }
void OnTriggerEnter(Collider collider) { Shrine s = collider.GetComponent<Shrine>(); if (s != null && s.Occupy(gameObject.GetComponent<PlayerEnergy>())) { currentShrine = s; } }
public Tabard(Shrine shrine) : base(0xA412) { _Shrine = shrine; Weight = 3; Hue = JollyRogerData.GetShrineHue(shrine); StrRequirement = 0; }
void HandleShrine(Collider col) { Shrine shrine = col.GetComponent <Shrine>(); if (WaterLoads > 0) { shrine.PutLoad(); WaterLoads--; } }
public ShrineBattleController(Shrine shrine) : base(3796) { Shrine = shrine; Movable = false; Visible = false; Spawn = new Dictionary <BaseCreature, List <BaseCreature> >(); }
public ActionResult Create(CreateEditViewModel model) { var shrine = new Shrine(); Mapper.DynamicMap(model, shrine); shrineProvider.AddShrine(shrine); var jsonViewModel = new AjaxViewModel(true, model, null); return(Json(jsonViewModel)); }
public void usePowerOnShrine(Shrine s, God godUsingPower) { Debug.Log("Using fire power on Shrine!"); s.cycles = 5; s.delay = 2.0f; s.burner(); shrineLoc = s.transform.position; curShrine = s; // Object.Instantiate((Resources.Load("GodFire")).burner()) as GodPowerFire; // this.burner(); }
public override string getDescription() { Shrine s = (Shrine)type.GetComponent("Shrine"); if (s) { return("Build a spiritual " + type.GetType() + " that allows any unit with " + s.SOULS_TO_ASCEND + " merged souls"); } return(""); }
private ShrineController shrineController; //the shrineController of the currrent shrine //updates the UI with the details provided public void UpdateUI(Shrine shrine, ShrineController controller) { this.shrine = shrine; shrineController = controller; currentChoice = shrine.choices[shrine.activeChoice]; title.text = shrine.name; description.text = shrine.description; offer.text = currentChoice.description; sacrificeOption.text = "Sacrifice " + currentChoice.sacrificeAmount; sacrificeIcon.sprite = currentChoice.sacrificeSprite; }
public void handleShrineClick(Shrine shrine) { if (currentPower && godPowerDictionary[currentPower.buttonId].canUsePowerOnShrine()) { GodPower thePower = godPowerDictionary[currentPower.buttonId]; thePower.usePowerOnShrine(shrine, playerGod); playerGod.energy -= thePower.getEnergyCost(); clearCurrentPowerSelection(); } }
public GameObject SpawnShrineByIndex(int shrineIndex, Vector3 spawnPos) { if (CurrPlayerProtectShrines[shrineIndex].Count <= 0) { return(null); } CurrPlayerProtectShrines[shrineIndex].Count--; GameObject shrine = Instantiate(CurrPlayerProtectShrines[shrineIndex].ProtectShrinePrefab); Shrine ps = shrine.GetComponent <Shrine>(); ps.Init(shrineIndex, spawnPos); ps.OnShrineDestroy += OnProtectShrineDestroy; return(shrine); }
void OnTriggerExit(Collider collider) { // Clear current altar property Shrine s = collider.GetComponent<Shrine>(); if (s != null) { // make the capture cancel if you leave the trigger if (currentShrine != null) { currentShrine.Leave(gameObject.GetComponent<PlayerEnergy>()); currentShrine = null; } } }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Shrine = await _context.Shrine.FirstOrDefaultAsync(m => m.id == id); if (Shrine == null) { return(NotFound()); } return(Page()); }
//check if shrine s is attached bool isAttached(Shrine s) { if (s == null) { return(false); } for (int i = 0; i < _shrines.Length; i++) { if (_shrines[i] == s) { return(true); } } return(false); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Shrine = await _context.Shrine.FindAsync(id); if (Shrine != null) { _context.Shrine.Remove(Shrine); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public static void TitleCheck(Mobile m, Shrine shrine) { var list = _List.FirstOrDefault(x => x.Mobile == m); var pm = m as PlayerMobile; if (pm != null && list != null && list.Shrine != null) { var count = list.Shrine.FirstOrDefault(x => x.Shrine == shrine).FragmentCount; var playerTitle = GetShrineTitle(pm); var shrineTitle = GetTitle(shrine); if (playerTitle == 0 || (playerTitle != shrineTitle && list.Shrine.Any(x => x.FragmentCount < count && x.Shrine != shrine))) { SetShrineTitle(pm, shrineTitle); } } }
public TabardClaimConfirmGump(Shrine shrine) : base(340, 340) { _Shrine = shrine; AddPage(0); AddBackground(0, 0, 291, 179, 0x13BE); AddImageTiled(5, 6, 280, 20, 0xA40); AddHtmlLocalized(9, 8, 280, 20, 1159367, 0x7FFF, false, false); // Tabard of Virtue AddImageTiled(5, 31, 280, 120, 0xA40); AddHtmlLocalized(9, 35, 272, 120, 1159366, 0x7FFF, false, false); // You are about to claim your Tabard of Virtue. The tabard will be named and hued based on your current devotion to the virtues shown on your character mouseover. Are you sure you wish to claim this tabard right now? AddButton(5, 153, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0); AddHtmlLocalized(40, 155, 100, 20, 1011012, 0x7FFF, false, false); // CANCEL AddButton(160, 153, 0xFB7, 0xFB8, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(195, 155, 120, 20, 1006044, 0x7FFF, false, false); // OK }
//attach shrine s to the light public void attachShrine(Shrine s) { ParticleSystem ps = (ParticleSystem)GetComponent("ParticleSystem"); for (int i = 0; i < _shrines.Length; i++) { if (_shrines[i] == null) { _shrines[i] = s; ps.enableEmission = true; ps.loop = true; del = false; ps.Play(); break; } } }
void HandleShrinePowerUp(Shrine shrine) { if (!activeIndicators.ContainsKey(shrine)) { // Create new indicator and make child of self RectTransform newIndicator = GameObject.Instantiate(prefab_shrineIndicator).GetComponent<RectTransform>(); newIndicator.SetParent(this.transform); newIndicator.position = baseCircle.position; newIndicator.localScale = new Vector3(1f, 1f, 1f); // Add to activeIndicators Dict activeIndicators.Add(shrine, newIndicator); } // Do a refresh pass to display correctly before next Update() RefreshShrineIndicators(); }
//remove shrine s from attached shrines. The light is removed if no shrines are attached anymore public void removeShrine(Shrine s) { int count = 0; for (int i = 0; i < _shrines.Length; i++) { if (_shrines[i] == s) { _shrines[i] = null; } else if (_shrines[i]) { count++; } } if (count <= 0) { del = true; } }
private void ProcessShrine(Shrine s) { if (s.IsDeactivated || !s.IsTargetable) { return; } var id = s.Id; if (_processedObjects.Contains(id)) { return; } var pos = s.WalkablePosition(); Shrines.Add(new CachedObject(id, pos)); _processedObjects.Add(id); GlobalLog.Warn($"[CombatAreaCache] Registering {pos}"); }
private void SetActors() { foreach (KeyValuePair <Commandments.Shrines, GameObject> element in onScene) { //Debug.Log("Clearing shrine " + element.Key); Shrine shrine = element.Value.GetComponent <Shrine>(); if (shrine) { shrine.Clear(); } } Vector3 tempVect = onScene[destinyShrine].transform.position; tempVect.z = player.transform.position.z; player.transform.position = tempVect; playerScript.ResetLerp(); playerScript.Reload(); gameManager.getCurrentCamera().InstantChangeLocation(player); //msg = "New Player position: " + player.transform.position; if (warpImage) { if (ApplyOnce.alreadyApplied("Reload", gameObject)) { startTime = transitionTime - 1; } else { //startTime = 0; //startTime = DEBUG_asd; for (startTime = 0; startTime < 2; startTime++) { UpdateCircleSimplified(); } } } ApplyOnce.remove("notifyAsderek", gameObject); ApplyOnce.remove("ScreenShot", gameObject); }
public static int GetShrineHue(Shrine shrine) { ShrineDef shrineDef = null; for (var index = 0; index < ShrineDef.Count; index++) { var x = ShrineDef[index]; if (x.Shrine == shrine) { shrineDef = x; break; } } if (shrineDef != null) { return(shrineDef.Hue); } return(default);
public static void FragmentIncrease(Mobile m, Shrine shrine) { if (m == null) { return; } var list = _List.FirstOrDefault(x => x.Mobile == m); if (list != null && list.Shrine != null) { if (list.Shrine.Any(y => y.Shrine == shrine)) { _List.FirstOrDefault(x => x.Mobile == m).Shrine.FirstOrDefault(y => y.Shrine == shrine).FragmentCount++; } else { _List.FirstOrDefault(x => x.Mobile == m).Shrine.Add(new ShrineArray { Shrine = shrine, FragmentCount = 1 }); } } else { var sa = new List <ShrineArray> { new ShrineArray { Shrine = shrine, FragmentCount = 1 } }; var ra = new RewardArray(m, sa); _List.Add(ra); } TitleCheck(m, shrine); }
public ActionResult Post([FromBody] Shrine shrine) { try { Response response = new Response(); shrine.IsActive = true; if (!string.IsNullOrEmpty(shrine.Image)) { var dataparts = shrine.Image.Split(','); if (dataparts.Length > 1) { shrine.Image = dataparts[1]; } var convertImage = Convert.FromBase64String(shrine.Image); string imageName = shrine.Id + "-" + Guid.NewGuid().ToString(); var filePath = Path.Combine("ClientApp/public/Images/Shrines", imageName + ".png"); System.IO.File.WriteAllBytes(filePath, convertImage); shrine.Image = filePath.Replace("ClientApp/public", ""); } db.shrines.Add(shrine); db.SaveChanges(); response.Data = shrine; response.Status = true; response.Message = " Create successfully"; return(Ok(response)); } catch (Exception e) { writeException.Write(e.Message, DateTime.Now, "Shrine", "Post", "Admin"); return(this.NotFound("Dosnt Create successfully")); } }
private bool CheckPlayerWin(ref PlayerController player, Shrine.CaptureState state) { int capturedCount = 0; // Loop through each shrine and check their owner foreach(Shrine shrine in player.Objectives) { if(shrine.IsCaptured() && shrine.ownerState.Equals(state)) { capturedCount++; } } // Check if we have won if(capturedCount.Equals(shrinesRequired)) { // Flag the player has captured their objectives player.isComplete = true; return true; } else { // Deactivate player winning player.isComplete = false; player.isWinner = false; } return false; }
private void PlaceSurroundingActivationPlates(int x, int y, string cinematicEvent = null, Shrine shrine = null, GameObject link = null, Item item = null) { int[] offsets = new int[] { 0, 1, 1, 0, -1, 0, 0, -1 }; int offsetsToUse = offsets.Length; for (int i = 0; i < offsetsToUse; i += 2) { int offsetX = offsets[i]; int offsetY = offsets[i + 1]; GameObject plateObj = PlaceMapPrefab("ActivationPlate", x + offsetX, y + offsetY); ActivationPlate plate = plateObj.GetComponent <ActivationPlate>(); plate.cinematicEvent = cinematicEvent; plate.shrine = shrine; plate.activationDirection = new Vector3(-offsetX, 0, offsetY); plate.item = item; if (link != null) { plate.LinkToEntity(link); } } }
void HandleShrineDeactivate(Shrine shrine) { numPoweredShrines--; if (onShrinePowerDown != null) onShrinePowerDown(shrine); }
//gets a type for the shrine private void InitialiseShrine() { details = gameController.getShrineType(); details.activeChoice = Random.Range(0, details.choices.Length); }
private void OnProtectShrineDestroy(Shrine shrine) { CurrPlayerProtectShrines[shrine.ShrineIndex].Count++; }
public void usePowerOnShrine(Shrine s, God user) { s.food += 1; s.water += 1; }
public static int GetShrineHue(Shrine shrine) { return(ShrineDef.FirstOrDefault(x => x.Shrine == shrine).Hue); }
//add a shrine public void AddShrine(Shrine s) { shrines.Add(s); }
public void usePowerOnShrine(Shrine s, God user) { s.Kill(1); user.energy += 15; }
void HandleShrinePowerDown(Shrine shrine) { if (shrine == null) return; // Get indicator if it exists RectTransform indicator; if (activeIndicators.TryGetValue(shrine, out indicator)) { // Destroy and remove from Dict so it won't get updated anymore Destroy(indicator.gameObject); activeIndicators.Remove(shrine); } }
public void usePowerOnShrine(Shrine s, God godUsingPower) { //do nothing }