public override void SetStat(Define.WorldObject type, string id) { Dictionary <string, ContentsData.CharacterStat> statDict = Managers.Data.CharacterStatDict; ContentsData.CharacterStat stat = statDict[id]; Id = stat.ID; MaxHp = stat.HP; Hp = int.Parse(MaxHp.ToString()); MaxMp = stat.MP; Mp = int.Parse(MaxMp.ToString()); Attack = stat.Attack; Defense = stat.Defense; AttackSpeed = stat.AttackSpeed; MoveSpeed = stat.MoveSpeed; AttackRange = stat.AttackRange; Level = stat.Level; SubName = stat.SubName; Description = stat.Description; STR = stat.STR; AGI = stat.AGI; INT = stat.INT; Exp = stat.EXP; Gold = 1000; CurrentExp = 0; }
private void Start() { maxHp = GetComponent <MaxHp>(); if (maxHp != null) { SetValue(maxHp.GetValue()); } }
private void Start() { maxHp = GetComponent <MaxHp>(); hp = GetComponent <Hp>(); if (slider != null && maxHp != null && hp != null) { slider.maxValue = maxHp.GetValue(); slider.value = hp.GetValue(); } }
protected override void draw_text(SpriteBatch sprite_batch, Vector2 draw_offset = default(Vector2)) { draw_slash(sprite_batch, draw_offset); Vector2 loc = this.loc + draw_vector() - draw_offset; Hp.draw(sprite_batch, -(loc + TEXT_LOC - offset)); if (Gauge_Visible) { MaxHp.draw(sprite_batch, -(loc + TEXT_LOC + MAX_OFFSET - offset)); } }
public override void draw(SpriteBatch sprite_batch) { sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); Window.draw(sprite_batch); Unit_Sprite.draw(sprite_batch); Name.draw(sprite_batch); Hp_Label.draw(sprite_batch); Slash.draw(sprite_batch); Hp.draw(sprite_batch); MaxHp.draw(sprite_batch); sprite_batch.End(); }
public override int GetHashCode() { int hash = 1; if (MobId.Length != 0) { hash ^= MobId.GetHashCode(); } if (EncounterGmtId.Length != 0) { hash ^= EncounterGmtId.GetHashCode(); } if (Hp != 0L) { hash ^= Hp.GetHashCode(); } if (MaxHp != 0L) { hash ^= MaxHp.GetHashCode(); } if (Level != 0) { hash ^= Level.GetHashCode(); } if (EncounterTicket.Length != 0) { hash ^= EncounterTicket.GetHashCode(); } if (X != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(X); } if (Y != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Y); } if (activeBuffList_ != null) { hash ^= ActiveBuffList.GetHashCode(); } hash ^= rewards_.GetHashCode(); if (TimeToSpawn != 0L) { hash ^= TimeToSpawn.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public override void update() { Class.update(); Lvl.update(); Exp.update(); Hp.update(); Slash.update(); MaxHp.update(); Affinity_Icon.update(); foreach (Icon_Sprite icon in Status_Icons) { icon.update(); } }
public BattleStats GetStats() { var stats = new BattleStats(baseStats) { Atk = (decimal)Atk.GetResult(), Splash = (byte)Splash.GetResult(), Rng = (byte)Rng.GetResult(), Spd = (byte)Spd.GetResult(), Stl = (byte)Stl.GetResult(), Carry = (ushort)Carry.GetResult(), MaxHp = (decimal)MaxHp.GetResult(), NormalizedCost = baseStats.NormalizedCost }; return(stats); }
/// <summary> /// 吃药的方法 /// 使用物品后 属性改变 /// </summary> public static void ShowStatus() { AssigNature(); foreach (var equip in Save.Equiplist) { Item item = Read.GedInstance().GetItemId(equip.Id); Hp += item.hp; MaxHp += item.hp; Attack += item.atk; Speed += item.spd; } hptext.text = Hp.ToString(); maxHpText.text = MaxHp.ToString(); atkText.text = Attack.ToString(); spdText.text = Speed.ToString(); }
public override void draw(SpriteBatch sprite_batch, Vector2 draw_offset = default(Vector2)) { Vector2 loc = this.loc + draw_vector(); sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, Scissor_State); Class.draw(sprite_batch, draw_offset - loc); Lvl.draw(sprite_batch, draw_offset - loc); Exp.draw(sprite_batch, draw_offset - loc); Hp.draw(sprite_batch, draw_offset - loc); Slash.draw(sprite_batch, draw_offset - loc); MaxHp.draw(sprite_batch, draw_offset - loc); Affinity_Icon.draw(sprite_batch, draw_offset - loc); foreach (Status_Icon_Sprite icon in Status_Icons) { icon.draw(sprite_batch, draw_offset - loc); } sprite_batch.End(); }
public override void SetStat(Define.WorldObject type, string id) { Dictionary <string, ContentsData.MonsterStat> statDict = Managers.Data.MonsterStatDict; ContentsData.MonsterStat stat = statDict[id]; Id = stat.ID; MaxHp = stat.HP; Hp = int.Parse(MaxHp.ToString()); MaxMp = 0; Mp = 0; AttackRange = stat.AttackRange; AttackSpeed = stat.AttackSpeed; MoveSpeed = stat.MoveSpeed; Attack = stat.Attack; Defense = stat.Defense; Exp = stat.EXP; Gold = stat.Gold; }
public override int GetHashCode() { int hash = 1; if (Nickname.Length != 0) { hash ^= Nickname.GetHashCode(); } if (Level != 0) { hash ^= Level.GetHashCode(); } if (DistanceWalkedKm != 0F) { hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DistanceWalkedKm); } if (MaxHp != 0L) { hash ^= MaxHp.GetHashCode(); } if (AttackPower != 0L) { hash ^= AttackPower.GetHashCode(); } if (PlayerTeamId.Length != 0) { hash ^= PlayerTeamId.GetHashCode(); } if (ProfessionId.Length != 0) { hash ^= ProfessionId.GetHashCode(); } if (TitleId.Length != 0) { hash ^= TitleId.GetHashCode(); } hash ^= unlockedTitleIds_.GetHashCode(); if (ThemeId.Length != 0) { hash ^= ThemeId.GetHashCode(); } hash ^= unlockedThemeIds_.GetHashCode(); if (HouseId.Length != 0) { hash ^= HouseId.GetHashCode(); } if (wand_ != null) { hash ^= Wand.GetHashCode(); } hash ^= favoriteBadgeIds_.GetHashCode(); hash ^= unlockedBadgeIds_.GetHashCode(); hash ^= favoriteTitleIds_.GetHashCode(); if (FirstName.Length != 0) { hash ^= FirstName.GetHashCode(); } if (LastName.Length != 0) { hash ^= LastName.GetHashCode(); } if (ProfileCreationLocation.Length != 0) { hash ^= ProfileCreationLocation.GetHashCode(); } hash ^= unlockedSelfieAssetIds_.GetHashCode(); if (TotalSwishSuccessSpell != 0L) { hash ^= TotalSwishSuccessSpell.GetHashCode(); } hash ^= discoveredPotionsMasterNoteIds_.GetHashCode(); if (emailOpts_ != null) { hash ^= EmailOpts.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public override int GetHashCode() { int hash = 1; if (PlayerId != 0UL) { hash ^= PlayerId.GetHashCode(); } if (Name.Length != 0) { hash ^= Name.GetHashCode(); } if (CharacterId != 0) { hash ^= CharacterId.GetHashCode(); } if (Level != 0) { hash ^= Level.GetHashCode(); } if (Exp != 0) { hash ^= Exp.GetHashCode(); } if (Hp != 0) { hash ^= Hp.GetHashCode(); } if (MaxHp != 0) { hash ^= MaxHp.GetHashCode(); } if (Mp != 0) { hash ^= Mp.GetHashCode(); } if (MaxMp != 0) { hash ^= MaxMp.GetHashCode(); } if (Food != 0) { hash ^= Food.GetHashCode(); } if (MaxFood != 0) { hash ^= MaxFood.GetHashCode(); } if (Gold != 0) { hash ^= Gold.GetHashCode(); } if (HeadIcon != 0) { hash ^= HeadIcon.GetHashCode(); } if (MapSkillId != 0) { hash ^= MapSkillId.GetHashCode(); } if (BattleSkillId != 0) { hash ^= BattleSkillId.GetHashCode(); } hash ^= equips_.GetHashCode(); return(hash); }
public string VieToString() { return(HP.ToString() + "/" + MaxHp.ToString() + " HP"); }