public override void OnCast() { BaseWeapon weapon = GetWeapon(); if (weapon == null || weapon is Fists) { Caster.SendLocalizedMessage(1060179); //You must be wielding a weapon to use this ability! } else if (CheckSequence()) { var level = GetMasteryLevel(); double skill = Caster.Skills[CastSkill].Value * 1.5 + Caster.Skills[DamageSkill].Value; double duration = (skill + level * 50) * 2; Enhancement.SetValue(Caster, ExtendedWeaponAttribute.MysticWeapon, 10 + (5 * level), "MysticWeapon"); BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.MysticWeapon, 1155899, 1156055, TimeSpan.FromSeconds(duration), Caster)); Effects.SendPacket(Caster.Location, Caster.Map, new ParticleEffect(EffectType.FixedFrom, Caster.Serial, Serial.Zero, 0x3728, Caster.Location, Caster.Location, 1, 13, false, false, 1161, 0, 7, 5526, 1, Caster.Serial, 10, 0)); Effects.SendPacket(Caster.Location, Caster.Map, new ParticleEffect(EffectType.FixedFrom, Caster.Serial, Serial.Zero, 0x3779, Caster.Location, Caster.Location, 1, 15, false, false, 63, 0, 7, 0, 1, Caster.Serial, 10, 0)); weapon.AddMysticMod(Caster); weapon.InvalidateProperties(); Expires = DateTime.UtcNow + TimeSpan.FromSeconds(duration); BeginTimer(); _Weapon = weapon; } FinishSequence(); }
public void AddEnhancement(Enhancement enhancement) { this.enhancements.Add(enhancement); this.Shields += enhancement.ShieldBonus; this.Damage += enhancement.DamageBonus; this.Fuel += enhancement.FuelBonus; }
private void Awake() { settings = (MobiledgeXSettings)Resources.Load("MobiledgeXSettings", typeof(MobiledgeXSettings)); settings.sdkVersion = GetSDKVersion(); sdkVersion = settings.sdkVersion; if (PlayerSettings.iOS.locationUsageDescription.Length < 1) { SetUpLocationSettings(); } if (!editorPopUp && settings.orgName.Length < 1) { if (!EditorUtility.DisplayDialog("MobiledgeX", "Do you have MobiledgeX Account?", "Yes/Will create later", "I want to create one")) { if (EditorUtility.DisplayDialog("MobiledgeX", "How would you like to connect with us?", "Discord", "Schedule an Meeting")) { Application.OpenURL("https://discord.gg/k22WcfMFZ3"); } else { Application.OpenURL("https://developers.mobiledgex.com/getting-started"); } } else { Enhancement.SDKInstalled(getId(), Application.unityVersion); editorPopUp = true; } } }
public static void ImportComputerVisionExample() { string sdkPath = Path.GetFullPath("Packages/com.mobiledgex.sdk"); AssetDatabase.ImportPackage(Path.Combine(sdkPath, "Resources/Examples/ComputerVision.unitypackage"), true); Enhancement.CVImported(getId()); }
void btnAdd_Click(object sender, EventArgs e) { IEnhancement iEnh = new Enhancement(); frmEnhData frmEnhData = new frmEnhData(ref iEnh, DatabaseAPI.Database.Enhancements[DatabaseAPI.Database.Enhancements.Length - 1].StaticIndex + 1); int num = (int)frmEnhData.ShowDialog(); if (frmEnhData.DialogResult != DialogResult.OK) { return; } IDatabase database = DatabaseAPI.Database; IEnhancement[] enhancementArray = (IEnhancement[])Utils.CopyArray(database.Enhancements, new IEnhancement[DatabaseAPI.Database.Enhancements.Length + 1]); database.Enhancements = enhancementArray; Enhancement newEnhancement = new Enhancement(frmEnhData.myEnh) { IsNew = true }; DatabaseAPI.Database.Enhancements[DatabaseAPI.Database.Enhancements.Length - 1] = newEnhancement; if (newEnhancement.nIDSet > 0) { EnhancementSet es = DatabaseAPI.Database.EnhancementSets[newEnhancement.nIDSet]; Array.Resize(ref es.Enhancements, es.Enhancements.Length + 1); es.Enhancements[es.Enhancements.Length - 1] = newEnhancement.StaticIndex; } ImageUpdate(); AddListItem(DatabaseAPI.Database.Enhancements.Length - 1); }
public override void OnCast() { BaseWeapon weapon = GetWeapon(); if (weapon == null || weapon is Fists) { Caster.SendLocalizedMessage(1060179); //You must be wielding a weapon to use this ability! } else if (CheckSequence()) { double skill = ((Caster.Skills[CastSkill].Value * 1.5) + Caster.Skills[DamageSkill].Value); double duration = (skill + (GetMasteryLevel() * 50)) * 2; Enhancement.SetValue(Caster, ExtendedWeaponAttribute.MysticWeapon, 25, "MysticWeapon"); BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.MysticWeapon, 1155899, 1156055, TimeSpan.FromSeconds(duration), Caster)); Effects.SendLocationParticles(EffectItem.Create(Caster.Location, Caster.Map, EffectItem.DefaultDuration), 0x36CB, 1, 14, 0x55C, 7, 9915, 0); Caster.PlaySound(0x64E); weapon.AddMysticMod(Caster); weapon.InvalidateProperties(); Expires = DateTime.UtcNow + TimeSpan.FromSeconds(duration); BeginTimer(); _Weapon = weapon; } FinishSequence(); }
public ActionResult Submit() { Enhancement enhancementModel = new Enhancement(); EnhancementEditViewModel viewModel = BuildEditViewModel(null, enhancementModel); return(View(viewModel)); }
public string ToString(string itemName) { StringBuilder result = new StringBuilder(); if (Handling != Handling.NoHandling) { result.Append(Handling.ToString()); result.Append(' '); } if (Enhancement != Enhancement.NoEnhancement) { result.Append(Enhancement.ToString()); result.Append(' '); } if (Status != Status.NoStatus) { result.Append(Status.ToString()); result.Append(' '); } result.Append(itemName); if (Affiliation != Affiliation.NoAffiliation) { result.Append(" of "); result.Append(Affiliation.ToString()); } string resultString = result.ToString(); return(resultString.ToLower().ToUpperFirstChar()); }
public Enhancement Create(Enhancement enhancement) { enhancement.CreateDate = DateTime.Now; _appDbContext.Enhancements.Add(enhancement); _appDbContext.SaveChanges(); return(enhancement); }
private EnhancementSlotEntry ReadEnhancementSlotEntry() { var enhancement = new Enhancement(); if (_character.UseQualifiedNames) { enhancement.Name = _reader.ReadString(); } else { enhancement.Index = _reader.ReadInt32(); } var enhancementSlotEntry = new EnhancementSlotEntry(); enhancementSlotEntry.Enhancement = enhancement; List <sbyte> slotData; if (enhancement.Index == -1 && string.IsNullOrWhiteSpace(enhancement.Name)) { slotData = new List <sbyte>(); } else { slotData = ReadSlotData(); } enhancementSlotEntry.SlotData = slotData; return(enhancementSlotEntry); }
public override void OnCast() { BaseWeapon wep = Caster.Weapon as BaseWeapon; if (wep == null || wep != Weapon) { Caster.SendLocalizedMessage(501078); // You must be holding a weapon. } else if (IsUnderSpellEffects(Caster, Weapon)) { Caster.SendLocalizedMessage(501775); // This spell is already in effect. } else if (Weapon.Immolating || Weapon.ConsecratedContext != null) { Caster.SendLocalizedMessage(1080128); //You cannot use this ability while your weapon is enchanted. } else if (Weapon.FocusWeilder != null) { Caster.SendLocalizedMessage(1080446); // You cannot enchant an item that is under the effects of the ninjitsu focus attack ability. } else if (Weapon.WeaponAttributes.HitLightning > 0 || Weapon.WeaponAttributes.HitFireball > 0 || Weapon.WeaponAttributes.HitHarm > 0 || Weapon.WeaponAttributes.HitMagicArrow > 0 || Weapon.WeaponAttributes.HitDispel > 0) { Caster.SendLocalizedMessage(1080127); // This weapon already has a hit spell effect and cannot be enchanted. } else if (CheckSequence() && Caster.Weapon == Weapon) { Caster.PlaySound(0x64E); Caster.FixedEffect(0x36CB, 1, 9, 1915, 0); int prim = (int)Caster.Skills[CastSkill].Value; int sec = (int)Caster.Skills[DamageSkill].Value; int value = (50 * (prim + sec)) / 240; double duration = ((double)(prim + sec) / 2.0) + 30.0; int malus = 0; if (Table == null) { Table = new Dictionary <Mobile, EnchantmentTimer>(); } Enhancement.SetValue(Caster, this.Attribute, value, ModName); if (prim >= 80 && sec >= 80 && Weapon.Attributes.SpellChanneling == 0) { Enhancement.SetValue(Caster, AosAttribute.SpellChanneling, 1, ModName); Enhancement.SetValue(Caster, AosAttribute.CastSpeed, -1, ModName); malus = 1; } Table[Caster] = new EnchantmentTimer(Caster, Weapon, this.Attribute, value, malus, duration); BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.Enchant, 1080126, 1080129, TimeSpan.FromSeconds(duration), Caster, value)); Weapon.EnchantedWeilder = Caster; Weapon.InvalidateProperties(); } FinishSequence(); }
private void btnEdit_Click(object sender, EventArgs e) { if (lvEnh.SelectedIndices.Count <= 0) { return; } //Console.WriteLine(lvEnh.SelectedItems[0].SubItems[6].Text); var selectedIndex = DatabaseAPI.GetEnhancementByUIDName(lvEnh.SelectedItems[0].SubItems[5].Text); //var selectedIndex = DatabaseAPI.GetEnhancementByName(lvEnh.SelectedItems[0].SubItems[6].Text); using var frmEnhData = new frmEnhData(ref DatabaseAPI.Database.Enhancements[selectedIndex], 0); frmEnhData.ShowDialog(); if (frmEnhData.DialogResult != DialogResult.OK) { return; } var newEnhancement = new Enhancement(frmEnhData.myEnh) { IsModified = true }; DatabaseAPI.Database.Enhancements[lvEnh.SelectedIndices[0]] = newEnhancement; ImageUpdate(); UpdateListItem(selectedIndex); }
public override int GetHashCode() { unchecked { return(Bug.GetHashCode() ^ Enhancement.GetHashCode() ^ Proposal.GetHashCode() ^ Task.GetHashCode()); } }
public override void Execute(string[] commandArgs) { string type = commandArgs[1]; string shipName = commandArgs[2]; string locationName = commandArgs[3]; bool shipAlreadyExists = this.GameEngine.Starships .Any(s => s.Name == shipName); if (shipAlreadyExists) { throw new ShipException(Messages.DuplicateShipName); } var location = this.GameEngine.Galaxy.GetStarSystemByName(locationName); StarshipType shipType = (StarshipType)Enum.Parse(typeof(StarshipType), type); var ship = this.GameEngine.ShipFactory.CreateShip(shipType, shipName, location); this.GameEngine.Starships.Add(ship); for (int i = 4; i < commandArgs.Length; i++) { var enhancementType = (EnhancementType) Enum.Parse(typeof(EnhancementType), commandArgs[i]); Enhancement enhancement = this.GameEngine.EnhancementFactory.Create(enhancementType); ship.AddEnhancement(enhancement); } Console.WriteLine(Messages.CreatedShip, shipType, shipName); }
public IActionResult Index(Enhancement enh) { ViewBag.Sys_Code = enh.Enh_Sys_Code; ViewBag.Mod_Code = enh.Enh_Mod_Code; return(View(repository.Enhancements.Where(r => r.Enh_Sys_Code == enh.Enh_Sys_Code && r.Enh_Mod_Code == enh.Enh_Mod_Code))); }
public override void Execute(string[] commandArgs) { string shipType = commandArgs[1]; string shipName = commandArgs[2]; string shipLocation = commandArgs[3]; bool isShipCreatedAlready = GameEngine.Starships.Any(s => s.Name == shipName); if (isShipCreatedAlready) { throw new ShipException(Messages.DuplicateShipName); } StarshipType type = (StarshipType)Enum.Parse(typeof(StarshipType), shipType); StarSystem location = GameEngine.Galaxy.GetStarSystemByName(shipLocation); IStarship starship = GameEngine.ShipFactory.CreateShip(type, shipName, location); GameEngine.Starships.Add(starship); for (int i = 4; i < commandArgs.Length; i++) { EnhancementType enhancementType = (EnhancementType)Enum.Parse(typeof(EnhancementType), commandArgs[i]); Enhancement enhancement = GameEngine.EnhancementFactory.Create(enhancementType); starship.AddEnhancement(enhancement); } Console.WriteLine(string.Format(Messages.CreatedShip, shipType, shipName)); }
//Met à jour le nombre d'items ramassés après le débloquage d'un Enhancement private void UpdateNbObjects(Enhancement enhancement) { //Retirer Scraps/Gears/Metals utilisés de l'inventaire du héros _inventoryDetails.nbScraps -= enhancement.nbScrapsNeeded; _inventoryDetails.nbGears -= enhancement.nbGearsNeeded; _inventoryDetails.nbMetals -= enhancement.nbMetalsNeeded; }
void btnDelete_Click(object sender, EventArgs e) { if (lvEnh.SelectedIndices.Count <= 0 || Interaction.MsgBox(("Really delete enhancement: " + lvEnh.SelectedItems[0].Text + "?"), MsgBoxStyle.YesNo | MsgBoxStyle.Question, "Are you sure?") != MsgBoxResult.Yes) { return; } Enhancement[] enhancementArray = new Enhancement[DatabaseAPI.Database.Enhancements.Length - 1 + 1]; int selectedIndex = DatabaseAPI.GetEnhancementByUIDName(lvEnh.SelectedItems[0].SubItems[5].Text); int index1 = 0; int num1 = DatabaseAPI.Database.Enhancements.Length - 1; IEnhancement enh = DatabaseAPI.Database.Enhancements[selectedIndex]; if (enh.nIDSet > -1) { //Remove it from the enhancement set too. List <int> newEnhancementSet = new List <int>(); for (int i = 0; i < DatabaseAPI.Database.EnhancementSets[enh.nIDSet].Enhancements.Length; i++) { int staticIndex = DatabaseAPI.Database.EnhancementSets[enh.nIDSet].Enhancements[i]; if (staticIndex != enh.StaticIndex) { newEnhancementSet.Add(staticIndex); } } DatabaseAPI.Database.EnhancementSets[enh.nIDSet].Enhancements = newEnhancementSet.ToArray(); } for (int index2 = 0; index2 <= num1; ++index2) { if (index2 == selectedIndex) { continue; } enhancementArray[index1] = new Enhancement(DatabaseAPI.Database.Enhancements[index2]); ++index1; } DatabaseAPI.Database.Enhancements = new IEnhancement[DatabaseAPI.Database.Enhancements.Length - 2 + 1]; int num2 = DatabaseAPI.Database.Enhancements.Length - 1; for (int index2 = 0; index2 <= num2; ++index2) { DatabaseAPI.Database.Enhancements[index2] = new Enhancement(enhancementArray[index2]); } DisplayList(); if (lvEnh.Items.Count <= 0) { return; } if (lvEnh.Items.Count > selectedIndex) { lvEnh.Items[selectedIndex].Selected = true; lvEnh.Items[selectedIndex].EnsureVisible(); } else if (lvEnh.Items.Count == selectedIndex) { lvEnh.Items[selectedIndex - 1].Selected = true; lvEnh.Items[selectedIndex - 1].EnsureVisible(); } }
//Affiche "Get" button à côté de l'Enhancement si le joueur a les ingrédients nécessaires private void EnableGetButton(Enhancement enhancement, GameObject newEnhancement) { if (_inventoryDetails.nbScraps >= enhancement.nbScrapsNeeded && _inventoryDetails.nbGears >= enhancement.nbGearsNeeded && _inventoryDetails.nbMetals >= enhancement.nbMetalsNeeded) { newEnhancement.transform.Find("GetButton").gameObject.SetActive(true); newEnhancement.transform.Find("GetButton").GetComponent <Button>().onClick.AddListener(delegate { UnlockOnClick(enhancement.type); }); } }
public Enhancement MarkCompleted(Enhancement enhancement) { var dataEnhancement = GetById(enhancement.EnhancementId); dataEnhancement.CompletedDate = DateTime.Now; _appDbContext.SaveChanges(); return(enhancement); }
public void Edit(Enhancement enhancement) { var dataEnhancement = GetById(enhancement.EnhancementId); dataEnhancement.Title = enhancement.Title; dataEnhancement.Content = enhancement.Content; _appDbContext.SaveChanges(); }
public IActionResult EnhancementForm(Enhancement enh) { if (ModelState.IsValid) { repository.SaveEnhancement(enh); ModelState.Clear(); } return(RedirectToAction(nameof(EnhancementController.Index), enh)); }
object ICloneable.Clone() { var clone = (ShipInfo)MemberwiseClone(); clone.ZwEquipts = ZwEquipts.DeepCloneArray(); clone.ZwParameter = Parameter.Clone(); clone.ZwEnhancement = Enhancement.Clone(); return(clone); }
public IActionResult Edit(Enhancement enhancement) { if (!ModelState.IsValid) { return(View(enhancement)); } _enhancementRepository.Edit(enhancement); return(RedirectToAction("Index")); }
public void AddEnhancement(Enhancement enhancement) { if (enhancement == null) { throw new ArgumentNullException("Enhancement can not be null!"); } this.enhancements.Add(enhancement); this.ApplyEnhancementEffects(enhancement); }
public override void EndEffects() { BuffInfo.RemoveBuff(Caster, BuffIcon.MysticWeapon); Enhancement.RemoveMobile(Caster); _Weapon.RemoveMysticMod(); Caster.SendLocalizedMessage(1115273); // The enchantment on your weapon has expired. Caster.PlaySound(0x1ED); }
public virtual void AddEnhancement(Enhancement enhancement) { if (enhancement == null) { throw new ArgumentNullException("enhancement", "Enhansment must not be null."); } this.enhancements.Add(enhancement); this.AddEnhansmentBonus(enhancement); }
public void AddEnhancement(Enhancement enhancement) { var newEnhancementsList = this.Enhancements.ToList(); newEnhancementsList.Add(enhancement); this.Enhancements = newEnhancementsList; this.Damage += enhancement.DamageBonus; this.Shields += enhancement.ShieldBonus; this.Fuel += enhancement.FuelBonus; }
/// <summary> /// Draw the Setup Window. /// </summary> private async void SetupWindow() { EditorGUILayout.Space(); if (settings.appName == "") { settings.appName = Application.productName; } settings.orgName = EditorGUILayout.TextField("Organization Name", settings.orgName); settings.appName = EditorGUILayout.TextField("App Name", settings.appName); settings.appVers = EditorGUILayout.TextField("App Version", settings.appVers); if (settings.region.Length > 0) { try { selectedRegionIndex = regionOptions.FindIndex(region => region == settings.region); if (selectedRegionIndex == -1) { selectedRegionIndex = 0; } } catch (ArgumentNullException) { selectedRegionIndex = 0; } catch (ArgumentOutOfRangeException) { selectedRegionIndex = 0; } } EditorGUI.BeginChangeCheck(); selectedRegionIndex = EditorGUILayout.Popup("Region (Editor Only)", selectedRegionIndex, regionOptions.ToArray()); EditorGUI.EndChangeCheck(); settings.region = regionOptions[selectedRegionIndex]; EditorGUILayout.BeginVertical(headerStyle); scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.Width(300), GUILayout.Height(100)); GUILayout.Label(progressText, labelStyle); EditorGUILayout.EndScrollView(); EditorGUILayout.EndVertical(); if (GUILayout.Button("Setup")) { progressText = ""; if (await CheckCredentials()) { Enhancement.SetupStep(getId()); progressText += "\nConnected !\nSee App Information in MobiledgeXSettings!"; ShowSettings(); EditorUtility.SetDirty(settings); AddMobiledgeXPlugins(); } else { progressText += "\nError Connecting, Check the console for more details! "; } } }
public IActionResult Delete(Enhancement enh) { if (ModelState.IsValid) { repository.DeleteEnhancement(enh.Enh_Sys_Code, enh.Enh_Mod_Code, enh.Enh_Code); } return(RedirectToAction(nameof(VersionController.Index), enh)); }
public static void RemoveEnchantment(Mobile caster) { if (Table != null && Table.ContainsKey(caster)) { Table[caster].Stop(); Table[caster] = null; Table.Remove(caster); Enhancement.RemoveMobile(caster); } }
public void AddEnhancement(Enhancement enhancement) { if (enhancement == null) { throw new ArgumentNullException("Enhancement cannot be null"); } this.enhancements.Add(enhancement); this.Damage += enhancement.DamageBonus; this.Shields += enhancement.ShieldBonus; this.Fuel += enhancement.FuelBonus; }
public void AddEnhancement(Enhancement enhancement) { this.enhancements.Add(enhancement); this.ApplyEnhancement(enhancement); }
private List<PartyMember> getTargetsFromEnhancement(PartyMember target, Enhancement enhancement) { PartyBattleLayout layout = battle.GetPartyBattleLayoutForPartyMember(target); List<PartyMember> result; switch (enhancement) { case Enhancement.Piercing: List<PartyMember> list = layout.GetListWithPartyMember(target); result = new List<PartyMember>(2); result.Add(list[0]); if (list.Count > 1) result.Add(list[1]); break; case Enhancement.Relentless: result = new List<PartyMember>(layout.GetListWithPartyMember(target)); // new list isn't created in PartyBattleLayout#PartyMembersList break; case Enhancement.Explosive: result = layout.PartyMembersArea(target); break; case Enhancement.Inaccurate: const double chanceOfMiss = 0.4; result = new List<PartyMember>(1); if (Game1.Random.NextDouble() <= chanceOfMiss) { List<PartyMember> targetList = layout.GetListWithPartyMember(target); List<PartyMember> otherList = layout.RelativeList(targetList, Game1.Random.Next(1) == 0 ? 1 : -1); if (otherList != null && otherList.Count > 0) result.Add(otherList[0]); } else result.Add(target); break; default: result = new List<PartyMember>(1); result.Add(target); break; } return result; }
/// <summary> /// The add enhancement. /// </summary> /// <param name="enhancement"> /// The enhancement. /// </param> /// <exception cref="ArgumentNullException"> /// </exception> public void AddEnhancement(Enhancement enhancement) { if (enhancement == null) { throw new ArgumentNullException("Enhancement cannot be null."); } this.enhancements.Add(enhancement); this.ApplyEnhancementEffects(enhancement); }
/// <summary> /// The apply enhancement effects. /// </summary> /// <param name="enhancement"> /// The enhancement. /// </param> private void ApplyEnhancementEffects(Enhancement enhancement) { this.Shields += enhancement.ShieldBonus; this.Fuel += enhancement.FuelBonus; this.Damage += enhancement.DamageBonus; }
public EnhancementSubMenu(Enhancement enh) : base(enh.name) { this.enh = enh; }
public EnhancementSubMenu() : base("---") { this.enh = null; }