private void CopyData(HitboxData source, HitboxData destination) { destination.OwnerCollider = source.OwnerCollider; destination.SetKnockback = source.SetKnockback; destination.MyPriority = source.MyPriority; destination.HboxSeed = source.HboxSeed; destination.SeedModifier = source.SeedModifier; destination.BulletCenter = source.BulletCenter; destination.cStart = source.cStart; destination.cEnd = source.cEnd; destination.ownerID = source.ownerID; destination.Xflipped = source.Xflipped; destination.IsGrab = source.IsGrab; destination.effectspawn = source.effectspawn; destination.Damage = source.Damage; destination.TrueDamage = source.TrueDamage; destination.type = source.type; destination.Direction = source.Direction; destination.OptimalDI = source.OptimalDI; destination.Reversible = source.Reversible; destination.BaseKnockback = source.BaseKnockback; destination.WeightKnockback = source.WeightKnockback; destination.KnockbackGrowth = source.KnockbackGrowth; destination.effect = source.effect; destination.Hitlag = source.Hitlag; destination.HitlagDisparity = source.HitlagDisparity; destination.Blockstun = source.Blockstun; destination.ShieldPush = source.ShieldPush; destination.Hitstun = source.Hitstun; destination.HitstunScaling = source.HitstunScaling; destination.AirThreshhold = source.AirThreshhold; }
public void Save() { string path = string.Format("{0}\\PlayerHitboxdata.json", Application.streamingAssetsPath); if (File.Exists(path)) { File.Create(path); } GameObject boxes = GameObject.Find("HitBoxes"); BoxCollider2D[] col = boxes.GetComponentsInChildren <BoxCollider2D>(); foreach (BoxCollider2D c in col) { string file = string.Format("{0}\\{1}.json", Application.streamingAssetsPath, c.name); HitboxData data = new HitboxData(c.name, c.isTrigger, c.transform.localPosition, c.size); if (!File.Exists(file)) { File.Create(file); } else { string json = JsonUtility.ToJson(data, true); File.WriteAllText(string.Format("{0}\\{1}.json", Application.streamingAssetsPath, c.name), json); } } }
public void HitboxCollision() { controller.Strike.ShieldCalc(); MyHitboxData = controller.Strike.CurrentDmg; controller.state = CharacterState.SHIELDSTOP; HitStopTimer = MyHitboxData.Hitlag; ApplyShield(); }
public void HitboxCollision() { controller.Strike.ShieldCalc (); MyHitboxData = controller.Strike.CurrentDmg; controller.state = CharacterState.SHIELDSTOP; HitStopTimer = MyHitboxData.Hitlag; ApplyShield (); }
public void HitboxCollisionB() { controller.Strike.DamageCalcB(); MyHitboxData = controller.Strike.CurrentDmgB; controller.state = CharacterState.HITSTOP; HitStopTimer = MyHitboxData.Hitlag; CheckKnockback(); EffectSpawn(); }
public override void Enter() { //Check Amount of Knockback FitAnimatorStateMachine SM = (FitAnimatorStateMachine)GetStateMachine(); controller = SM.m_GameObject.GetComponent<RayCastColliders>(); MyHitboxData = controller.Strike.CurrentDmg; controller.state = CharacterState.SHIELDSTOP; controller.FitAnima.Play ("Shielding"); HitStopTimer = MyHitboxData.Hitlag; ApplyShield (); }
public void ActivateHitbox(HitboxData data) { foreach (Hitbox h in Hitboxes) { if (h.hitboxState == Hitbox.HitboxState.Closed) { h.ActivateHitbox(data); return; } } }
public override void Enter() { //Check Amount of Knockback FitAnimatorStateMachine SM = (FitAnimatorStateMachine)GetStateMachine(); controller = SM.m_GameObject.GetComponent <RayCastColliders>(); MyHitboxData = controller.Strike.CurrentDmg; controller.state = CharacterState.SHIELDSTOP; controller.FitAnima.Play("Shielding"); HitStopTimer = MyHitboxData.Hitlag; ApplyShield(); }
void ApplyHitbox(HitboxData hitbox) { if (!DamageHitboxes.Contains(hitbox.HboxSeed)) { if (CurrentDmg.MyPriority <= hitbox.MyPriority) { HitboxData hitboxData = hitbox; CurrentDmg = hitboxData; ApplyHitboxFrame = true; } } }
void ApplyProjectile(HitboxData proj) { if (!DamageHitboxes.Contains(proj.HboxSeed)) { if (CurrentDmg.MyPriority <= proj.MyPriority) { HitboxData hitboxData = proj; CurrentDmg = hitboxData; ApplyProjFrame = true; } } }
static public int GetFramesOfHitLag(HitboxData hitboxData) { int result = (int)hitboxData.damage / 8; if (result >= 10) { return(10); } else if (result <= 3) { return(3); } return(result); }
public override void Enter() { //Check Amount of Knockback FitAnimatorStateMachine SM = (FitAnimatorStateMachine)GetStateMachine(); controller = SM.m_GameObject.GetComponent<RayCastColliders>(); MyHitboxData = controller.Strike.CurrentDmg; controller.state = CharacterState.HITSTOP; HitStopTimer = MyHitboxData.Hitlag; CheckKnockback (); if (MyHitboxData.effect != null) { EffectSpawn (); } }
public override void Enter() { //Check Amount of Knockback FitAnimatorStateMachine SM = (FitAnimatorStateMachine)GetStateMachine(); controller = SM.m_GameObject.GetComponent <RayCastColliders>(); MyHitboxData = controller.Strike.CurrentDmg; controller.state = CharacterState.HITSTOP; HitStopTimer = MyHitboxData.Hitlag; CheckKnockback(); if (MyHitboxData.effect != null) { EffectSpawn(); } }
public void Load() { BoxCollider2D[] hitboxes = GameObject.Find("HitBoxes").GetComponentsInChildren <BoxCollider2D>(); foreach (BoxCollider2D c in hitboxes) { HitboxData h = new HitboxData(null, false, Vector3.zero, Vector2.zero); string file = string.Format("{0}\\{1}.json", Application.streamingAssetsPath, c.name); string json = ReadFile(file); JsonUtility.FromJsonOverwrite(json, h); c.transform.localPosition = h.position; c.name = h.name; c.isTrigger = h.IsTrgger; c.size = h.Size; } }
public override void Enter() { //Check Amount of Knockback FitAnimatorStateMachine SM = (FitAnimatorStateMachine)GetStateMachine(); controller = SM.m_GameObject.GetComponent<RayCastColliders>(); MyHitboxData = controller.Strike.CurrentDmg; controller.state = CharacterState.THROWN; HitStopTimer = MyHitboxData.Hitlag; CheckKnockback (); if (MyHitboxData.effect != null) { EffectSpawn (); } controller.GrabOpponent.GrabOpponent = null; controller.GrabOpponent = null; controller.transform.position = new Vector3 (controller.transform.position.x, controller.transform.position.y, 0); }
public override void Enter() { //Check Amount of Knockback FitAnimatorStateMachine SM = (FitAnimatorStateMachine)GetStateMachine(); controller = SM.m_GameObject.GetComponent <RayCastColliders>(); MyHitboxData = controller.Strike.CurrentDmg; controller.state = CharacterState.THROWN; HitStopTimer = MyHitboxData.Hitlag; CheckKnockback(); if (MyHitboxData.effect != null) { EffectSpawn(); } controller.GrabOpponent.GrabOpponent = null; controller.GrabOpponent = null; controller.transform.position = new Vector3(controller.transform.position.x, controller.transform.position.y, 0); }
// void OnTriggerEnter(Collider c) { // if (c.gameObject.layer == 20) { // Debug.Log ("Colliding Hurtboxes"); // FitStrike enemy = c.GetComponentInParent<FitStrike> (); // if (enemy.MyId != MyOwnerId) // { // if (OwnerStrike != null) // { // MyHbox = OwnerStrike.AttackBoxes [(int)AttackQueue]; // HitboxSeed = OwnerStrike.HitComboSeed; // } // HitboxData hitboxData = MyHbox.hitboxData; // hitboxData.ownerID = MyOwnerId; // hitboxData.HboxSeed = HitboxSeed; // enemy.SendMessage("ApplyHitbox", hitboxData, SendMessageOptions.DontRequireReceiver); // send damage object to target // } // } // } public virtual void OnTriggerDouble(Collider c) { if (c.gameObject.layer == 20) { FitStrike enemy = c.GetComponentInParent <FitStrike> (); if (enemy.MyId != MyOwnerId) { if (OwnerStrike != null) { MyHbox = OwnerStrike.AttackBoxes [(int)AttackQueue]; HitboxSeed = OwnerStrike.HitComboSeed; HitboxData hitboxData = MyHbox.hitboxData; hitboxData.ownerID = MyOwnerId; HitboxSeed += hitboxData.SeedModifier; hitboxData.HboxSeed = HitboxSeed; hitboxData.OwnerCollider = OwnerStrike.controller; //Raycast // RaycastHit spark; // Vector3 fwd = (c.transform.position - transform.position).normalized; // Physics.Raycast (transform.position, fwd, out spark, Size, 1 << 20); // if (spark.point == Vector3.zero) { // hitboxData.effectspawn = c.transform.position; // } else { // hitboxData.effectspawn = spark.point; // } hitboxData.effectspawn = transform.position + (Size * (c.transform.position - transform.position).normalized); if (OwnerStrike.HitComboSeed < HitboxSeed) { OwnerStrike.HitComboSeed = HitboxSeed; } enemy.SendMessage("ApplyHitbox", hitboxData, SendMessageOptions.DontRequireReceiver); // send damage object to target } } } }
public override void LoadContent() { base.LoadContent(); Tile = new LevelTiler(); hitboxData = Engine.Instance.Content.Load <HitboxData>("SOMETHING"); levelData = Engine.Instance.Content.Load <LevelData>("level"); Tile.LoadContent(levelData); collisionInfoSolid = LevelTiler.TileConverison(Tile.CollisionLayer, 2); tilesSolid = new LevelTilesSolid(collisionInfoSolid); this.Add(tilesSolid); collisionInfoEmpty = LevelTiler.TileConverison(Tile.CollisionLayer, 0); tilesEmpty = new LevelTilesEmpty(collisionInfoEmpty); this.Add(tilesEmpty); player = new Player(new Vector2(100, 100)); this.Add(player); player.Added(this); }
public void HitboxCollisionB() { controller.Strike.DamageCalcB (); MyHitboxData = controller.Strike.CurrentDmgB; controller.state = CharacterState.HITSTOP; HitStopTimer = MyHitboxData.Hitlag; CheckKnockback (); EffectSpawn (); }
public Player(Vector2 position) : base(position) { this.Tag((int)GameTags.Player); this.Collider = new Hitbox((float)32.0f, (float)32.0f, -16.0f, -6.0f); this.Visible = true; sprite = new AnimationPlayer(); playerTexture = Engine.Instance.Content.Load <Texture2D>("Player/Idle"); healthTexture = Engine.Instance.Content.Load <Texture2D>("Player/Healthpoint"); bulletPointTexture = Engine.Instance.Content.Load <Texture2D>("Player/bulletPoint"); idleAnimation = new AnimationData(Engine.Instance.Content.Load <Texture2D>("Player/Idle"), 200, 96, true); runAnimation = new AnimationData(Engine.Instance.Content.Load <Texture2D>("Player/Run"), 75, 96, true); jumpAnimation = new AnimationData(Engine.Instance.Content.Load <Texture2D>("Player/Jump"), 200, 96, true); fallAnimation = new AnimationData(Engine.Instance.Content.Load <Texture2D>("Player/Fall"), 200, 96, true); groundAttack1 = Engine.Instance.Content.Load <HitboxData>("Player/Combo1Box"); groundAttack2 = Engine.Instance.Content.Load <HitboxData>("Player/Combo2Box"); groundAttack3 = Engine.Instance.Content.Load <HitboxData>("Player/Combo3Box"); parryBox = Engine.Instance.Content.Load <HitboxData>("Player/ParryBox"); attack1Animation = new AnimationData(Engine.Instance.Content.Load <Texture2D>("Player/Combo1"), 50, 96, false, groundAttack1); attack2Animation = new AnimationData(Engine.Instance.Content.Load <Texture2D>("Player/Combo2"), 50, 96, false, groundAttack2); attack3Animation = new AnimationData(Engine.Instance.Content.Load <Texture2D>("Player/Combo1"), 50, 96, false, groundAttack3); airAttackAnimation1 = new AnimationData(Engine.Instance.Content.Load <Texture2D>("Player/Combo1"), 50, 96, false, groundAttack1); airAttackAnimation2 = new AnimationData(Engine.Instance.Content.Load <Texture2D>("Player/Combo2"), 50, 96, false, groundAttack2); parryAnimation = new AnimationData(Engine.Instance.Content.Load <Texture2D>("Player/Parry"), 50, 96, false, parryBox); flip = SpriteEffects.None; sprite.PlayAnimation(idleAnimation); boxTexture = Engine.Instance.Content.Load <Texture2D>("Tiles/Red"); Camera.CameraTrap = new Rectangle((int)this.Right, (int)this.Bottom - 100, 50, 70); moves = new Move[] { new Move(attackName1, Buttons.X) { IsSubMove = true, IsVertMove = true }, new Move(attackName2, Buttons.X, Buttons.X) { IsSubMove = true, IsVertMove = true }, new Move(attackName3, Buttons.X, Buttons.X, Buttons.X) { IsVertMove = true }, new Move(attackName1, Buttons.X) { IsSubMove = true }, new Move(attackName2, Buttons.X, Buttons.X) { IsSubMove = true }, new Move(attackName3, Buttons.X, Buttons.X, Buttons.X), new Move(airAttackName1, Buttons.X) { IsSubMove = true, IsAirMove = true }, new Move(airAttackName1, Buttons.X) { IsSubMove = true, IsAirMove = true, IsVertMove = true }, new Move(airAttackName2, Buttons.X, Buttons.X) { IsAirMove = true }, new Move(airAttackName2, Buttons.X, Buttons.X) { IsAirMove = true, IsVertMove = true } }; moveList = new MoveList(moves); comboManager = new ComboManager((PlayerIndex.One), moveList.LongestMoveLength); this.Add(counters); }
public FitState_AM_HitStun(HitboxData Sent, double calcKB) { SentKnockback = Sent; CalcKB = calcKB; }
public void CreateHitbox(HitboxData data) { hitboxManager.ActivateHitbox(data); }
public void ActivateHitbox(HitboxData _hitboxData) { hitboxData = _hitboxData; ObjectsHit.Clear(); StartCoroutine(IeActivateHitbox()); }
public FitState_AM_ShieldStun(HitboxData Sent) { SentKnockback = Sent; }
public FitState_AM_HitStunFly(HitboxData Sent, double calcKB) { SentKnockback = Sent; CalcKB = calcKB; }
public Attack(HitboxData hitbox) { hitboxes = new HitboxData[1]; hitboxes[0] = hitbox; }
public HitboxData(HitboxData hitboxData) { // clone CopyData(hitboxData, this); }
public HitboxData(HitboxData hitboxData) // clone { CopyData(hitboxData, this); }