Skip to content
Permalink
Browse files

just wanna pull mikes shit

  • Loading branch information...
jonZlotnik committed Apr 1, 2018
1 parent 2ea7ac1 commit a631c3b81334e906d3cb866e2e25eb85931ea4ef
@@ -124,7 +124,7 @@ Rigidbody2D:
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 0
m_Constraints: 4
--- !u!58 &58055611949475320
CircleCollider2D:
m_ObjectHideFlags: 1
@@ -696,7 +696,7 @@ MonoBehaviour:
locked: 0
manualUpdate: 0
keepDelayedEventsOnStateExit: 0
preprocessed: 0
preprocessed: 1
ExposedEvents: []
RestartOnEnable: 1
EnableDebugFlow: 0
@@ -1468,6 +1468,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: a117bdae395ec05469638d1caf8e790c, type: 3}
m_Name:
m_EditorClassIdentifier:
maxHealth: 0
hp: 0
--- !u!114 &114403572656398628
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -6,5 +6,5 @@ PhysicsMaterial2D:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: DefaultPhysicsMaterial2D
friction: 0
friction: 5.99
bounciness: 0

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -134,6 +134,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1998bb47d1023e743829aa9ee2dc9a26, type: 3}
m_Name:
m_EditorClassIdentifier:
maxHealth: 0
hp: 0
canControl: 1
--- !u!50 &198906434
Rigidbody2D:
@@ -220,7 +222,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 4265164011290162, guid: d2e2ee06cb556384d852d870313cfc27, type: 2}
propertyPath: m_LocalPosition.y
value: 0
value: 0.07
objectReference: {fileID: 0}
- target: {fileID: 4265164011290162, guid: d2e2ee06cb556384d852d870313cfc27, type: 2}
propertyPath: m_LocalPosition.z
@@ -266,11 +268,29 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 1306299107491336, guid: d2e2ee06cb556384d852d870313cfc27, type: 2}
propertyPath: m_Layer
value: 10
value: 11
objectReference: {fileID: 0}
- target: {fileID: 1495451515534780, guid: d2e2ee06cb556384d852d870313cfc27, type: 2}
propertyPath: m_Layer
value: 10
value: 11
objectReference: {fileID: 0}
- target: {fileID: 4733479802300092, guid: d2e2ee06cb556384d852d870313cfc27, type: 2}
propertyPath: m_RootOrder
value: 3
objectReference: {fileID: 0}
- target: {fileID: 4551658103220486, guid: d2e2ee06cb556384d852d870313cfc27, type: 2}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 114290531363808734, guid: d2e2ee06cb556384d852d870313cfc27,
type: 2}
propertyPath: fsm.preprocessed
value: 1
objectReference: {fileID: 0}
- target: {fileID: 114290531363808734, guid: d2e2ee06cb556384d852d870313cfc27,
type: 2}
propertyPath: fsm.editorFlags
value: 2
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: d2e2ee06cb556384d852d870313cfc27, type: 2}
@@ -286,7 +306,7 @@ GameObject:
- component: {fileID: 363618797}
- component: {fileID: 363618796}
- component: {fileID: 363618795}
m_Layer: 10
m_Layer: 11
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
@@ -356,6 +376,79 @@ Transform:
m_Father: {fileID: 198906432}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &680066326
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 680066328}
- component: {fileID: 680066327}
m_Layer: 0
m_Name: Test2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!212 &680066327
SpriteRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 680066326}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: -2
m_Sprite: {fileID: 21300000, guid: c710b8737e80d024c864cee6db0e84e2, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 5.63, y: 2.55}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
--- !u!4 &680066328
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 680066326}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 10.7, y: 4.26, z: 0}
m_LocalScale: {x: 10.762588, y: 10.76259, z: 10.76259}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1350024491
Prefab:
m_ObjectHideFlags: 0
@@ -17,6 +17,9 @@ public class Character : MonoBehaviour {
protected bool isHealthStance = false;
protected bool isEnergyStance = false;
protected bool isSpeedStance = false;
protected bool isInvincible = false;
protected bool isImmune = false;


//MonoBehaviour Properties
private Rigidbody2D rb2d;
@@ -125,14 +128,19 @@ private void takeDamage(int damage)
}
public void receiveAttack(Attack attack)
{
this.takeDamage(attack.getDamageValue());
if(!this.isInvincible)
{
this.takeDamage(attack.getDamageValue());

Direction knockBackDir;
knockBackDir = (attack.getAttackerTransform().position.x - this.getPosition().x) > 0 ? Direction.RIGHT : Direction.LEFT ;
Direction knockBackDir;
knockBackDir = (attack.getAttackerTransform().position.x - this.getPosition().x) < 0 ? Direction.RIGHT : Direction.LEFT ;

Vector2 knockBack = new Vector2(5f,5f)*attack.getKnockBackMultiplier();
this.rb2d.velocity = knockBack;
this.isKnockbacking = true;
Vector2 knockBack = new Vector2(1f,1f)*attack.getKnockBackMultiplier();
knockBack.x *= (knockBackDir==Direction.LEFT?-1:1);
this.rb2d.velocity = knockBack;
this.isKnockbacking = true;
this.isInvincible = true;
}
}

//protected void attack(Attack attack, )
@@ -150,16 +158,32 @@ public void receiveAttack(Attack attack)

// Update is called once per frame
protected void Update () {
checkHealth();
//checkHealth();
}


//Timers
public float invincibilityTimer = 0f;
private float INVINCIBILITY_DURATION = 1f;

private float knockBackTimer = 0f;
private float KNOCKBACK_DURATION = 1.0f;
private float KNOCKBACK_DURATION = 0.5f;

// FixedUpdate is called every fixed framerate frame
protected void FixedUpdate() {
checkHealth();

//Invincibility Timekeeping
if(this.isInvincible && invincibilityTimer < INVINCIBILITY_DURATION)
{
this.invincibilityTimer = this.invincibilityTimer + Time.deltaTime;
}
else
{
this.invincibilityTimer = 0;
this.isInvincible = false;
}


//KnockBack Timekeeping
if(this.isKnockbacking && knockBackTimer < KNOCKBACK_DURATION)
@@ -5,7 +5,7 @@
public class Slash : Attack {

public const int SLASH_DAMAGE = 1;
public const float SLASH_KNOCKBACK = 1f;
public const float SLASH_KNOCKBACK = 0.5f;
public const float SLASH_REPEAT_DELAY = 1f;


@@ -16,7 +16,7 @@ public class Enemy : Character {
}

// Update is called once per frame
protected new void Update () {
protected new void FixedUpdate () {
base.Update();
if(this.keepMoving == true){
movementAI();
@@ -14,7 +14,7 @@ public class Valla : Human {
}

// Update is called once per frame
protected new void Update () {
protected new void FixedUpdate () {
base.Update();
if(canControl)
{

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -34,4 +34,4 @@ Physics2DSettings:
m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432}
m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}
m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804}
m_LayerCollisionMatrix: fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9fffffff9ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_LayerCollisionMatrix: fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1fffffff9fffffffdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

0 comments on commit a631c3b

Please sign in to comment.
You can’t perform that action at this time.