public override int GetHashCode() { int hash = 1; if (Id != 0) { hash ^= Id.GetHashCode(); } if (Hp != 0) { hash ^= Hp.GetHashCode(); } if (Mp != 0) { hash ^= Mp.GetHashCode(); } if (Attack != 0) { hash ^= Attack.GetHashCode(); } if (Defend != 0) { hash ^= Defend.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public override int GetHashCode() { int hash = 1; if (Id != 0) { hash ^= Id.GetHashCode(); } if (Name.Length != 0) { hash ^= Name.GetHashCode(); } if (Hp != 0) { hash ^= Hp.GetHashCode(); } if (Attack != 0) { hash ^= Attack.GetHashCode(); } hash ^= infos_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
private void draw_leader_data(SpriteBatch sprite_batch, Vector2 offset) { sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); // Team leader // Background UnitBg.draw(sprite_batch, offset); // Labels Lv_Label.draw(sprite_batch, offset); Hp_Label.draw(sprite_batch, offset); Hp_Slash.draw(sprite_batch, offset); RatingLabel.draw(sprite_batch, offset); sprite_batch.End(); // Data Face.draw(sprite_batch, offset); sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); Leader_Name.draw(sprite_batch, offset); Lvl.draw(sprite_batch, offset); Hp.draw(sprite_batch, offset); Hp_Max.draw(sprite_batch, offset); Rating.draw(sprite_batch, offset); LeaderWeapon.draw(sprite_batch, offset); Map_Sprite.draw(sprite_batch, offset); sprite_batch.End(); }
static void Main(string[] args) { double a = 0, b = 300; int n = 1, m = 1; bool flag = true; while (flag) { string output = "\n", vih, rezult = ""; Console.Write("Введіть кількість рядків:"); n = Convert.ToInt32(Console.ReadLine()); Console.Write("Введіть кількість стоібців:"); m = Convert.ToInt32(Console.ReadLine()); double[,] arr = new double[n, m]; Hp.Gen(arr, n, m, a, b); Hp.Printer(arr, n, m, ref output); Hp.Maxpos(arr, n, m, ref rezult); Console.WriteLine(output); Console.WriteLine(rezult); Console.Write("Бажаєте повторити?(Y/N):"); vih = Console.ReadLine(); if (vih != "y" && vih != "Y") { flag = false; } } }
public void CheckLose() { Hp.Check(Times); Mood.Check(Times); Food.Check(Times); Valutes.Check(Times); }
private void Load() { foreach (string key in mobImages.Keys) { box.Children.Add(mobImages[key]); } hpTxt = new TextBlock() { Text = Hp.ToString() + "/" + HpMax.ToString(), TextAlignment = Windows.UI.Xaml.TextAlignment.Center, FontSize = 12, FontStyle = Windows.UI.Text.FontStyle.Italic }; box.Children.Add(hpTxt); Canvas.SetTop(hpTxt, -50); double prop = 0.6; Canvas.SetLeft(mobImages["armsd0"], 4 * prop); Canvas.SetTop(mobImages["armsd0"], 18 * prop); Canvas.SetLeft(mobImages["armsd1"], -21 * prop); Canvas.SetTop(mobImages["armsd1"], 49 * prop); Canvas.SetLeft(mobImages["legsd1"], 32 * prop); Canvas.SetTop(mobImages["legsd1"], 76 * prop); Canvas.SetLeft(mobImages["legsd0"], 20 * prop); Canvas.SetTop(mobImages["legsd0"], 45 * prop); Canvas.SetLeft(mobImages["body"], 8 * prop); Canvas.SetTop(mobImages["body"], -10 * prop); Canvas.SetLeft(mobImages["head"], -16 * prop); Canvas.SetTop(mobImages["head"], -34 * prop); Canvas.SetLeft(mobImages["legse1"], 64 * prop); Canvas.SetTop(mobImages["legse1"], 75 * prop); Canvas.SetLeft(mobImages["legse0"], 55 * prop); Canvas.SetTop(mobImages["legse0"], 47 * prop); Canvas.SetLeft(mobImages["armse0"], 33 * prop); Canvas.SetTop(mobImages["armse0"], 18 * prop); Canvas.SetLeft(mobImages["armse1"], 12 * prop); Canvas.SetTop(mobImages["armse1"], 50 * prop); Attacked += UpdateHpText; }//monta as imagens na box do Mob
public void LoadStatus(SaveData LoadData) { Name = new Name(LoadData.Name); Lv = new Lv(LoadData.Lv); Hp = new Hp(LoadData.MaxHp, LoadData.CurrentHp); Mp = new Mp(LoadData.MaxMp, LoadData.CurrentMp); Str = new Str(LoadData.Str); Vit = new Vit(LoadData.Vit); Dex = new Dex(LoadData.Dex); Int = new Int(LoadData.Int); Exp = new Exp(LoadData.NextExp, LoadData.CurrentExp); MoveSpeed = new MoveSpeed(3, 1); Direction = new Direction(Animator); ChargeSkill = new SwordChargeAtack(); NormalAtack = new SwordNomalAtack(); Skill = NormalAtack; Charge = GameObject.transform.Find("tame").GetComponent <Charge>(); Weapon = (GameObject)Resources.Load("prefab/Weapon/Sword"); Equip = new Equip(); Equip.Weapon(LoadData.EquipWeapon); Equip.Head(LoadData.EquipHead); Equip.Body(LoadData.EquipBody); Equip.Hand(LoadData.EquipHand); Equip.Foot(LoadData.EquipFoot); Equip.Accessory(LoadData.EquipAccessory); }
void Start() { hp = gameObject.GetComponent <Hp>(); particle = gameObject.GetComponent <ParticleSystem>(); lastScene = GameObject.Find("LastScene"); lastScene.SetActive(false); }
protected virtual void draw_hp(SpriteBatch sprite_batch, Vector2 draw_offset) { Vector2 offset = draw_vector() - draw_offset; Hp_Label.draw(sprite_batch, -(loc + offset)); Hp.draw(sprite_batch, -(loc + offset)); }
void OnChildTriggerEnter(Collider myCol) { //print ("on trigger"); if (myCol.gameObject.GetComponent <Health>()) { //print ("found helath component"); Health dealtarget = myCol.gameObject.GetComponent <Health>(); dealtarget.Damage(damage, transform); } Hp leDealTarget = null; if (myCol.GetComponent <Hp> ()) { leDealTarget = myCol.GetComponent <Hp> (); } else if (myCol.GetComponentInChildren <Hp> ()) { leDealTarget = myCol.GetComponentInChildren <Hp> (); } else if (myCol.GetComponentInParent <Hp> ()) { leDealTarget = myCol.GetComponentInParent <Hp> (); } if (leDealTarget != null) { leDealTarget.Damage((int)((float)damage * friendlyFireMultiplier)); } }
public int RollHealth() { int dice = 0; if (Hp != "0") { string[] ret = Hp.Split('(', 'd', '+', '-'); for (int i = 0; i < int.Parse(ret[1]); i++) { dice += DiceRoller.randInt(1, int.Parse((ret[2]).TrimEnd(')'))); } if (ret.Length == 4) { if (Hp.Contains("+")) { dice += int.Parse((ret[3].TrimEnd(')'))); } else if (Hp.Contains("-")) { dice -= int.Parse((ret[3].TrimEnd(')'))); } } } return(dice); }
public void UpdatePlayerInfo() { string filePath = Application.persistentDataPath + "/Player.xml"; if (File.Exists(filePath)) { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(filePath); XmlNodeList playerNodeList = xmlDoc.SelectSingleNode("Player").ChildNodes; //遍历Player结点下所有子节点 foreach (XmlElement xe in playerNodeList) { switch (xe.Name) { case "LevelLayer": xe.InnerText = LayerCount.ToString(); break; case "Hp": xe.InnerText = Hp.ToString(); break; case "ShootLevel": xe.InnerText = ShootLevel.ToString(); break; case "SpeedLevel": xe.InnerText = SpeedLevel.ToString(); break; case "BulletLevel": xe.InnerText = BulletLevel.ToString(); break; case "LightLevel": xe.InnerText = BulletLevel.ToString(); break; case "Speed": xe.InnerText = Speed.ToString(); break; case "ShootTimer": xe.InnerText = ShootTimer.ToString(); break; case "Money": xe.InnerText = Money.ToString(); break; case "SkillIcon": xe.InnerText = skillIcon.ToString(); break; } } xmlDoc.Save(filePath); } }
protected virtual void Start() { player = GetLinkedObject("player_obj"); health = GetLinkedObject("health_obj").GetComponent <Hp>(); stamina = GetLinkedObject("stamina_obj").GetComponent <Stamina>(); stamina_img = stamina.GetComponent <CompImage>(); leftamina_img = GetLinkedObject("leftamina_bar").GetComponent <CompImage>(); mana = GetLinkedObject("mana_obj").GetComponent <Mana>(); mana_img = mana.GetComponent <CompImage>(); left_mana_img = GetLinkedObject("leftmana_bar").GetComponent <CompImage>(); audio = player.GetComponent <CompAudio>(); movement = player.GetComponent <MovementController>(); anim_controller = GetComponent <CompAnimation>(); damage_feedback = player.GetComponent <DamageFeedback>(); characters_manager = player.GetComponent <CharactersManager>(); enemy_manager = GetLinkedObject("player_enemies_manager").GetComponent <EnemiesManager>(); play_breathing_audio = false; currently_playing_b_audio = false; force_audio = false; }
public List <string> MakeListToItemInfo() { List <string> list = new List <string>(); list.Add(Class); list.Add("Price " + Price.ToString()); if (Hp != 0) { list.Add("+ HP " + Hp.ToString()); } if (Attack != 0) { list.Add("+ Attack " + Attack.ToString()); } if (Defense != 0) { list.Add("+ Defense " + Defense.ToString()); } if (MoveSpeed != 0) { list.Add("+ Move Speed " + MoveSpeed.ToString()); } if (AttackSpeed != 0) { list.Add("+ Attack Speed " + AttackSpeed.ToString()); } return(list); }
private void Awake() { //barImage = transform.Find("bar").GetComponent<Image>(); barRawImage = transform.Find("barMask").Find("bar").GetComponent <RawImage>(); hp = new Hp(); }
// Start is called before the first frame update void Start() { print("test"); hpbar = gameObject.GetComponent <Slider>(); instance = this; hpbar.maxValue = _playerHp; hpbar.value = _playerHp; }
void Start() { hp = GetComponent <Hp>(); hp.OnHpChangeMinusEvent.AddListener(AttackNotification); hp.OnHpChangeMinusEvent.AddListener(AttackDebug); hp.OnHpDieEvent.AddListener(HomeDie); }
protected void Start() { Hp = new Hp(startMaxHp, 0, startMaxHp); hpManager.CurHealth = Hp; Hp.OnValueChangeToMin += Hp_OnValueChangeToMin; Hp.OnHpTaken += Hp_OnHpTaken; hpManager.Refresh(); }
public override void TakeDamage(Damage TakeDamage) { Hp.TakeDamage(TakeDamage.Physical + TakeDamage.Magic); if (!isAlive()) { Die(); } }
public override string ToString() { string s1 = string.Format("X={0}, H={1}, Hp={2}", X.Show(), H.Show(), Hp.Show()); string s2 = string.Format(", Range={0}", Tools.Show(Range)); string s3 = string.Format(", HigherSide={0}, IncludeSoln={1}", HigherSide, IncludeSoln); return(s1 + s2 + s3); }
public override void Start() { Hp hp = target.gameObject.GetComponent <Hp>(); if (hp != null) { this.hp = hp; } }
static void Main(string[] args) { Laptop hp1 = new Hp(); Laptop dell1 = new Dell(); hp1.TurnOn(); dell1.TurnOn(); }
protected void GetComponentMethod() { rg = this.GetComponent <Rigidbody>(); FlightM = this.GetComponent <ReFlightMode>(); FireBulletS = this.GetComponent <FireBullet>(); Hppoint = GameObject.Find("DEMO_GM").GetComponent <Hp>(); CrossDot = GameObject.Find("Dot").GetComponent <CrossHair>(); ForceShield = GameObject.Find("PlayerShield").GetComponent <ForceShield>(); }
void Start() { if (gameObject.name != "Player") { audioSource = GetComponent <AudioSource>(); } hp = GetComponent <Hp>(); audioSource.clip = hit; }
public Slime() { Hp.Max = 20; Hp.Set(); level = 1; feed_Exp = 10; speed = 200; damage = 2; name = new char[] "슬라임"; }
// Use this for initialization void Start() { agent = GetComponent <NavMeshAgent>(); hp = GetComponent <Hp>(); attack = GetComponent <Attack>(); agent.SetDestination(target.transform.position); hp.OnHpDieEvent.AddListener(Die); }
protected override void Awake() { base.Awake(); SetPistolVisible(false); inputActions = new InputActions(); inputActions.Player.Rotation.performed += ctx => lookPosition = ctx.ReadValue <Vector2>(); Hp = new Hp(startMaxHp, 0, startMaxHp); }
// Use this for initialization void Start() { attack = GetComponent <Attack>(); hp = GetComponent <Hp>(); target = null; mode = TowerMode.DefaultAttack; }
private void Start() { maxHp = GetComponent <MaxHp>(); hp = GetComponent <Hp>(); if (slider != null && maxHp != null && hp != null) { slider.maxValue = maxHp.GetValue(); slider.value = hp.GetValue(); } }
private void Update() { _hpText.text = Hp.ToString(); _coinsText.text = Coins.ToString(); if (Hp <= 0 && SceneManager.GetActiveScene() != SceneManager.GetSceneByBuildIndex(3)) { LoseGame(); } }
public void SetHp(Hp hp) { if (hp > MaxHp) { Debug.LogWarning("trying to set hp bigger than max value."); hp = MaxHp; } if (MaxHp == 0) { Debug.LogError("MaxHp is zero."); return; } SetBarScale((int) hp/(float) (int) MaxHp); RefreshMark(); }
public virtual void Heal(Hp val) { if (IsDead) { Debug.LogWarning("heal but dead."); return; } Hp += (int)val; }
public void SetHpForced(Hp val) { var oldHp = _hp; _hp = val; AfterHpChanged(oldHp); }
protected virtual void AfterHpChanged(Hp old) { }
/// <summary> /// Loads the scripts required for this function. /// </summary> protected void Awake() { hp = GetComponent<Hp>(); }
public Damage(Hp value) { Value = value; Element = Element.Normal; }
public Damage(Hp value, Element element) { Value = value; Element = element; }