public Questor() { _lastPulse = DateTime.MinValue; _random = new Random(); _salvage = new Salvage(); _defense = new Defense(); _combat = new Combat(); _traveler = new Traveler(); _unloadLoot = new UnloadLoot(); _agentInteraction = new AgentInteraction(); _arm = new Arm(); _missionController = new MissionController(); _drones = new Drones(); _panic = new Panic(); _storyline = new Storyline(); Settings.Instance.SettingsLoaded += SettingsLoaded; // State fixed on ExecuteMission State = QuestorState.Idle; _directEve = new DirectEve(); Cache.Instance.DirectEve = _directEve; _directEve.OnFrame += OnFrame; }
protected override void Start() { base.Start(); base.SetBaseValues(15, 16000, 150, "Phalanx", SkillLevel.Level1); player = GetComponent<Player>(); defense = GetComponent<Defense>(); }
// Use this for initialization void Start() { defense = GetComponent<Defense>(); maxHealth = GetComponent<Health>().GetMaxHP(); damagePerTick = maxHealth * percentDamagePerTick; nextTick = Time.time + tickInterval; expiration = Time.time + duration; }
protected int DamageCalculationDefense(Defense DefenseType, int Amount, int DefenseIgnore) { int DamageTypeID = (int)(DefenseType); if (DamageTypeID < 0 || DamageTypeID >= Defenses.Length) { return(Amount); } // return Mathf.Max(0, Amount - Mathf.RoundToInt(Amount * Defenses[DamageTypeID])); // Defense as Percentage Reduction. // Damage: At 0: Damage Value / At 10: 0.5 Value / At 20: 0.25 Value / At 30: 0.125 Value / ... At -10: 2 Value / At -20: 4 Value / ... return(Mathf.RoundToInt(Amount * Mathf.Pow(2, (-1f * (Mathf.Max(0, Defenses[DamageTypeID] - DefenseIgnore)) / 10.0f)))); }
public void Get(DefenseLogs defenses) { try { List <string[]> results = SelectProc("GetAllDefenseGameLogs", null); Defense defense = null; DefenseGameStats gameStats = null; foreach (string[] result in results) { if (defense == null || defense.defense.abbr != result[0]) { if (defense != null) { defenses.defenseLogs.Add(defense); } defense = new Defense(); defense.gameLogs = new List <DefenseGameStats>(); defense.defense.abbr = result[0]; defense.defense.city = result[1]; defense.defense.name = result[2]; } gameStats = new DefenseGameStats(); gameStats.game.gameid = result[3]; gameStats.game.date = result[4]; gameStats.game.time = result[5]; gameStats.game.homeTeam.abbr = result[6]; gameStats.game.homeTeam.city = result[7]; gameStats.game.homeTeam.name = result[8]; gameStats.game.awayTeam.abbr = result[9]; gameStats.game.awayTeam.city = result[10]; gameStats.game.awayTeam.name = result[11]; gameStats.stats.pa = result[12]; gameStats.stats.sck = result[13]; gameStats.stats.fum = result[14]; gameStats.stats.intc = result[15]; gameStats.stats.intTd = result[16]; gameStats.stats.fumTd = result[17]; gameStats.stats.sfty = result[18]; gameStats.stats.krTd = result[19]; gameStats.stats.prTd = result[20]; gameStats.stats.fgBlk = result[21]; gameStats.stats.xpBlk = result[22]; defense.gameLogs.Add(gameStats); } } catch (Exception e) { throw new Exception(e.Message, e); } }
/// <summary> /// Updates the troop levels of the village /// </summary> /// <param name="ownForce">Your own troops home</param> /// <param name="thereForce">The total amount of troops in the village</param> /// <param name="awayForce">Your own troops in other villages</param> /// <param name="movingForce">Your own troops moving towards another village</param> public void UpdateTroops(Dictionary <UnitTypes, int> ownForce, Dictionary <UnitTypes, int> thereForce, Dictionary <UnitTypes, int> awayForce, Dictionary <UnitTypes, int> movingForce) { Defense.Clear(); foreach (UnitTypes key in awayForce.Keys) { Defense.OtherDefenses[key] = thereForce[key] - ownForce[key]; Defense.OwnTroops[key] = ownForce[key] + awayForce[key] + movingForce[key]; Defense.OutTroops[key] = awayForce[key] + movingForce[key]; } _villageDate = World.Default.Settings.ServerTime; DefenseDate = _villageDate; GuessVillageType(); }
public void BuildFactorsStrings() { Factors = Offense.ToString() + "-" + Defense.ToString(); CrippledFactors = CrippledOffense.ToString() + "-" + CrippledDefense.ToString(); if ((ShipRoles & ShipRoles.PFTender) == ShipRoles.PFTender) { Factors += 'P'; CrippledFactors += 'P'; } if (FighterFactors > 0) { Factors += '(' + FighterFactors + ')'; } if (CrippledFighterFactors > 0) { CrippledFactors += '(' + CrippledFighterFactors + ')'; } if (HeavyFighterFactors > 0) { Factors += '(' + HeavyFighterFactors + "H)"; } if (CrippledHeavyFighterFactors > 0) { CrippledFactors += '(' + CrippledHeavyFighterFactors + "H)"; } if (DroneBombardmentFactor > 0) { Factors += '<' + DroneBombardmentFactor + '>'; } if ((ShipRoles & ShipRoles.Escort) == ShipRoles.Escort) { Factors += "\u23f9"; CrippledFactors += "\u23f9"; } if ((ShipRoles & ShipRoles.Mauler) == ShipRoles.Mauler) { Factors += "\u271b"; CrippledFactors += "\u271b"; } if ((ShipRoles & ShipRoles.Survey) == ShipRoles.Survey) { Factors += "\u25c7"; } else if ((ShipRoles & ShipRoles.Scout) == ShipRoles.Scout) { Factors += "\u25c6"; } }
public override Dictionary <string, string> GetCharacterDisplayCalculationValues() { Dictionary <string, string> dictValues = new Dictionary <string, string>(); int armorCap = (int)Math.Ceiling((1402.5f * TargetLevel) - 66502.5f); float levelDifference = 0.2f * (TargetLevel - 70); dictValues.Add("Health", BasicStats.Health.ToString()); dictValues.Add("Armor", BasicStats.Armor.ToString()); dictValues.Add("Stamina", BasicStats.Stamina.ToString()); dictValues.Add("Agility", BasicStats.Agility.ToString()); dictValues.Add("Defense", Defense.ToString()); dictValues.Add("Miss", Miss.ToString() + "%"); dictValues.Add("Dodge", Dodge.ToString() + "%"); dictValues.Add("Parry", Parry.ToString() + "%"); dictValues.Add("Block", Block.ToString() + "%"); dictValues.Add("Block Value", BlockValue.ToString() + "%"); dictValues.Add("Avoidance", Avoidance.ToString() + "%"); dictValues.Add("Mitigation", Mitigation.ToString()); dictValues.Add("Spell Damage", _basicStats.SpellDamageRating.ToString()); dictValues.Add("Total Mitigation", TotalMitigation.ToString() + "%"); if (CritAvoidance == (5f + levelDifference)) { dictValues.Add("Chance to be Crit", ((5f + levelDifference) - CritAvoidance).ToString() + "%*Exactly enough defense rating/resilience to be uncrittable by bosses."); } else if (CritAvoidance < (5f + levelDifference)) { dictValues.Add("Chance to be Crit", ((5f + levelDifference) - CritAvoidance).ToString() + string.Format("%*CRITTABLE! Short by {0} defense rating or {1} resilience to be uncrittable by bosses.", Math.Ceiling(((5f + levelDifference) - CritAvoidance) * 60f), Math.Ceiling(((5f + levelDifference) - CritAvoidance) * 39.423f))); } else { dictValues.Add("Chance to be Crit", ((5f + levelDifference) - CritAvoidance).ToString() + string.Format("%*Uncrittable by bosses. {0} defense rating or {1} resilience over the crit cap.", Math.Floor(((5f + levelDifference) - CritAvoidance) * -60f), Math.Floor(((5f + levelDifference) - CritAvoidance) * -39.423f))); } dictValues.Add("Overall Points", OverallPoints.ToString()); dictValues.Add("Mitigation Points", MitigationPoints.ToString()); dictValues.Add("Survival Points", SurvivalPoints.ToString()); dictValues.Add("Overall", Math.Round(OverallTPS) + " tps"); dictValues.Add("Holy Shield", Math.Round(HolyShieldTPS) + " tps"); dictValues.Add("Seal of Right", Math.Round(SoRTPS) + " tps"); dictValues.Add("Judgement of Right", Math.Round(JoRTPS) + " tps"); dictValues.Add("Consecrate", Math.Round(ConsecrateTPS) + " tps"); dictValues.Add("Misc", Math.Round(MiscTPS) + " tps"); return(dictValues); }
public Object GetAllDefGameLogs(string team) { Defense defense = new Defense(team); DefenseGameService service = new DefenseGameService(); try { service.Get(defense); } catch (Exception e) { return(e); } return(defense); }
public Object GetDefGame(string team, string gameid) { Defense defense = new Defense(team); DefenseGameService service = new DefenseGameService(); try { service.Get(defense, gameid); } catch (Exception e) { return(e); } return(defense); }
// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Alpha1)) { CancelBuy(); Buy(DefensePrefab); } else if (Input.GetKeyDown(KeyCode.Alpha2)) { CancelBuy(); Buy(GeneratorPrefab); } else if (Input.GetKeyDown(KeyCode.Alpha3)) { CancelBuy(); } else if (Input.GetKeyDown(KeyCode.Alpha4)) { Upgrade(); } if (Input.GetMouseButtonDown(0)) { RaycastHit hitInfo = new RaycastHit(); if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hitInfo, Mathf.Infinity, LayerMask)) { if (hitInfo.transform.tag == "Case") { if (hitInfo.transform.GetComponentsInChildren <Transform>().Length == 1 && _transactionInProgress) { GetComponent <Player>().Coin -= _transactionPrefab.GetComponent <Defense>().Cost; Transform temp = Instantiate(_transactionPrefab, hitInfo.transform.position, _transactionPrefab.transform.rotation); temp.SetParent(hitInfo.transform); hitInfo.transform.GetComponent <Renderer>().material = CaseColor; CancelBuy(); } else if (hitInfo.transform.GetComponentsInChildren <Transform>().Length > 1) { CancelUpgrade(); _upgradeInProgress = true; _upgradeDefense = hitInfo.transform.GetComponentInChildren <Defense>(); _upgradeDefense.transform.parent.GetComponentInParent <Renderer>().material = HighLightColor; SetUpgradePanel(); } } } } }
/// <summary> /// Creates and returns a list of stringified state data for this Enemy. /// List begins with a header ("Enemy") in index 0, and then serializes each property in turn /// </summary> /// <returns>list of Enemy state information to be saved</returns> public override List <string> Serialize() { List <string> data = new List <string>(); data.Add("Enemy"); // "header" info data.Add(Id.ToString()); data.Add(Image); data.Add(Position.X.ToString()); data.Add(Position.Y.ToString()); data.Add(Power.ToString()); data.Add(Defense.ToString()); data.Add(Health.ToString()); data.Add(Status.ToString()); return(data); }
public static Game Create(TextIO io, IRandom random) { io.Write(Resource.Streams.Introduction); var defense = new Defense(io.ReadDefense("Your starting defense will be")); var clock = new Clock(io); io.WriteLine(); var scoreboard = new Scoreboard( new Team("Dartmouth", new HomeTeamPlay(io, random, clock, defense)), new Team(io.ReadString("Choose your opponent"), new VisitingTeamPlay(io, random, clock, defense)), io); return(new Game(clock, scoreboard, io, random)); }
// Note: DamageAmount is assumed to be positive! public virtual int InflictDamage(Defense DefenseType, Resistance DamageType, int Amount, int DefenseIgnore, int ResistanceIgnore) { int FinalAmount = DamageCalculationDefense(DefenseType, Amount, DefenseIgnore); FinalAmount = DamageCalculationResistance(DamageType, FinalAmount, ResistanceIgnore); if (CharacterRenderers.Length > 0) { StopCoroutine("PlayDamageTakenMarker"); StartCoroutine("PlayDamageTakenMarker"); } ChangeHealthCurrent(-1 * FinalAmount); return(FinalAmount); // Note: Currently returns the amount of Damage that would theoretically be inflicted, not the actual amount of health lost. }
/// <summary> /// Bolt specific use code. /// </summary> /// <param name="attacker"></param> /// <param name="skill"></param> /// <param name="target"></param> protected virtual void UseSkillOnTarget(Creature attacker, Skill skill, Creature target) { target.StopMove(); // Create actions var aAction = new AttackerAction(CombatActionType.RangeHit, attacker, skill.Info.Id, target.EntityId); aAction.Set(AttackerOptions.Result); var tAction = new TargetAction(CombatActionType.TakeHit, target, attacker, skill.Info.Id); tAction.Set(TargetOptions.Result); tAction.Stun = TargetStun; var cap = new CombatActionPack(attacker, skill.Info.Id, aAction, tAction); // Damage var damage = this.GetDamage(attacker, skill); // Reduce damage if (this.Defendable) { Defense.Handle(aAction, tAction, ref damage); } SkillHelper.HandleMagicDefenseProtection(target, ref damage); ManaShield.Handle(target, ref damage, tAction); // Deal damage if (damage > 0) { target.TakeDamage(tAction.Damage = damage, attacker); } target.Aggro(attacker); // Death/Knockback this.HandleKnockBack(attacker, target, tAction); // Override stun set by defense aAction.Stun = AttackerStun; Send.Effect(attacker, Effect.UseMagic, EffectSkillName); Send.SkillUseStun(attacker, skill.Info.Id, aAction.Stun, 1); this.BeforeHandlingPack(attacker, skill); cap.Handle(); }
public override bool Equals(object obj) { if (!(obj is Weapon)) { return(ReferenceEquals(this, obj)); } Weapon weapon = obj as Weapon; return(Name.Equals(weapon.Name) && Damage.Equals(weapon.Damage) && Defense.Equals(weapon.Defense) && BonusAttack.Equals(weapon.BonusAttack) && BonusDefense.Equals(weapon.BonusDefense) && GoalSize.Equals(weapon.GoalSize) && GoalPos.Equals(weapon.GoalPos) && TimerSpeed.Equals(weapon.TimerSpeed)); }
public Mob( string name, Health health, Level level, Defense defense, Dodge dodge, Parry parry, ArmorAmount armor) { Name = name; Health = health; Level = level; Defense = defense; Dodge = dodge; Parry = parry; Armor = armor; }
private List <Player> getSortedListOfPlayers(POSITIONS pos) { List <Player> posPlayers = new List <Player>(); foreach (Player player in players) { Defense def = player.Def; if (playsThisPosition(pos, def)) { posPlayers.Add(player); } } sortPlayers(pos, posPlayers); return(posPlayers); }
new private void Start() { base.Start(); List <IOffensiveModifier> modifiers = new List <IOffensiveModifier>(); Defense def = new Defense(0.2f, (Attackable target) => TargetingFunction.IsAlly(this, target)); Aura armorAura = new Aura(80, def); armorAura.ApplyOnTarget(this); ArmorPierce armorPiercing = new ArmorPierce(0.5f); modifiers.Add(armorPiercing); attack = new Attack(0.5f, 1.0f, 0, 1.0f, 45, modifiers, (Attackable attackable) => TargetingFunction.IsEnemy(this, attackable)); _skills = new[] { attack }; }
public Territory(TerritoryData data) { name = data.name; ID = data.ID; position = data.position; size = data.size; reputation = data.reputation; structures = data.structures.ConvertAll((structure) => Game.city.Get <Structure>(structure)); foreach (Structure structure in structures) { DependencyManager.Connect(structure, this); structure.parent = this; } traits = data.mechanics.ConvertAll((input) => Trait.Load(input)); foreach (Trait mechanic in traits) { DependencyManager.Connect(mechanic, this); mechanic.parent = this; } attack = new GameAction { name = "Attack", description = "Launch an attack on " + name, action = delegate(Context context) { attackers = new Attack(this); Game.city.activeBattlegrounds.Add(this); DependencyManager.Connect(this, attackers); DependencyManager.Flag(this); DependencyManager.TriggerAllFlags(); Inspector.InspectInNearestInspector(attackers, MainWindow.main); }, condition = (context) => attackers == null && UIFactory.EditAuthorized(this, "attack") }; defend = new GameAction { name = "Defend", description = "Mount a defense of " + name, action = delegate(Context context) { defenders = new Defense(this); DependencyManager.Connect(this, defenders); DependencyManager.Flag(this); DependencyManager.TriggerAllFlags(); Inspector.InspectInNearestInspector(defenders, MainWindow.main); }, condition = (context) => attackers != null && defenders == null && UIFactory.EditAuthorized(this, "defend") }; }
// Note: DamageAmount is assumed to be positive! public override int InflictDamage(Defense DefenseType, Resistance DamageType, int Amount, int DefenseIgnore, int ResistanceIgnore) { int FinalAmount = DamageCalculationDefense(DefenseType, Amount, DefenseIgnore); FinalAmount = DamageCalculationResistance(DamageType, FinalAmount, ResistanceIgnore); FinalAmount = FinalAmount * Mathf.FloorToInt(((GameController.Instance.GetCurrentDifficultyFactor() - 1) * DifficultyDamageTakenScaling) + 1); if (CharacterRenderers.Length > 0) { StopCoroutine("PlayDamageTakenMarker"); StartCoroutine("PlayDamageTakenMarker"); } ChangeHealthCurrent(-1 * FinalAmount); return(FinalAmount); // Note: Currently returns the amount of Damage that would theoretically be inflicted, not the actual amount of health lost. }
public void ProcessPowers(Defense defense) { ResetAttack(); CriticalHitPower = MathConts.ProcessPercentage( CriticalHit - GetCriticalResistanceDecrease(defense.CriticalHitResistance) , AttackOffensivePower ); BleedingPower = PassiveDamage - defense.GetPassiveDamageDecrease(PassiveDamage); ProcessAtkBasePower(); DoubleStrikePower = ApplyDoubleStrike(AttackBasePower); AdrenalineRushPower = ApplyAdrenalineRush(Squad.AtkPowers.HealthPower.CurrentHp, AttackBasePower + DoubleStrikePower); AttackDecrease = defense.GetAttackDecrease(AttackOffensivePower); SabotageDecrease = defense.GetSabotageDecrease(SabotageOffensivePower); ProcessAtkPower(); ProcessDefPower(); ProcessSabPower(); }
public void Get(Defense defense) { try { Dictionary <string, string> values = new Dictionary <string, string>(); values.Add("@Team", defense.defense.abbr); DefenseGameStats gameStats; List <string[]> results = SelectProc("GetDefenseGameLogs", values); defense.gameLogs = new List <DefenseGameStats>(); defense.defense.abbr = results[0][0]; defense.defense.city = results[0][1]; defense.defense.name = results[0][2]; foreach (string[] result in results) { gameStats = new DefenseGameStats(); gameStats.game.gameid = result[3]; gameStats.game.date = result[4]; gameStats.game.time = result[5]; gameStats.game.homeTeam.abbr = result[6]; gameStats.game.homeTeam.city = result[7]; gameStats.game.homeTeam.name = result[8]; gameStats.game.awayTeam.abbr = result[9]; gameStats.game.awayTeam.city = result[10]; gameStats.game.awayTeam.name = result[11]; gameStats.stats.pa = result[12]; gameStats.stats.sck = result[13]; gameStats.stats.fum = result[14]; gameStats.stats.intc = result[15]; gameStats.stats.intTd = result[16]; gameStats.stats.fumTd = result[17]; gameStats.stats.sfty = result[18]; gameStats.stats.krTd = result[19]; gameStats.stats.prTd = result[20]; gameStats.stats.fgBlk = result[21]; gameStats.stats.xpBlk = result[22]; defense.gameLogs.Add(gameStats); } } catch (Exception e) { throw new Exception(e.Message, e); } }
// Update is called once per frame public void Change(int ? id = null) { if (id == null) playerid = 0; else playerid = (int)id; Player_PF = main_process.GetPlayerObject(id); Player_Script = main_process.GetPlayerScript(id); Player_EXP = main_process.GetPlayerExperience(id); Player_Health = Player_PF.GetComponent<Health>(); Player_Mana = Player_PF.GetComponent<Mana>(); Player_Defense = Player_PF.GetComponent<Defense>(); Player_ATK = Player_Script.AttackCollider.GetComponent<DealDamage>(); //if (!Player_ATK) // Debug.Log("Cannot Get Player_ATK"); ATK.text = Player_Script.GetTotalStrength().ToString(); DEF.text = Player_Defense.defense.ToString(); STA.text = Player_Script.GetTotalStamina().ToString(); SPI.text = Player_Script.GetTotalIntelligence().ToString(); AGI.text = Player_Script.GetTotalAgility().ToString(); BATK.text = "<color=#ffffffff>" + Player_ATK.GetDamageI().ToString() + "-" + Player_ATK.GetDamageI().ToString() + "</color>"; MATK.text = "<color=#ffffffff>" + Player_ATK.GetDamageI().ToString() + "-" + Player_ATK.GetDamageI().ToString() + "</color>"; PDEF.text = Player_Defense.GetPhysicalDefense().ToString(); MDEF.text = Player_Defense.GetMagicalDefense().ToString(); //CRIR.text = (Player_ATK.GetCriticalChance()*100).ToString()+"%"; C_ICON.sprite = CI.Class_info[Player_Script.GetClassID()].icon; C_HP.text = Player_Health.GetCurrentHealth().ToString() + "/" + Player_Health.GetMaxHP().ToString(); CRIR.text = "0.00%"; C_MP.text = Player_Mana.GetMana().ToString() + "/" + Player_Mana.MaxMana.ToString(); C_LV.text = Player_EXP.GetCurrentLevel().ToString(); C_EXP.text = Player_EXP.GetExperience().ToString(); C_NEXP.text = (Player_EXP.GetNEXP()-Player_EXP.GetExperience()).ToString(); C_Name.text = Player_Script.Player_Name; weapon.sprite = CI.Class_info[Player_Script.GetClassID()].weapon[Player_Script.GetWeaponLV()].icon; amror.sprite = CI.Class_info[Player_Script.GetClassID()].armor[Player_Script.GetAmrorLV()].icon; accer.sprite = CI.Class_info[Player_Script.GetClassID()].accessory[Player_Script.GetAccessoriesLV()].icon; C_PASP.text = Player_PF.GetComponent<PassiveSkillManager>().getAvailablePoints().ToString(); select_current = 1; gem_selecting = false; passive_selecting = false; gem_system.manager = main_process.GetPlayerGemManager(playerid); }
//General code used in all methods that destroy shield public void removeShield() { if (animator) { animator.SetBool(ParameterNames.Defend, false); } usingShield = false; if (currentShield) { if (GameplayController.instance.useObjectPooling) { currentShield.destroySelf(); } else { currentShield.destroySelf(); } } currentShield = null; }
public int this[Defense defense] { get { switch (defense) { case Defense.AC: return this.ArmorClass; case Defense.Fortitude: return this.FortitudeDefense; case Defense.Reflex: return this.ReflexDefense; case Defense.Will: return this.WillDefense; default: throw new ArgumentException("defense");; } } }
protected override void Start() { base.Start(); posicionInicial = transform.position; enemigosCercanos = new List <Transform>(); // Agregar los estados de este agente, chaser ChaseBall chase = new ChaseBall(this); SearchGoal search = new SearchGoal(this); Support supp = new Support(this); Defense def = new Defense(this); Wait w = new Wait(this); fsm.AddState(ChaserStateID.ChaseBall, chase); fsm.AddState(ChaserStateID.SearchGoal, search); fsm.AddState(ChaserStateID.Support, supp); fsm.AddState(ChaserStateID.Defense, def); fsm.AddState(ChaserStateID.Wait, w); fsm.ChangeState(ChaserStateID.ChaseBall); }
// Convert this monster into JSON usable string format. public string ConvertToString() { var dict = new Dictionary <string, string> { { "Name", Name.ToString() }, { "Description", Description.ToString() }, { "Image", Image.ToString() }, { "Level", Level.ToString() }, { "Health", Health.ToString() }, { "Attack", Attack.ToString() }, { "Defense", Defense.ToString() }, { "Speed", Speed.ToString() }, { "Range", Range.ToString() }, { "Move", Move.ToString() } }; // Convert parameters to a key value pairs to a json object JObject finalContentJson = (JObject)JToken.FromObject(dict); return(finalContentJson.ToString()); }
public bool TryAddAlliance(CombatUnit alliance, EncounterSide side) { if (!ValidAlliance(alliance)) { return(false); } if (side == EncounterSide.Defense) { Defense.AddAlliance(alliance); return(true); } else if (side == EncounterSide.Offense) { Offense.AddAlliance(alliance); return(true); } return(false); }
public void AddDefense(int crystal) { Defense data = new Defense(); data.id = _defenseList.Count; data.crystal = crystal; GameObject slot = Instantiate(_defenseSlot); slot.transform.SetParent(_core._actionPointPanel.transform.Find("DefensePanel").Find("GridView")); slot.transform.localScale = new Vector3(1, 1, 1); slot.GetComponent <Image>().sprite = loadSpriteBuff.Single(s => s.name == "buff_0"); slot.transform.Find("Text").GetComponent <Text>().text = crystal + ""; data.obj = slot; if (_defenseList.Count == 5) { Destroy(_defenseList[0].obj); _defenseList.RemoveAt(0); } _defenseList.Add(data); _battleCon._battleState = _BattleState.Finish; }
public int this[Defense defense] { get { switch (defense) { case Defense.AC: return(this.ArmorClass); case Defense.Fortitude: return(this.FortitudeDefense); case Defense.Reflex: return(this.ReflexDefense); case Defense.Will: return(this.WillDefense); default: throw new ArgumentException("defense");; } } }
public 棒球帽() { EquipmentType = EquipmentCHRType.Head; Icon.Name = "icon_head"; Name = "棒球帽"; Defense = 1; Missrate = 1f; Worth = 38; string str = ""; str += "品质:" + Quality.ToString(); str += "\n"; str += "防御:" + Defense.ToString("f1"); str += "\n"; str += "闪避:" + Missrate.ToString("f1") + "%"; str += "\n"; str += "价值:" + Worth + "G"; str += "\n"; str += "\n"; str += "很漂亮的帽子。"; Description = str; }
public 粗线手套() { EquipmentType = EquipmentCHRType.Hand; Icon.Name = "icon_hand"; Name = "粗线手套"; Defense = 1; Accurate = 1f; Worth = 8; string str = ""; str += "品质:" + Quality.ToString(); str += "\n"; str += "防御:" + Defense.ToString("f1"); str += "\n"; str += "命中:" + Accurate.ToString("f1") + "%"; str += "\n"; str += "价值:" + Worth + "G"; str += "\n"; str += "\n"; str += "学校发的,\n几乎没什么用处,\n或许只有修车的\n时候才用得上。"; Description = str; }
public 登山鞋() { EquipmentType = EquipmentCHRType.Foot; Icon.Name = "icon_foot"; Name = "登山鞋"; Defense = 5; Missrate = 1.5f; Worth = 220; string str = ""; str += "品质:" + Quality.ToString(); str += "\n"; str += "防御:" + Defense.ToString("f1"); str += "\n"; str += "闪避:" + Missrate.ToString("f1") + "%"; str += "\n"; str += "价值:" + Worth + "G"; str += "\n"; str += "\n"; str += "只记得挺贵的。"; Description = str; }
public 运动裤() { EquipmentType = EquipmentCHRType.Leg; Icon.Name = "icon_leg"; Name = "运动裤"; Defense = 5; Missrate = 2.5f; Worth = 180; string str = ""; str += "品质:" + Quality.ToString(); str += "\n"; str += "防御:" + Defense.ToString("f1"); str += "\n"; str += "闪避:" + Missrate.ToString("f1") + "%"; str += "\n"; str += "价值:" + Worth + "G"; str += "\n"; str += "\n"; str += "姐姐给买的。"; Description = str; }
public Questor(QuestorfrmMain form1) { _mParent = form1; _lastQuestorPulse = DateTime.UtcNow; _defense = new Defense(); _combatMissionsBehavior = new CombatMissionsBehavior(); _combatHelperBehavior = new CombatHelperBehavior(); _dedicatedBookmarkSalvagerBehavior = new DedicatedBookmarkSalvagerBehavior(); _directionalScannerBehavior = new DirectionalScannerBehavior(); _debugHangarsBehavior = new DebugHangarsBehavior(); _miningBehavior = new MiningBehavior(); //_backgroundbehavior = new BackgroundBehavior(); _cleanup = new Cleanup(); _watch = new Stopwatch(); _innerspaceCommands = new InnerspaceCommands(); _statistics = new Statistics(); Cache.Instance.ScheduleCharacterName = Logging._character; Cache.Instance.NextStartupAction = DateTime.UtcNow; // State fixed on ExecuteMission _States.CurrentQuestorState = QuestorState.Idle; if (Cache.Instance.DirectEve == null) { Logging.Log("Startup", "Error on Loading DirectEve, maybe server is down", Logging.Orange); Cache.Instance.CloseQuestorCMDLogoff = false; Cache.Instance.CloseQuestorCMDExitGame = true; Cache.Instance.CloseQuestorEndProcess = true; Settings.Instance.AutoStart = true; Cache.Instance.ReasonToStopQuestor = "Error on Loading DirectEve, maybe server is down"; Cache.Instance.SessionState = "Quitting"; Cleanup.CloseQuestor(Cache.Instance.ReasonToStopQuestor); return; } try { if (Cache.Instance.DirectEve.HasSupportInstances()) { //Logging.Log("Questor", "You have a valid directeve.lic file and have instances available", Logging.Orange); } else { //Logging.Log("Questor", "You have 0 Support Instances available [ _directEve.HasSupportInstances() is false ]", Logging.Orange); } } catch (Exception exception) { Logging.Log("Questor", "Exception while checking: _directEve.HasSupportInstances() in questor.cs - exception was: [" + exception + "]", Logging.Orange); } Cache.Instance.StopTimeSpecified = Program.StopTimeSpecified; Cache.Instance.MaxRuntime = Program.MaxRuntime; if (Program.StartTime.AddMinutes(10) < Program.StopTime) { Cache.Instance.StopTime = Program.StopTime; Logging.Log("Questor", "Schedule: setup correctly: stoptime is [" + Cache.Instance.StopTime.ToShortTimeString() + "]", Logging.Orange); } else { Cache.Instance.StopTime = DateTime.Now.AddHours(Time.Instance.QuestorScheduleNotUsed_Hours); Logging.Log("Questor", "Schedule: NOT setup correctly: stoptime set to [" + Time.Instance.QuestorScheduleNotUsed_Hours + "] hours from now at [" + Cache.Instance.StopTime.ToShortTimeString() + "]", Logging.Orange); Logging.Log("Questor", "You can correct this by editing schedules.xml to have an entry for this toon", Logging.Orange); Logging.Log("Questor", "Ex: <char user=\"" + Settings.Instance.CharacterName + "\" pw=\"MyPasswordForEVEHere\" name=\"MyLoginNameForEVEHere\" start=\"06:45\" stop=\"08:10\" start2=\"09:05\" stop2=\"14:20\"/>", Logging.Orange); Logging.Log("Questor", "make sure each toon has its own innerspace profile and specify the following startup program line:", Logging.Orange); Logging.Log("Questor", "dotnet questor questor -x -c \"MyEVECharacterName\"", Logging.Orange); } Cache.Instance.StartTime = Program.StartTime; Cache.Instance.QuestorStarted_DateTime = DateTime.UtcNow; // get the current process Process currentProcess = System.Diagnostics.Process.GetCurrentProcess(); // get the physical mem usage Cache.Instance.TotalMegaBytesOfMemoryUsed = ((currentProcess.WorkingSet64 / 1024) / 1024); Logging.Log("Questor", "EVE instance: totalMegaBytesOfMemoryUsed - " + Cache.Instance.TotalMegaBytesOfMemoryUsed + " MB", Logging.White); Cache.Instance.SessionIskGenerated = 0; Cache.Instance.SessionLootGenerated = 0; Cache.Instance.SessionLPGenerated = 0; Settings.Instance.CharacterMode = "none"; try { Cache.Instance.DirectEve.OnFrame += EVEOnFrame; } catch (Exception ex) { Logging.Log("Questor", string.Format("DirectEVE.OnFrame: Exception {0}...", ex), Logging.White); Cache.Instance.CloseQuestorCMDLogoff = false; Cache.Instance.CloseQuestorCMDExitGame = true; Cache.Instance.CloseQuestorEndProcess = true; Settings.Instance.AutoStart = true; Cache.Instance.ReasonToStopQuestor = "Error on DirectEve.OnFrame, maybe the DirectEVE license server is down"; Cache.Instance.SessionState = "Quitting"; Cleanup.CloseQuestor(Cache.Instance.ReasonToStopQuestor); } }
// Use this for initialization void Start() { defense = GetComponent<Defense>(); multiShot = gameObject.AddComponent<MultiShot>(); Debug.Log("MultiShot starting cooldown!" + multiShot.GetCoolDown()); }
public Questor(QuestorfrmMain form1) { m_Parent = form1; _lastPulse = DateTime.Now; _defense = new Defense(); _localwatch = new LocalWatch(); _combatMissionsBehavior = new CombatMissionsBehavior(); _combatHelperBehavior = new CombatHelperBehavior(); _dedicatedBookmarkSalvagerBehavior = new DedicatedBookmarkSalvagerBehavior(); _directionalScannerBehavior = new DirectionalScannerBehavior(); _cleanup = new Cleanup(); _watch = new Stopwatch(); // State fixed on ExecuteMission _States.CurrentQuestorState = QuestorState.Idle; try { _directEve = new DirectEve(); } catch (Exception ex) { Logging.Log("Startup", "Error on Loading DirectEve, maybe server is down", Logging.orange); Logging.Log("Startup", string.Format("DirectEVE: Exception {0}...", ex), Logging.white); Cache.Instance.CloseQuestorCMDLogoff = false; Cache.Instance.CloseQuestorCMDExitGame = true; Cache.Instance.CloseQuestorEndProcess = true; Settings.Instance.AutoStart = true; Cache.Instance.ReasonToStopQuestor = "Error on Loading DirectEve, maybe lic server is down"; Cache.Instance.SessionState = "Quitting"; Cleanup.CloseQuestor(); } Cache.Instance.DirectEve = _directEve; Cache.Instance.StopTimeSpecified = Program.StopTimeSpecified; Cache.Instance.MaxRuntime = Program.MaxRuntime; if (Program.StartTime.AddMinutes(10) < Program.StopTime) { Cache.Instance.StopTime = Program.StopTime; Logging.Log("Questor", "Schedule: setup correctly: stoptime is [" + Cache.Instance.StopTime.ToShortTimeString() + "]", Logging.orange); } else { Cache.Instance.StopTime = DateTime.Now.AddHours(Time.Instance.QuestorScheduleNotUsed_Hours); Logging.Log("Questor", "Schedule: NOT setup correctly: stoptime set to [" + (int)Time.Instance.QuestorScheduleNotUsed_Hours + "] hours from now at [" + Cache.Instance.StopTime.ToShortTimeString() + "]", Logging.orange); Logging.Log("Questor", "You can correct this by editing schedules.xml to have an entry for this toon", Logging.orange); Logging.Log("Questor", "Ex: <char user=\"" + Settings.Instance.CharacterName + "\" pw=\"MyPasswordForEVEHere\" name=\"MyLoginNameForEVEHere\" start=\"06:45\" stop=\"08:10\" start2=\"09:05\" stop2=\"14:20\"/>", Logging.orange); Logging.Log("Questor", "make sure each toon has its own innerspace profile and specify the following startup program line:", Logging.orange); Logging.Log("Questor", "dotnet questor questor -x -c \"MyEVECharacterName\"", Logging.orange); } Cache.Instance.StartTime = Program.StartTime; Cache.Instance.QuestorStarted_DateTime = DateTime.Now; // get the current process Process currentProcess = System.Diagnostics.Process.GetCurrentProcess(); // get the physical mem usage Cache.Instance.TotalMegaBytesOfMemoryUsed = ((currentProcess.WorkingSet64 / 1024) / 1024); Logging.Log("Questor", "EVE instance: totalMegaBytesOfMemoryUsed - " + Cache.Instance.TotalMegaBytesOfMemoryUsed + " MB", Logging.white); Cache.Instance.SessionIskGenerated = 0; Cache.Instance.SessionLootGenerated = 0; Cache.Instance.SessionLPGenerated = 0; Settings.Instance.CharacterMode = "none"; try { _directEve.OnFrame += OnFrame; } catch (Exception ex) { Logging.Log("Startup", string.Format("DirectEVE.OnFrame: Exception {0}...", ex), Logging.white); Cache.Instance.CloseQuestorCMDLogoff = false; Cache.Instance.CloseQuestorCMDExitGame = true; Cache.Instance.CloseQuestorEndProcess = true; Settings.Instance.AutoStart = true; Cache.Instance.ReasonToStopQuestor = "Error on DirectEve.OnFrame, maybe lic server is down"; Cache.Instance.SessionState = "Quitting"; Cleanup.CloseQuestor(); } }
// Use this for initialization void Start() { defense = GetComponent<Defense>(); meteorShower = gameObject.AddComponent<MeteorShowerSkill>(); nextCast = Time.time + castInterval; }
public Questor(frmMain form1) { m_Parent = form1; _lastPulse = DateTime.MinValue; _random = new Random(); //_debugmodule = new DebugModule(); //_scoop = new Scoop(); _salvage = new Salvage(); _defense = new Defense(); _localwatch = new LocalWatch(); _scanInteraction = new ScanInteraction(); _combat = new Combat(); _traveler = new Traveler(); _unloadLoot = new UnloadLoot(); _agentInteraction = new AgentInteraction(); _arm = new Arm(); _courier = new CourierMission(); _switch = new SwitchShip(); _missionController = new MissionController(); _drones = new Drones(); _panic = new Panic(); _storyline = new Storyline(); Settings.Instance.SettingsLoaded += SettingsLoaded; // State fixed on ExecuteMission State = QuestorState.Idle; _directEve = new DirectEve(); Cache.Instance.DirectEve = _directEve; Cache.Instance.StopTimeSpecified = Program.stopTimeSpecified; Cache.Instance.MaxRuntime = Program.maxRuntime; Cache.Instance.StopTime = Program._stopTime; _questorStarted = DateTime.Now; _directEve.OnFrame += OnFrame; }
/* void Awake() { if (player == null) { player = gameObject; }else if(player != gameObject) { Destroy(gameObject); } }*/ void Start() { state = new StandingState(); attackState = new IdleAttackState(); animator = GetComponent<Animator>(); skillManager = gameObject.AddComponent<SkillManager>(); AttackCollider.SetActive(false); health = GetComponent<Health>(); controller = GetComponent<MoveController>(); crowdControllable = GetComponent<CrowdControllable>(); mana = GetComponent<Mana>(); attack = GetComponentInChildren<DealDamage>(); defense = GetComponent<Defense>(); attackController = GetComponent<AttackController>(); gravity = -(2 * jumpHeight) / Mathf.Pow(timeToJumpApex, 2); jumpVelocity = Mathf.Abs(gravity) * timeToJumpApex; audiosource = GetComponent<AudioSource>(); initialRegenTime = 6; regenTick = 2; DontDestroyOnLoad(gameObject); skill[0] = null; skill[1] = null; skill[2] = null; skill[3] = null; threatLevel = damageDealt = 0; GetComponent<ID>().setTime(false); CCI = GameObject.Find("Main Process").GetComponentInChildren<Character_Class_Info>(); si = GameObject.Find("Main Process").GetComponentInChildren<Skill_info>(); Fully_Update(); }