// Use this for initialization void Start () { ac = this.gameObject.GetComponent<AttributeComponent>(); bc = this.gameObject.GetComponent<BoxCollider2D>(); pbc = GameObject.FindWithTag ("Projectile").GetComponent <BoxCollider2D>(); anim = (Animator)GetComponent(typeof(Animator)); meleeSys = (MeleeSystem)GetComponent(typeof(MeleeSystem)); }
public void killFigurine(AttributeComponent damageTakingPlayerAttr) { GameObject figurine = damageTakingPlayerAttr.gameObject; FindObjectOfType<ManagerSystem>().removeUnit(figurine, damageTakingPlayerAttr.team); Destroy(figurine); }
// Use this for initialization void Start () { attComp = (AttributeComponent)gameObject.GetComponent(typeof(AttributeComponent)); movement = (CharacterMovement)gameObject.GetComponent(typeof(CharacterMovement)); meleeSys = (MeleeSystem)gameObject.GetComponent(typeof(MeleeSystem)); rangedSys = (RangedSystem)GetComponent(typeof(RangedSystem)); abilitySys = (AbilitySystem)GetComponent(typeof(AbilitySystem)); }
//更新属性 public static async void UpdateAttrAsync(this AttributeComponent self) { TimerComponent timerComponent = Game.Scene.GetComponent <TimerComponent>(); long instanceId = self.InstanceId; while (true) { await timerComponent.WaitAsync(500); if (self.InstanceId != instanceId) { return; } if (self.TempAttrIntPool.Count > 0 || self.TempAttrStrPool.Count > 0) { S2C_RoleInfo send = new S2C_RoleInfo(); foreach (var item in self.TempAttrIntPool) { send.AttrInts.Add(new AttrInt() { K = (int)item.Key, V = item.Value }); } foreach (var item in self.TempAttrStrPool) { send.AttrStrs.Add(new AttrStr() { K = (int)item.Key, V = item.Value }); } //self.GetParent<Unit>().GetComponent<Model.Fishs.Components.SessionPlayerComponent>(). } } }
void OnTriggerEnter2D(Collider2D coll) { GameObject player = GameObject.Find("Player"); if (coll.gameObject.Equals(player)) { HealthSystem hs = player.GetComponent <HealthSystem>(); AttributeComponent attComp = player.GetComponent <AttributeComponent>(); if (attComp.getHealth() + healValue <= attComp.getMaxHealth()) { hs.raiseHealth(healValue); } else if (attComp.getHealth() == attComp.getMaxHealth()) { return; } else { hs.raiseHealth(attComp.getMaxHealth() - attComp.getHealth()); } Destroy(this.gameObject); } }
// Use this for initialization void Start () { PPS = (ProjectilePoolingSystem)GetComponent(typeof(ProjectilePoolingSystem)); attributes = (AttributeComponent)GetComponent(typeof(AttributeComponent)); movement = (CharacterMovement)GetComponent(typeof(CharacterMovement)); anim = (Animator)GetComponent(typeof(Animator)); shotAnimationReady = false; }
// Use this for initialization void Start() { attComp = (AttributeComponent)gameObject.GetComponent(typeof(AttributeComponent)); movement = (CharacterMovement)gameObject.GetComponent(typeof(CharacterMovement)); meleeSys = (MeleeSystem)gameObject.GetComponent(typeof(MeleeSystem)); rangedSys = (RangedSystem)GetComponent(typeof(RangedSystem)); abilitySys = (AbilitySystem)GetComponent(typeof(AbilitySystem)); }
// Use this for initialization void Start() { ac = this.gameObject.GetComponent <AttributeComponent>(); bc = this.gameObject.GetComponent <BoxCollider2D>(); pbc = GameObject.FindWithTag("Projectile").GetComponent <BoxCollider2D>(); anim = (Animator)GetComponent(typeof(Animator)); meleeSys = (MeleeSystem)GetComponent(typeof(MeleeSystem)); }
public static void GetRoleDbInfo(this AttributeComponent self, RoleDbInfo data) { data.AddAttr(AttrType.Level, self.Level); data.AddAttr(AttrType.Name, self.Name); data.AddAttr(AttrType.Exp, self.Exp); data.AddAttr(AttrType.Gold, self.Gold); data.AddAttr(AttrType.Atk, self.Atk); }
// Use this for initialization void Start() { PPS = (ProjectilePoolingSystem)GetComponent(typeof(ProjectilePoolingSystem)); attributes = (AttributeComponent)GetComponent(typeof(AttributeComponent)); movement = (CharacterMovement)GetComponent(typeof(CharacterMovement)); anim = (Animator)GetComponent(typeof(Animator)); shotAnimationReady = false; }
/// <summary> /// Creates a new <see cref="MonsterEntity"/> instance. /// </summary> /// <param name="context"></param> public MonsterEntity() { Moves = new MovableComponent(); Timers = new TimerComponent(); Follow = new FollowComponent(); Interaction = new InteractionComponent(); Battle = new BattleComponent(); Attributes = new AttributeComponent(); }
private static void InitAttrStr(this AttributeComponent self, AttrStr attr) { switch ((AttrType)attr.K) { case AttrType.Name: self.Name = attr.V; break; } }
/// <summary> /// Creates a new <see cref="NpcEntity"/> instance. /// </summary> /// <param name="context"></param> public NpcEntity() { Object.Type = WorldObjectType.Mover; Timers = new TimerComponent(); Interaction = new InteractionComponent(); Battle = new BattleComponent(); Attributes = new AttributeComponent(); Moves = new MovableComponent(); Follow = new FollowComponent(); }
// Use this for initialization void Start () { attComp = GameObject.Find("Player").GetComponent<AttributeComponent>(); AmmoPanelPrimary = GameObject.Find("AmmoPanelPrimary"); AmmoPanelSecondary = GameObject.Find("AmmoPanelSecondary"); AmmoPanelSecondary.SetActive(false); txtS.text = attComp.getAmmo() + " / " + attComp.getAmmoCap(); txtB.text = attComp.getAmmo() + " / " + attComp.getAmmoCap(); }
public void inflictGrenadeDamage(AttributeComponent damageTakingPlayerAttr) { damageTakingPlayerAttr.hp -= 20; //Zeug für Animationen anim = damageTakingPlayerAttr.gameObject.GetComponent<Animator>(); anim.SetTrigger(animId_tgetHit); if (damageTakingPlayerAttr.hp <= 0) killFigurine(damageTakingPlayerAttr); }
//Methode um anfangen shit zu schmeißen public IEnumerator throwGrenade(Cell ziel, GameObject figur, Enums.Effects effectType) { throwing_throwersAttributes = figur.GetComponent<AttributeComponent>(); InventoryComponent invent = figur.GetComponent<InventoryComponent>(); throwing_DestinationCell = ziel; int amountOfGrenades = 0; switch(effectType) { case Enums.Effects.Explosion: amountOfGrenades = invent.amountGrenades; break; case Enums.Effects.Fire: amountOfGrenades = invent.amountMolotovs; break; case Enums.Effects.Gas: amountOfGrenades = invent.amountTeargas; break; case Enums.Effects.Smoke: amountOfGrenades = invent.amountSmokes; break; } if (ziel.dij_GesamtKosten <= throwing_throwersAttributes.attackRange && amountOfGrenades > 0) { figur.GetComponentInParent<PlayerComponent>().useAP(); throw_turning = true; while(throw_turning) yield return null; //Einsatz von AP durch Faehigkeit figur.GetComponentInParent<PlayerComponent>().useAP(); throwing_effect = effectType; throwing_throwersAttributes.anim.SetTrigger("Throw"); switch (effectType) { case Enums.Effects.Explosion: invent.amountGrenades--; break; case Enums.Effects.Fire: invent.amountMolotovs--; break; case Enums.Effects.Gas: invent.amountTeargas--; break; case Enums.Effects.Smoke: invent.amountSmokes--; break; } } else { Debug.Log("OutOfRange"); } }
// Use this for initialization void Start () { attComp = GameObject.Find("Player").GetComponent<AttributeComponent>(); healthTransform = this.GetComponent<RectTransform>(); cachedY = healthTransform.localPosition.y ; maxXPos = healthTransform.localPosition.x; minXPos = healthTransform.localPosition.x - healthTransform.rect.width; maxHealth = attComp.getHealth(); currentHealth = maxHealth; visualHealth = this.GetComponent<Image>(); }
// Use this for initialization void Start () { attComp = GameObject.Find("Player").GetComponent<AttributeComponent>(); staminaTransform = this.GetComponent<RectTransform>(); cachedY = staminaTransform.localPosition.y ; maxXPos = staminaTransform.localPosition.x; minXPos = staminaTransform.localPosition.x - staminaTransform.rect.width; maxStamina = attComp.maxStamina; currentStamina = maxStamina; visualStamina = this.GetComponent<Image>(); }
// Use this for initialization void Start() { attComp = GameObject.Find("Player").GetComponent <AttributeComponent>(); AmmoPanelPrimary = GameObject.Find("AmmoPanelPrimary"); AmmoPanelSecondary = GameObject.Find("AmmoPanelSecondary"); AmmoPanelSecondary.SetActive(false); txtS.text = attComp.getAmmo() + " / " + attComp.getAmmoCap(); txtB.text = attComp.getAmmo() + " / " + attComp.getAmmoCap(); }
// Use this for initialization void Start() { attComp = GameObject.Find("Player").GetComponent <AttributeComponent>(); staminaTransform = this.GetComponent <RectTransform>(); cachedY = staminaTransform.localPosition.y; maxXPos = staminaTransform.localPosition.x; minXPos = staminaTransform.localPosition.x - staminaTransform.rect.width; maxStamina = attComp.maxStamina; currentStamina = maxStamina; visualStamina = this.GetComponent <Image>(); }
// Use this for initialization void Start() { attComp = GameObject.Find("Player").GetComponent <AttributeComponent>(); healthTransform = this.GetComponent <RectTransform>(); cachedY = healthTransform.localPosition.y; maxXPos = healthTransform.localPosition.x; minXPos = healthTransform.localPosition.x - healthTransform.rect.width; maxHealth = attComp.getHealth(); currentHealth = maxHealth; visualHealth = this.GetComponent <Image>(); }
public ComponentBase ReadComponent(Stream s, ComponentDescriptor descriptor, AttributeComponent template = null) { var objComponent = new ObjectComponent { Descriptor = descriptor }; if (descriptor.DoesObjectHaveName) { objComponent.Name = _obnameReader.ReadOBNAME(s); } return(objComponent); }
/* Generates and inflicts damage if necessary */ public void doDamage(AttributeComponent attackingPlayerAttr, PlayerComponent attackingPlayerComp, AttributeComponent damageTakingPlayerAtrr, int damageFlag) { switch(damageFlag) { case SHOOT: int damage = generateShootDamage(attackingPlayerAttr, damageTakingPlayerAtrr); inflictShootDamage(attackingPlayerAttr, attackingPlayerComp, damageTakingPlayerAtrr, damage); break; default: break; } }
/// <summary> /// Creates a new <see cref="PlayerEntity"/> instance. /// </summary> /// <param name="context"></param> public PlayerEntity(IPlayerFactory playerFactory) { Moves = new MovableComponent(); PlayerData = new PlayerDataComponent(); Taskbar = new TaskbarComponent(); Follow = new FollowComponent(); Interaction = new InteractionComponent(); Battle = new BattleComponent(); Timers = new TimerComponent(); Attributes = new AttributeComponent(); QuestDiary = new QuestDiaryComponent(); SkillTree = new SkillTreeComponent(); Inventory = new InventoryContainerComponent(); _playerFactory = playerFactory; }
/* Generates and inflicts health if necessary */ // healingPlayerAttr can be null if not needed public void doHeal(AttributeComponent healingPlayerAttr, AttributeComponent healthTakingPlayerAtrr, int healthFlag) { switch (healthFlag) { case MEDIPACK: int heal = generateMedipackHeal(); inflictMedipackHeal(healingPlayerAttr, healthTakingPlayerAtrr, heal); break; default: break; } }
// Use this for initialization void Awake () { attributes = (AttributeComponent)GetComponent(typeof(AttributeComponent)); movement = (CharacterMovement)GetComponent (typeof(CharacterMovement)); rigidBody = (Rigidbody2D)GetComponent(typeof(Rigidbody2D)); anim = (Animator)GetComponent(typeof(Animator)); idleStateExecuted = false; int enemyLayer = LayerMask.NameToLayer("Enemies"); int playerLayer = LayerMask.NameToLayer("Player"); //wenn wir spieler sind, sind gegner gegner, ansonsten is der spieler der gegner if (this.gameObject.layer == enemyLayer) opponentLayer = playerLayer; else opponentLayer = enemyLayer; }
public ComponentBase ReadComponent(Stream s, ComponentDescriptor descriptor, AttributeComponent template = null) { var setComponent = new SetComponent { Descriptor = descriptor }; if (descriptor.DoesSetHaveType) { setComponent.Type = _identReader.ReadIDENT(s); } if (descriptor.DoesSetHaveName) { setComponent.Name = _identReader.ReadIDENT(s); } return(setComponent); }
public ComponentBase ReadComponent(Stream s, ComponentDescriptor descriptor, AttributeComponent template = null) { var label = ReadAttributeLabel(s, descriptor, template); var count = ReadAttributeCount(s, descriptor, template); var representationCode = ReadAttributeRepresentationCode(s, descriptor, template); var units = ReadAttributeUnits(s, descriptor, template); var value = ReadAttributeValue(s, descriptor, representationCode, count); return(new AttributeComponent { Descriptor = descriptor, Label = label, Count = count, RepresentationCode = representationCode, Units = units, Value = value }); }
// Use this for initialization void Start() { attComp = GameObject.Find("Player").GetComponent <AttributeComponent>(); cooldown1Txt = GameObject.Find("CooldownTxt").GetComponent <Text>(); cooldown1Txt.text = ""; skill1Icon = GameObject.Find("SkillshotIcon"); skill1IconTrans = GameObject.Find("SkillshotIconTransp").GetComponent <Image>(); skill1IconTrans.enabled = false; cooldown1 = attComp.getCooldown1(); cooldown2Txt = GameObject.Find("CooldownTxt2").GetComponent <Text>(); cooldown2Txt.text = ""; skill2Icon = GameObject.Find("CloneIcon2"); skill2IconTrans = GameObject.Find("CloneIcon2Transp").GetComponent <Image>(); skill2IconTrans.enabled = false; cooldown2 = attComp.getCooldown2(); }
// Use this for initialization void Start () { attComp = GameObject.Find("Player").GetComponent<AttributeComponent>(); cooldown1Txt = GameObject.Find("CooldownTxt").GetComponent<Text>(); cooldown1Txt.text = ""; skill1Icon = GameObject.Find("SkillshotIcon"); skill1IconTrans = GameObject.Find("SkillshotIconTransp").GetComponent<Image>(); skill1IconTrans.enabled = false; cooldown1 = attComp.getCooldown1(); cooldown2Txt = GameObject.Find("CooldownTxt2").GetComponent<Text>(); cooldown2Txt.text = ""; skill2Icon = GameObject.Find("CloneIcon2"); skill2IconTrans = GameObject.Find("CloneIcon2Transp").GetComponent<Image>(); skill2IconTrans.enabled = false; cooldown2 = attComp.getCooldown2(); }
public string ReadAttributeUnits(Stream s, ComponentDescriptor descriptor, AttributeComponent template = null) { if (s == null || s.IsAtEndOfStream()) { return(null); } var unitsReader = (IUNITSReader)_valueReaderFactory.GetReader(RepresentationCode.UNITS); if (descriptor.DoesAttributeHaveUnits) { return(unitsReader.ReadUNITS(s)); } if (template == null) { return(DEFAULT_UNITS); } return(template.Units); }
public string ReadAttributeLabel(Stream s, ComponentDescriptor descriptor, AttributeComponent template = null) { if (s == null || s.IsAtEndOfStream()) { return(null); } var identReader = (IIDENTReader)_valueReaderFactory.GetReader(RepresentationCode.IDENT); if (descriptor.DoesAttributeHaveLabel) { return(identReader.ReadIDENT(s)); } if (template == null) { return(DEFAULT_LABEL); } return(template.Label); }
public uint ReadAttributeCount(Stream s, ComponentDescriptor descriptor, AttributeComponent template = null) { if (s == null || s.IsAtEndOfStream()) { return(0); } var uvariReader = (IUVARIReader)_valueReaderFactory.GetReader(RepresentationCode.UVARI); if (descriptor.DoesAttributeHaveCount) { return(uvariReader.ReadUVARI(s)); } if (template == null) { return(DEFAULT_COUNT); } return(template.Count); }
public bool shoot(GameObject attacker, GameObject target) { healthSystem = GameObject.Find("Manager").GetComponent<HealthSystem>(); currentplayerAttr = (AttributeComponent)attacker.GetComponent(typeof(AttributeComponent)); currentPlayerCell = currentplayerAttr.getCurrentCell(); currentPlayerWeapon = (WeaponComponent)currentplayerAttr.weapon.GetComponent(typeof(WeaponComponent)); if(attacker.tag == "FigurSpieler1") currentPlayerComp = GameObject.Find("Player1").GetComponent<PlayerComponent>(); else currentPlayerComp = GameObject.Find("Player2").GetComponent<PlayerComponent>(); currentTargetAttr = (AttributeComponent)target.GetComponent(typeof(AttributeComponent)); currentTargetCell = currentTargetAttr.getCurrentCell(); distanceBetweenPlayers = Vector3.Magnitude(currentTargetCell.transform.position - currentPlayerCell.transform.position); Debug.Log("Distance between players is " + distanceBetweenPlayers); if (playerCanShoot()) { float hitChance = chanceOfHittingTarget(); Debug.Log("Hitchance: " + hitChance); if (hitChance >= Random.value) { if (healthSystem == null) Debug.Log("Healthsys"); if (currentplayerAttr == null) Debug.Log("currentplayerAttr"); if (currentPlayerComp == null) Debug.Log("currentPlayerComp"); if (currentTargetAttr == null) Debug.Log("currentTargetAttr"); healthSystem.doDamage(currentplayerAttr, currentPlayerComp, currentTargetAttr, HealthSystem.SHOOT); return true; } else { return false; } } return false; }
public static void Awake(this AttributeComponent self, RoleDbInfo data) { if (data.AttrInts.Count == 0) { self.Name = "刘杰"; } else { //初始化数据 foreach (var item in data.AttrInts) { self.InitAttrInt(item); } foreach (var item in data.AttrStrs) { self.InitAttrStr(item); } } self.UpdateAttrAsync(); }
// Use this for initialization void Awake() { attributes = (AttributeComponent)GetComponent(typeof(AttributeComponent)); movement = (CharacterMovement)GetComponent(typeof(CharacterMovement)); rigidBody = (Rigidbody2D)GetComponent(typeof(Rigidbody2D)); anim = (Animator)GetComponent(typeof(Animator)); idleStateExecuted = false; int enemyLayer = LayerMask.NameToLayer("Enemies"); int playerLayer = LayerMask.NameToLayer("Player"); //wenn wir spieler sind, sind gegner gegner, ansonsten is der spieler der gegner if (this.gameObject.layer == enemyLayer) { opponentLayer = playerLayer; } else { opponentLayer = enemyLayer; } }
private static void InitAttrInt(this AttributeComponent self, AttrInt attr) { switch ((AttrType)attr.K) { case AttrType.Level: self.Level = (int)attr.V; break; case AttrType.Exp: self.Exp = attr.V; break; case AttrType.Gold: self.Gold = attr.V; break; case AttrType.Atk: self.Atk = (int)attr.V; break; } }
public void shoot(float range, bool facingRight) { this.range = range; timeLeft = range / projectileSpeed; Physics2D.IgnoreCollision((Collider2D)owner.GetComponent(typeof(Collider2D)), collid); AttributeComponent ac = (AttributeComponent)owner.GetComponent(typeof(AttributeComponent)); SpriteRenderer sr = this.GetComponent <SpriteRenderer>(); sr.sortingOrder = 2; light.enabled = true; if (s_type == Shooting_Type.NORMAL) { light.color = Color.red; projectileSpeed = 10.0f; damage = ac.getDamage(); sr.sprite = normal_shot; } else { light.color = Color.green; ac.setCooldown1Active(true); damage = ac.getDamage() * 2; projectileSpeed = 6.0f; sr.sprite = special_shot; } setDamage(damage); inAir = true; rigid.transform.position = PPS.WeaponPoint.transform.position; if (facingRight) { rigid.velocity = new Vector2(projectileSpeed, 0); } else { rigid.velocity = new Vector2(-projectileSpeed, 0); } }
public bool checkRotation(Cell targetCell, AttributeComponent playerAttr) { Cell currentCell = playerAttr.getCurrentCell(); //Richtung, in die der Pfad von currentCell zu targetCell schaut. Vector3 walkingDirection = targetCell.transform.position - currentCell.transform.position; //Aktuelle Richtung in die wir schauen Vector3 facingDirection = playerAttr.transform.forward; //Winkel zwischen unseren zwei Vektoren float angle = Vector3.Angle(walkingDirection.normalized, facingDirection); //Schaue ich schon in die passende Richtung? if (angle != 0.0f) { if (!startAngleSet) { if (Vector3.Cross(walkingDirection.normalized, facingDirection).y < 0.0f) { turningDirection = 1.0f; } else { turningDirection = -1.0f; } startAngleSet = true; } float yRotation = Mathf.Clamp(Time.deltaTime * turningSpeed * turningDirection, -angle, angle); angle += yRotation; Vector3 euler = playerAttr.transform.rotation.eulerAngles; euler.y += yRotation; playerAttr.transform.rotation = Quaternion.Euler(euler); } else startAngleSet = false; return angle == 0.0f; }
public void selectFigurine(GameObject figurine) { assist.ClearThrowPath(); assist.ClearWalkPath(); dijSys.resetDijkstra(); player = figurine; if (figurine == null) { player = null; rotationScript.setNewTarget(null); figurGewaehlt = false; } else { attr = (AttributeComponent)player.GetComponent(typeof(AttributeComponent)); movement = (MovementSystem)player.GetComponent(typeof(MovementSystem)); Cell currentCell = (Cell)attr.getCurrentCell().GetComponent(typeof(Cell)); dijSys.executeDijsktra(currentCell, attr.actMovRange, attr.items.getCurrentWeapon().weaponRange); manager.setSelectedFigurine(figurine); figurGewaehlt = true; rotationScript.setNewTarget(player); } }
public ComponentBase ReadComponent(Stream dlisStream, AttributeComponent template = null) { if (dlisStream == null || dlisStream.IsAtEndOfStream()) { return(null); } var startPosition = dlisStream.Position; var descriptor = new ComponentDescriptor(_ushortReader.ReadUSHORT(dlisStream)); var componentReader = _componentReaderFactory.GetReader(descriptor); if (componentReader == null) { throw new Exception($"no component reader found for role {descriptor.Role}"); } var component = componentReader.ReadComponent(dlisStream, descriptor, template); component.StartPosition = startPosition; return(component); }
public void OnTriggerEnter2D(Collider2D coll) { GameObject player = GameObject.Find("Player"); AttributeComponent attComp = player.GetComponent <AttributeComponent>(); if (coll.gameObject.Equals(player)) { if (attComp.getAmmo() + ammo <= attComp.getAmmoCap()) { player.GetComponent <AttributeComponent>().increaseAmmo(ammo); } else if (attComp.getAmmo() == attComp.getAmmoCap()) { return; } else { attComp.increaseAmmo(attComp.getAmmoCap() - attComp.getAmmo()); } Destroy(this.gameObject); } }
// Use this for initialization void Start () { attComp = GameObject.Find("Player").GetComponent<AttributeComponent>(); }
// Use this for initialization void Start () { attComp = GameObject.Find("Player").GetComponent<AttributeComponent>(); deathUI.SetActive(false); }
// Update is called once per frame void Update() { // welcher spieler ist am zug isPlayer1 = managerSys.getPlayerTurn(); //beschaffe aktionspunkte player1AP = player1.GetComponent<PlayerComponent>().actionPoints; player2AP = player2.GetComponent<PlayerComponent>().actionPoints; //wähle inputchannel if (isPlayer1) input = player1.GetComponent<inputSystem>(); else input = player2.GetComponent<inputSystem>(); figureUpdate(); if (managerSys.selectedFigurine != null && figureSelected == false) { figureSelected = true; activeUnit = managerSys.selectedFigurine.GetComponent<AttributeComponent>(); } if(managerSys.selectedFigurine == null) { figureSelected = false; } //beschaffe aktive einheit if (figureSelected) { activeUnit = managerSys.selectedFigurine.GetComponent<AttributeComponent>(); activeUnitSkills = activeUnit.skills; } }
public byte ReadAttributeRepresentationCode(Stream s, ComponentDescriptor descriptor, AttributeComponent template = null) { if (s == null || s.IsAtEndOfStream()) { return(0); } var ushortReader = (IUSHORTReader)_valueReaderFactory.GetReader(RepresentationCode.USHORT); if (descriptor.DoesAttributeHaveRepresentationCode) { return(ushortReader.ReadUSHORT(s)); } if (template == null) { return(DEFAULT_REP_CODE); } return(template.RepresentationCode); }
/* SHOOT related */ private int generateShootDamage(AttributeComponent attackingPlayerAttr, AttributeComponent damageTakingPlayerAtrr) { WeaponComponent attackingPlayerWeapon = attackingPlayerAttr.items.getCurrentWeapon(); int damage = attackingPlayerWeapon.damage; if (targetHasArmor(damageTakingPlayerAtrr)) { ArmorComponent currentTargetArmor = (ArmorComponent)damageTakingPlayerAtrr.armor.GetComponent(typeof(ArmorComponent)); damage -= currentTargetArmor.armorValue; } return damage; }
private void inflictShootDamage(AttributeComponent attackingPlayerAttr, PlayerComponent attackingPlayerComp, AttributeComponent damageTakingPlayerAttr, int damage) { Debug.Log("Damage taken : " + damage); damageTakingPlayerAttr.hp -= damage; attackingPlayerComp.useAP(); attackingPlayerAttr.canShoot = false; //Zeug für Animationen anim = damageTakingPlayerAttr.model.GetComponent<Animator>(); anim.SetTrigger(animId_tgetHit); if (damageTakingPlayerAttr.hp <= 0) killFigurine(damageTakingPlayerAttr); }
/* ARMOR related */ private bool targetHasArmor(AttributeComponent damageTakingPlayerAtrr) { if (damageTakingPlayerAtrr.armored) return true; return false; }
public void inflictGasDamage(AttributeComponent damageTakingPlayerAttr) { damageTakingPlayerAttr.hp -= 10; if (damageTakingPlayerAttr.hp <= 0) killFigurine(damageTakingPlayerAttr); }
public void deselect() { figureSelected = false; activeUnit = null; }
// Use this for initialization void Start() { secondsPerCell = 0.5f; dijkstra = (DijkstraSystem)FindObjectOfType(typeof(DijkstraSystem)); playerAttr = (AttributeComponent)this.gameObject.GetComponent(typeof(AttributeComponent)); startAngleSet = false; }
// Use this for initialization void Start() { attComp = GameObject.Find("Player").GetComponent <AttributeComponent>(); }
// Use this for initialization void Start() { attComp = GameObject.Find("Player").GetComponent <AttributeComponent>(); deathUI.SetActive(false); }
private void inflictMedipackHeal(AttributeComponent healingPlayerAttr, AttributeComponent healthTakingPlayerAtrr, int heal) { if(healingPlayerAttr != null) { // TO-DO: Medipack aus Inventar des Heilenden Spielers entfernen } else { // TO-DO: Medipack aus Inventar des Heilenden Spielers entfernen } healthTakingPlayerAtrr.hp += heal; }
private void figureUpdate() { //wenn einheit ausgewählt ist, markiere sie if (managerSys.selectedFigurine != null && figureSelected == false) { figureSelected = true; activeUnit = managerSys.selectedFigurine.GetComponent<AttributeComponent>(); } else if (managerSys.selectedFigurine == null) { figureSelected = false; activeUnit = null; } //beschaffe skills der aktiven einheit if (figureSelected) { activeUnit = managerSys.selectedFigurine.GetComponent<AttributeComponent>(); activeUnitSkills = activeUnit.skills; } if (Input.GetKeyDown(KeyCode.Escape)) { actionCancel(); } }