public void OnEnable() { if (!gameObject.GetComponent <Projectile>()) { technique = GetComponentInParent <PlayerScript>().attack; if (technique != null) { isAttacking = true; gripLoss = technique.gripLoss * charge; priorityPower = technique.priorityPower * GetComponentInParent <PlayerScript>().attackPower; damagePower = technique.damagePower * GetComponentInParent <PlayerScript>().attackPower *charge; knockback = technique.knockback * charge; GuardBreaking = technique.GuardBreaking * charge; flinchless = technique.flinchless; } } if (gameObject.GetComponent <Projectile>()) { ammo = GetComponent <Projectile>().ammo; if (ammo != null) { isAttacking = true; gripLoss = ammo.gripLoss * charge; priorityPower = ammo.priorityPower; damagePower = ammo.damagePower * charge; knockback = ammo.knockback; GuardBreaking = ammo.GuardBreaking; flinchless = ammo.flinchless; } } }
public void Use(GameObject user) { Enemy_AI aI = GameObject.Find("Enemy").GetComponent <Enemy_AI>(); CoolDownManager aiCDMaganger = GameObject.Find("Enemy").GetComponent <CoolDownManager>(); Skill ba = new BasicAttack(); if (user == GameObject.Find("Player") && !Skill_Handler.isBroken && skill_Handler.QSlot.cdEnd && skill_Handler.state == Skill_Handler.ButtonState.qActive) { playerShot = true; BulletDirection thisBullet = Instantiate(Bullet, firepoint.position, Quaternion.identity); thisBullet.gameObject.name = "PlayerBullet"; skill_Handler.QSlot.CoolDownCounter(CreatePlayer.chosenShip.QSkill, skill_Handler.qSkillSlot); } if (user == GameObject.Find("Enemy") && !aI.isBroken && cdEnd) { BulletDirection thisBullet = (BulletDirection)Instantiate(Bullet, firepoint.position, Quaternion.identity); thisBullet.transform.rotation = Quaternion.Euler(0, 180f, 0); thisBullet.gameObject.name = "EnemyBullet"; thisBullet.EnemyShot(); if (Circle_Move_Behaviour.enemyCircleMove) { ba.SkillCoolDown = 1; } StartCoroutine(SimpleCoolDown(CreateEnemy.EnemyShip.QSkill.SkillCoolDown)); } }
private void Start() { _playerMotor = GetComponent <PlayerMotor>(); _inputManager = GetComponent <InputManager>(); _stateManager = GetComponent <PlayerStateManager>(); _basicAttack = GetComponent <BasicAttack>(); }
public BlueViking() { this.UnitName = "BlueViking"; this.UnitQuality = 2; this.UnitPower = 30; this.UnitMaxHp = 210; this.UnitHp = UnitMaxHp; this.UnitLevel = 1; this.UnitID = "blue_viking_id"; this.UnitVelocity = 250; this.UnitImage = "blue_viking_img"; this.UnitPrefab = "blue_viking_01"; this.UnitTribe = "Viking"; BasicAttack UnitBasicAttack = new BasicAttack( "blue_viking_basic_attack_id", "blue_viking_basic_attack_name", "blue_viking_basic_attack_img", 1, UnitPower, 1, SpellType.OFFENSE, SpellTarget.ENEMY, SpellTargetZone.ONE_UNIT, SpellTargetProperty.UNIT_HP); this.spellList = new List <ISpell>() { UnitBasicAttack, }; }
public GreyBrotherViking() { this.UnitName = "GreyBrotherViking"; this.UnitQuality = 0; this.UnitPower = 21; this.UnitMaxHp = 201; this.UnitHp = UnitMaxHp; this.UnitLevel = 1; this.UnitID = "grey_brother_viking_id"; this.UnitVelocity = 151; this.UnitImage = "grey_brother_viking_img"; this.UnitPrefab = "grey_brother_viking_01"; this.UnitTribe = "Viking"; BasicAttack UnitBasicAttack = new BasicAttack( "grey_brother_viking_basic_attack_id", "grey_brother_viking_basic_attack_name", "grey_brother_viking_basic_attack_img", 1, UnitPower, 1, SpellType.OFFENSE, SpellTarget.ENEMY, SpellTargetZone.ONE_UNIT, SpellTargetProperty.UNIT_HP); this.spellList = new List <ISpell>() { UnitBasicAttack, }; }
private void Attack() { //speed is now 0 agent.speed = 0; //count down to attack timer -= Time.deltaTime; //If the timer is at 0 if (timer <= 0) { //reset the timer timer = attackspeed; //Attack if (info.cleave) { List <GameObject> targets = new List <GameObject> { }; if (info.player) { foreach (GameObject g in TeamList.teamB.ToList()) { if (Vector3.Distance(this.gameObject.transform.position, g.transform.position) < 1.5f * g.GetComponent <CharacterInfo>().size.value) { targets.Add(g); } BasicAttack.Go(this.gameObject, targets.ToList()); } } } else { BasicAttack.Go(this.gameObject, target); } } }
public void Attack(int tech) { attack = fighter.techniques[tech]; anim.Play(attack.animationName); lastComboTime = Time.time; actionCooldown = attack.recharge; }
// Called before start // Set references private new void Awake() { // Call the base's version base.Awake(); // These references are attached to foreign objects and will need to be set multiple times [allies only] SetReferences(); // These references are attached to this game object, so they will only need to be set once _grimRef = this.GetComponent <AllyGrimoire>(); if (_grimRef == null) { if (this.name != "DeadAllyStats") { Debug.Log("Could not find Grimoire attached to " + this.name); } } try { _basicAttackRef = this.GetComponent <BasicAttack>(); } catch { Debug.LogError("No Basic attack attached to " + this.name); } }
// Start is called before the first frame update void Start() { moveScript = new CharacterMovement(); punch = new BasicAttack(); rb = GetComponent <Rigidbody>(); rb.mass = playerMass; }
void Start() { tracker = GetComponent <TargetTracker>(); basicAttack = GetComponent <BasicAttack>(); seismicAttack = GetComponent <SeismicAreaAttack>(); animator = GetComponentInChildren <Animator>(); navMeshAgent = GetComponent <NavMeshAgent>(); }
protected override void init() { atks = new BasicAttack[4]; atks[0] = GetComponent <RockBulletAttack>(); atks[1] = GetComponent <BreakableRockWallAttack>(); atks[2] = GetComponent <BreakableRockPillarAttack>(); atks[3] = GetComponent <BreakableVerticalRockPillarAttack>(); }
public void Attack(Vector3 position) { Vector3 attackStart = Vector3.MoveTowards(transform.position, position, 2f); spellInstance = GameObject.Instantiate(spell, attackStart, transform.rotation) as GameObject; basicAttackInstance = spellInstance.GetComponent <BasicAttack> (); basicAttackInstance.SetTarget(position); }
float BasicAttack() { GameObject basicAttack = Instantiate(basicAttackPrefab, transform, false) as GameObject; BasicAttack ba = basicAttack.GetComponent <BasicAttack> (); ba.Init(gameObject); return(ba.cooldown); }
protected override void init() { atks = new BasicAttack[0]; //atks[0] = GetComponent<BasicRockBulletAttack>(); //atks[1] = GetComponent<>(); //atks[2] = GetComponent<>(); //atks[3] = GetComponent<>(); }
public void unAttack() { attack = null; storedProjectile = null; canMove = true; action = false; attackCharge = 0; }
// Start is called before the first frame update void Start() { anim = GetComponent <Animator> (); Movement = GetComponent <MovementController> (); Controller = GetComponent <CharacterController> (); AttackBase = GetComponent <BasicAttack> (); PlayerStatus = GetComponent <Status> (); }
public void SetBasicAttack(BasicAttack basicAttack) { if (basicAttack) { this.basicAttack = basicAttack; basicAttack.ChangeAttackSpeedCycleDuration(total, false); } }
public PurpleViking() { this.UnitName = "PurpleViking"; this.UnitQuality = 3; this.UnitPower = 35; this.UnitMaxHp = 215; this.UnitHp = UnitMaxHp; this.UnitLevel = 1; this.UnitID = "purple_viking_id"; this.UnitVelocity = 300; this.UnitImage = "purple_viking_img"; this.UnitPrefab = "purple_viking_01"; this.UnitTribe = "Viking"; BasicAttack UnitBasicAttack = new BasicAttack( "purple_viking_basic_attack_id", "purple_viking_basic_attack_name", "purple_viking_basic_attack_img", 1, UnitPower, 1, SpellType.OFFENSE, SpellTarget.ENEMY, SpellTargetZone.ONE_UNIT, SpellTargetProperty.UNIT_HP); Passive UnitPassive = new Passive( "purple_viking_passive_id", "purple_viking_passive_name", "purple_viking_passive_img", 1, 0.2f, 1, SpellType.PASSIVE, SpellTarget.ALLY, SpellTargetZone.ALL_UNITS, SpellTargetProperty.UNIT_VELOCITY); Heal UnitHeal = new Heal( "purple_viking_heal_id", "purple_viking_heal_name", "purple_viking_heal_img", 1, UnitPower, 1, SpellType.BUFF, SpellTarget.ALLY, SpellTargetZone.ONE_UNIT, SpellTargetProperty.UNIT_HP); this.spellList = new List <ISpell>() { UnitBasicAttack, UnitHeal, UnitPassive, }; }
void Awake() { rb2D = GetComponent <Rigidbody2D>(); basicAttack = GetComponentInChildren <BasicAttack>(); if (OnLandEvent == null) { OnLandEvent = new UnityEvent(); } }
void Start() { basicAttack = GetComponent <BasicAttack>(); seismicAttack = GetComponent <SeismicAreaAttack>(); targetTracker = GetComponent <TargetTracker>(); navMesh = GetComponent <NavMeshAgent>(); charAnimator = GetComponentInChildren <Animator>(); recenser = recenserObject.GetComponent <MinionRecenser>(); audioEmitter = this.GetComponent <AudioSource>(); recenser.AddMe(); }
void Start() { rb = GetComponent <Rigidbody2D>(); sr = GetComponent <SpriteRenderer>(); anim = GetComponent <Animator>(); ba = GetComponent <BasicAttack>(); currentJumps = maxJumps; xScale = gameObject.transform.localScale.x; }
public void OnTriggerExit(Collider collision) { Debug.Log("Exit"); if (collision.gameObject.tag == "AtkSpd") { BasicAttack PlayerInZone = collision.transform.GetComponent <BasicAttack>(); if (player != null) { this.gameObject.GetComponent <BasicAttack>().cooldownTime = 1f; } } }
//Choosen skill attack public void input4(BasicAttack choosenSkill) { m_herosChoice.Attacker = m_heroToManage[0].name; m_herosChoice.AttackingObject = m_heroToManage[0]; m_herosChoice.Type = "Hero"; m_herosChoice.m_choosenAttack = choosenSkill; m_magicPanel.SetActive(false); m_heroes[0].GetComponent <HeroStateMachine>().m_currentState = HeroStateMachine.TurnState.ACTION; collectActions(m_herosChoice); m_heroInput = HeroGUI.DONE; }
public C() { name = "C"; maxHP = 100; currentHP = maxHP; attack = 3; defense = 0; basicAttack = new BasicAttack(); effected = false; duration = 0; effect = Status.NONE; effective_skill = new NoSkill(); }
public RubyOnRails() { name = "Ruby On Rails"; maxHP = 150; currentHP = maxHP; attack = 20; defense = 0; basicAttack = new BasicAttack(); effected = false; duration = 0; effect = Status.NONE; effective_skill = new NoSkill(); }
public Python() { name = "Python"; maxHP = 300; currentHP = maxHP; attack = 50; defense = 0; basicAttack = new BasicAttack(); effected = false; duration = 0; effect = Status.NONE; effective_skill = new NoSkill(); }
public void Input1() //attack button. { BasicAttack attack = new BasicAttack(); // call script for a basic attack. Debug.Log("Hero attck size is:" + hero.attacks.Count); TargetSelection.Attacker = HerosToManage[0].name; TargetSelection.AttackersGameObject = HerosToManage[0]; TargetSelection.chosenAttack = attack; // TargetSelection.chosenAttack = hero.attacks[0]; TargetSelection.Type = "Hero"; AttackPanel.SetActive(false); EnemySelectPanel.SetActive(true); }
private void DoAttack() { cooldown = 1.0; BasicAttack attack = new BasicAttack(GameSession.NextID); attack.Damage = 5; PhysicsComponent physics = new PhysicsComponent(attack.Id); physics.Type = PhysicsComponent.PhysicsType.INTERSECT; physics.Hitbox = MathUtils.GetRectangleHitbox(new Vector2(0, 1), 3, 3); physics.Position = GameSession.Instance.PhysicsManager.Get(Id).Position; GameSession.Instance.PhysicsManager.Add(physics); GameSession.Instance.EntityManager.Add(attack); }
public BasicAttack GetAttack(RoamingNPC t) { if (t.nextAttack != null) { BasicAttack att = t.nextAttack; t.nextAttack = null; return(att); } if (Attacks.Count > 0) { return(Attacks[Random.Range(0, Attacks.Count)]); } return(null); }
void OnTriggerEnter2D(Collider2D other) { if (other.tag == StringManager.Tags.basicAttack) { BasicAttack basicAttack = other.GetComponent <BasicAttack>(); GameObject playerObj = basicAttack.GetOwner(); float facingDir = playerObj.GetComponent <PlayerMovement>().GetFacingDir(); switch (m_switchDetectionSide) { case SwitchDetectionSide.LEFT: if (facingDir != 1.0f) { return; } break; case SwitchDetectionSide.RIGHT: if (facingDir != -1.0f) { return; } break; } if (m_fallingTreeTrunk != null) { m_fallingTreeTrunk.StartAnimation(m_destroyMeAfterActivation, facingDir); GetComponent <BoxCollider2D>().enabled = false; } for (int i = 0; i < m_linkedObjs.Length; i++) { if (m_linkedObjs[i].tag == StringManager.Tags.door) { Door door = m_linkedObjs[i].GetComponent <Door>(); door.SwitchState(); } else { m_linkedObjs[i].SetActive(!m_linkedObjs[i].activeInHierarchy); } } if (m_fallingTreeTrunk == null && m_destroyMeAfterActivation) { Destroy(this.gameObject); } } }
public void OnTriggerStay(Collider collision) { if (collision.gameObject.tag == "AtkSpd") { if (buffZone != null) { BasicAttack PlayerInZone = collision.transform.GetComponent <BasicAttack>(); if (PlayerInZone != null) { Debug.Log("attack speed buff!"); PlayerInZone.cooldownTime = 0.5f; } } } }
public override void Init(Position startingPosition, TurnManager turnManager, TileManager tileManager, BoardEntitySelector boardEntitySelector, BattleCalculator battleCalculator, Ka ka = null) { base.Init(startingPosition, turnManager, tileManager, boardEntitySelector, battleCalculator); if (charactersprite != null) { charactersprite.transform.SetParent(FindObjectOfType <CharacterManagerMarker>().transform); } allCharacterBoardEntities.Add(this); if (enemyAIBasic1 != null) { enemyAIBasic1.Init(tileManager, this); } basicAttack = new BasicAttack(); AddSkill(basicAttack); if (charContainer != null) { charContainer.Init(this); } floatingTextGenerator = GetComponent <FloatingTextGenerator>(); this.ka = ka; if (ka != null) { ka.Init(this); if (charKaAura != null) { //charKaAura.SetActive(true); //Color newColor = new Color(ka.KaColor.r, ka.KaColor.g, ka.KaColor.b, charKaAura.GetComponent<Image>().color.a); //charKaAura.GetComponent<Image>().color = newColor; } } initalized = true; foreach (Skill skill in skills) { InitSkill(skill); } foreach (Passive passive in passives) { InitPassive(passive); } foreach (Passive p in Passives) { p.StartBattle(); } }
public void OnDisable() { if (technique != null) { technique = null; isAttacking = false; priorityPower = 0; damagePower = 0; knockback = Vector2.zero; charge = 1; } if (ammo != null) { Destroy(this); } }
public override BasicAttack Attack() { var wepDmg = 0d; if (this.Weapon != null) { wepDmg = this.Weapon.AttackPoints; } var attack = new BasicAttack(this.AttackPoints + wepDmg); if (!IsAttackKeyPressed()) { return null; } this.State = (this.State == State.Idle || this.State == State.Moving) ? (State)RandomGenerator.Randomize(2, 4) : this.State; return attack; }
public sudo() { name = "Susan Domo"; maxHP = 100; currentHP = maxHP; attack = 10; defense = 0; basicAttack = new BasicAttack (); skill1 = new NoSkill(); skill2 = new NoSkill(); skill3 = new NoSkill(); skill4 = new NoSkill(); flowMastery = 0; functionMastery = 0; datastructureMastery = 0; networkMastery = 0; effected = false; duration = 0; effect = Status.NONE; effective_skill = new NoSkill(); }
public rmdir() { name = "Raymond Dirginham"; maxHP = 100; currentHP = maxHP; attack = 15; defense = 0; basicAttack = new BasicAttack (); skill1 = new NoSkill(); skill2 = new NoSkill(); skill3 = new NoSkill(); skill4 = new NoSkill(); flowMastery = 0; functionMastery = 0; datastructureMastery = 0; networkMastery = 0; effected = false; duration = 0; effect = Status.NONE; effective_skill = new NoSkill(); }
// Awake method 初始物件的狀態與變數 void Awake() { move = GetComponent<Move>(); basicAttack = GetComponent<BasicAttack>(); }
//Called by attack animation when spear is being thrusted forward public void Attack() { if (Math.Abs(distance.x) >= Math.Abs(distance.y)) attackCollider = Instantiate(LRAttack, transform.position + new Vector3(Math.Sign(distance.x) / 2f, 0, 0), Quaternion.identity) as BasicAttack; else attackCollider = Instantiate(UDAttack, transform.position + new Vector3(0, Math.Sign(distance.y) / 2f, 0), UDAttack.transform.rotation) as BasicAttack; }
protected void moveToPosition(){ //getting next position Vector3 destination; bool hit = Physics.Linecast(transform.position, goalPosition, obstacles); if(grid == null || pathing == null || basicAttackScript == null){ grid = (Grid)GameObject.FindObjectOfType (typeof(Grid)); pathing = (PathFinding)GameObject.FindObjectOfType (typeof(PathFinding)); basicAttackScript = GetComponent<BasicAttack>(); } //check if pathfinding acutally failed if (pathing.pathFindingFailed) { //reset stopMoving(); goalPosition = transform.position; pathing.pathFindingFailed = false; return; } if(basicAttackScript.canFinishAttack()){ basicAttackScript.finishAttack(); return; } if (!hit) { destination = goalPosition; arriveScript.enabled = (steeringScript.Velocity.magnitude>=speed/2)?true:false; steeringScript.setTarget (goalPosition); } // else if(Physics.Linecast(transform.position, goalPosition, obstacles)){ // animateIdle(); // return; // } else { pathing.findPath(transform.position, goalPosition); //check if pathfinding acutally failed if (pathing.pathFindingFailed) { //reset stopMoving(); goalPosition = transform.position; pathing.pathFindingFailed = false; return; } if(previousGoal == null){ previousGoal = goalPosition; } List<Vector3> path = grid.worldFromNode(grid.path); if(path == null || grid.path == null || path.Count <= 1 || grid.path.Count <= 1){ destination = transform.position; // stopMoving(); // return; } else if (path.Count > 1) { destination = path [1];//because path[0] is where you are now, and path[1] is the immediately next step arriveScript.enabled = false; } else {//this should never happen, but its for completion. I could be wrong. but I believe if the avatar is about to approach his final destination, he should have clear sight of it destination = goalPosition; arriveScript.enabled = true; } steeringScript.setTarget (destination); } if(transform.tag != typeof(Enemy).ToString() && (ai == null || !ai.enabled) && Vector3.Distance(previousGoal, goalPosition) > 2){ previousGoal = goalPosition; if(clickedPosition == null){ clickedPosition = Instantiate (clickAnimation, goalPosition, Quaternion.Euler(180,0,0)) as GameObject; } } if (steeringScript.Velocity.magnitude > 0) { alignScript.interpolatedChangeInOrientation (steeringScript.Velocity); } if(grid.nodeFromWorld(transform.position)==grid.nodeFromWorld(goalPosition)){ stopMoving(); return; } steeringScript.steeringUpdate (); animateRun(); // networking: event listener to RPC the run anim if(playerNetworkScript != null) { playerNetworkScript.onRunTriggered(); } else { print("No fighterNetworkScript nor sorcererNetworkScript attached to player."); } //Player not moving //if(destination == goalPosition) { if(steeringScript.Velocity.magnitude==0) { moving = false; animateIdle(); if(playerNetworkScript != null) { playerNetworkScript.onIdleTriggered(); } else { print("No fighterNetworkScript nor sorcererNetworkScript attached to player."); } } }
protected void characterStart(){ //script of same GameObject initiation seekScript = GetComponent<Seek> (); arriveScript = GetComponent<Arrive> (); steeringScript = GetComponent<SteeringAgent> (); alignScript = GetComponent<Align> (); ai = GetComponent<SorcererAI>(); playerNetworkScript = GetComponent<CharacterNetworkScript>(); basicAttackScript = GetComponent<BasicAttack> (); sphere = GameObject.CreatePrimitive (PrimitiveType.Sphere); sphere.renderer.castShadows = false; sphere.renderer.receiveShadows = false; sphere.transform.parent = transform; sphere.transform.localScale = new Vector3 (1.0f, 1.0f, 1.0f); sphere.gameObject.layer = LayerMask.NameToLayer ("Minimap"); accuracy = 0.8f; attacking = false; stopMoving (); }
private void normAttack() { //animation //create box collider prefab with deal damage to player in front of boss's facing direction //same prefab as charger after charge normalAttack = Instantiate(normalAttackObject, transform.position + transform.forward / 5f, transform.rotation) as BasicAttack; norm_CD = 0; }
public override void RespondToAttack(BasicAttack attack) { if (this.ImmortalDuration > 0) { this.ImmortalDuration--; return; } attack.Hit(this); }