Commit f9ddf1ac authored by mthiele2's avatar mthiele2
Browse files

Is this the real life?

Is this just fantasy?
Caught in a landslide
No escape from reality
Open your eyes
Look up to the skies and see
I'm just a poor boy, I need no sympathy
Because I'm easy come, easy go
A little high, little low
Anyway the wind blows, doesn't really matter to me, to me
Mama, just killed a man
Put a gun against his head
Pulled my trigger, now he's dead
Mama, life had just begun
But now I've gone and thrown it all away
Mama, oh oh
Didn't mean to make you cry
If I'm not back again this time tomorrow
Carry on, carry on, as if nothing really matters
Too late, my time has come
Sends shivers down my spine
Body's aching all the time
Goodbye everybody I've got to go
Gotta leave you all behind and face the truth
Mama, oh oh (anyway the wind blows)
I don't want to die
Sometimes wish I'd never been born at all
parent 5b95de9a
...@@ -14,7 +14,7 @@ GameObject: ...@@ -14,7 +14,7 @@ GameObject:
- component: {fileID: 114326583413855364} - component: {fileID: 114326583413855364}
- component: {fileID: 114716552753954768} - component: {fileID: 114716552753954768}
- component: {fileID: 7710007422906786959} - component: {fileID: 7710007422906786959}
m_Layer: 13 m_Layer: 14
m_Name: Erd-Gegner m_Name: Erd-Gegner
m_TagString: Enemy m_TagString: Enemy
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
...@@ -133,8 +133,8 @@ MonoBehaviour: ...@@ -133,8 +133,8 @@ MonoBehaviour:
weight: 1 weight: 1
isPerformingAction: 0 isPerformingAction: 0
movementSpeed: 5 movementSpeed: 5
aggroRange: 0 aggroRange: 6
dropAggroRange: 0 dropAggroRange: 7
--- !u!58 &7710007422906786959 --- !u!58 &7710007422906786959
CircleCollider2D: CircleCollider2D:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -162,7 +162,7 @@ GameObject: ...@@ -162,7 +162,7 @@ GameObject:
- component: {fileID: 5151316259711694663} - component: {fileID: 5151316259711694663}
- component: {fileID: 7574451920411087056} - component: {fileID: 7574451920411087056}
- component: {fileID: 5069815732207941033} - component: {fileID: 5069815732207941033}
m_Layer: 13 m_Layer: 14
m_Name: Erdangriff m_Name: Erdangriff
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
......
...@@ -14,7 +14,7 @@ GameObject: ...@@ -14,7 +14,7 @@ GameObject:
- component: {fileID: 212219553255752332} - component: {fileID: 212219553255752332}
- component: {fileID: 114326583413855364} - component: {fileID: 114326583413855364}
- component: {fileID: 5627041003248903908} - component: {fileID: 5627041003248903908}
m_Layer: 13 m_Layer: 14
m_Name: Feuer-Gegner m_Name: Feuer-Gegner
m_TagString: Fire m_TagString: Fire
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
...@@ -51,7 +51,7 @@ Rigidbody2D: ...@@ -51,7 +51,7 @@ Rigidbody2D:
m_Mass: 10000 m_Mass: 10000
m_LinearDrag: 5 m_LinearDrag: 5
m_AngularDrag: 0.05 m_AngularDrag: 0.05
m_GravityScale: 0 m_GravityScale: 3
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_Interpolate: 0 m_Interpolate: 0
m_SleepingMode: 1 m_SleepingMode: 1
...@@ -160,7 +160,6 @@ MonoBehaviour: ...@@ -160,7 +160,6 @@ MonoBehaviour:
isPerformingAction: 0 isPerformingAction: 0
Cooldown: 2 Cooldown: 2
attackRange: 8 attackRange: 8
destroyTime: 1
damage: 1 damage: 1
fireBall: {fileID: 1870586037468468, guid: 61411254df3161c4e81f6c0a4f2cd33c, type: 3} fireBall: {fileID: 1870586037468468, guid: 61411254df3161c4e81f6c0a4f2cd33c, type: 3}
volleySize: 3 volleySize: 3
...@@ -176,7 +175,7 @@ GameObject: ...@@ -176,7 +175,7 @@ GameObject:
serializedVersion: 6 serializedVersion: 6
m_Component: m_Component:
- component: {fileID: 2944414297440889058} - component: {fileID: 2944414297440889058}
m_Layer: 13 m_Layer: 14
m_Name: ShotSpawn m_Name: ShotSpawn
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
......
...@@ -16,7 +16,7 @@ GameObject: ...@@ -16,7 +16,7 @@ GameObject:
- component: {fileID: 7642390674257080637} - component: {fileID: 7642390674257080637}
- component: {fileID: 2887302863579586647} - component: {fileID: 2887302863579586647}
- component: {fileID: 380768153646748734} - component: {fileID: 380768153646748734}
m_Layer: 13 m_Layer: 14
m_Name: Wasser-Gegner m_Name: Wasser-Gegner
m_TagString: Water m_TagString: Water
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
...@@ -201,7 +201,7 @@ GameObject: ...@@ -201,7 +201,7 @@ GameObject:
- component: {fileID: 4632333845714261479} - component: {fileID: 4632333845714261479}
- component: {fileID: 630870635} - component: {fileID: 630870635}
- component: {fileID: 630870634} - component: {fileID: 630870634}
m_Layer: 13 m_Layer: 14
m_Name: GroundCheck m_Name: GroundCheck
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
......
...@@ -16,7 +16,7 @@ GameObject: ...@@ -16,7 +16,7 @@ GameObject:
- component: {fileID: 114716552753954768} - component: {fileID: 114716552753954768}
- component: {fileID: 8582909611794385439} - component: {fileID: 8582909611794385439}
- component: {fileID: 879798643589630551} - component: {fileID: 879798643589630551}
m_Layer: 13 m_Layer: 14
m_Name: Wind-Gegner m_Name: Wind-Gegner
m_TagString: Enemy m_TagString: Enemy
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
...@@ -178,7 +178,7 @@ MonoBehaviour: ...@@ -178,7 +178,7 @@ MonoBehaviour:
weight: 1 weight: 1
isPerformingAction: 0 isPerformingAction: 0
patrolRange: 5 patrolRange: 5
targetPos: {fileID: 0} targetPos: {fileID: 1344694553418298308}
moveTime: 2 moveTime: 2
chillTime: 0.5 chillTime: 0.5
--- !u!114 &879798643589630551 --- !u!114 &879798643589630551
...@@ -211,7 +211,7 @@ GameObject: ...@@ -211,7 +211,7 @@ GameObject:
serializedVersion: 6 serializedVersion: 6
m_Component: m_Component:
- component: {fileID: 1344694553418298308} - component: {fileID: 1344694553418298308}
m_Layer: 13 m_Layer: 14
m_Name: Patrolspot m_Name: Patrolspot
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
......
...@@ -14,7 +14,7 @@ GameObject: ...@@ -14,7 +14,7 @@ GameObject:
- component: {fileID: 212152556601460820} - component: {fileID: 212152556601460820}
- component: {fileID: 53005818070376170} - component: {fileID: 53005818070376170}
m_Layer: 0 m_Layer: 0
m_Name: Pre_WindAttacke m_Name: EnemyWindAttack
m_TagString: EnemyShot m_TagString: EnemyShot
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
...@@ -131,5 +131,6 @@ MonoBehaviour: ...@@ -131,5 +131,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7e39d42d43f2d404ba22f886e573cae1, type: 3} m_Script: {fileID: 11500000, guid: 7e39d42d43f2d404ba22f886e573cae1, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
destroyTime: 1 destroyTime: 0
thrust: 10 thrust: 0
damage: 0
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3565338863107458340
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3565338863107458341}
- component: {fileID: 3565338863107458343}
- component: {fileID: 3565338863107458342}
m_Layer: 0
m_Name: BackgroundCamera
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3565338863107458341
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3565338863107458340}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 3565338863782319726}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!20 &3565338863107458343
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3565338863107458340}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0
far clip plane: 1000
field of view: 60
orthographic: 1
orthographic size: 10
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 8192
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!81 &3565338863107458342
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3565338863107458340}
m_Enabled: 0
--- !u!1 &3565338863782320019
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3565338863782319726}
- component: {fileID: 3565338863782319725}
- component: {fileID: 3565338863782319724}
- component: {fileID: 3565338863782319727}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3565338863782319726
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3565338863782320019}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 77.08, y: 49.679996, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 3565338863107458341}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!20 &3565338863782319725
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3565338863782320019}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 3
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 66
orthographic: 1
orthographic size: 8
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 24375
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!81 &3565338863782319724
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3565338863782320019}
m_Enabled: 1
--- !u!114 &3565338863782319727
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3565338863782320019}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 53e622d25d5bf8b45be54c49c309108d, type: 3}
m_Name:
m_EditorClassIdentifier:
target: {fileID: 0}
smoothSpeed: 0.5
lookAt: 0
maxDistance: 5
fileFormatVersion: 2
guid: d467d6f6bef5f8a44a20713cc2de4025
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
...@@ -4,7 +4,7 @@ using System.Collections; ...@@ -4,7 +4,7 @@ using System.Collections;
public class AI_WindAttack : WeightedAction public class AI_WindAttack : WeightedAction
{ {
GameObject nearestPlayer; GameObject target;
AI_Core myAI; AI_Core myAI;
private float restCooldown; private float restCooldown;
...@@ -26,12 +26,7 @@ public class AI_WindAttack : WeightedAction ...@@ -26,12 +26,7 @@ public class AI_WindAttack : WeightedAction
void CheckConditions() void CheckConditions()
{ {
nearestPlayer = myAI.findNearestPlayer(); if (myAI.rangeCheckFailed(transform, attackRange))
float dist = Vector2.Distance(transform.position, nearestPlayer.transform.position);
if (dist > attackRange)
{ {
return; return;
} }
...@@ -41,7 +36,9 @@ public class AI_WindAttack : WeightedAction ...@@ -41,7 +36,9 @@ public class AI_WindAttack : WeightedAction
public override void performAction() public override void performAction()
{ {
Vector3 attackdir = nearestPlayer.transform.position - transform.position; target = GameObject.FindGameObjectWithTag("Player");
Vector3 attackdir = target.transform.position - transform.position;
attackdir.Normalize(); attackdir.Normalize();
if (restCooldown <= 0) if (restCooldown <= 0)
...@@ -59,6 +56,7 @@ public class AI_WindAttack : WeightedAction ...@@ -59,6 +56,7 @@ public class AI_WindAttack : WeightedAction
public void Fire(Vector3 attackdir) public void Fire(Vector3 attackdir)
{ {
GameObject projectile = Instantiate(windAttack, transform.position + attackdir, Quaternion.AngleAxis(Mathf.Atan2(-attackdir.y, -attackdir.x) * Mathf.Rad2Deg + 180, Vector3.forward)); GameObject projectile = Instantiate(windAttack, transform.position + attackdir, Quaternion.AngleAxis(Mathf.Atan2(-attackdir.y, -attackdir.x) * Mathf.Rad2Deg + 180, Vector3.forward));
projectile.GetComponent<AI_WindProjectile>().setValues(damage, destroyTime, thrust);
body = projectile.GetComponent<Rigidbody2D>(); body = projectile.GetComponent<Rigidbody2D>();
Vector3 rotatedVector = Quaternion.AngleAxis(0, Vector3.forward) * attackdir; Vector3 rotatedVector = Quaternion.AngleAxis(0, Vector3.forward) * attackdir;
......
...@@ -7,20 +7,6 @@ public class AI_WindProjectile : MonoBehaviour ...@@ -7,20 +7,6 @@ public class AI_WindProjectile : MonoBehaviour
private float thrust; private float thrust;
private int damage; private int damage;
private void Start()
{
AI_WindAttack windattack = GetComponentInParent<AI_WindAttack>();
destroyTime = windattack.destroyTime;
thrust = windattack.thrust;
damage = windattack.damage;
}
void OnEnable()
{
Invoke("Destroy", destroyTime);
}
void Destroy() void Destroy()
{ {
Destroy(gameObject); Destroy(gameObject);
...@@ -37,7 +23,15 @@ public class AI_WindProjectile : MonoBehaviour ...@@ -37,7 +23,15 @@ public class AI_WindProjectile : MonoBehaviour
other.GetComponentInParent<Life>().Damage(damage); other.GetComponentInParent<Life>().Damage(damage);
} }
Destroy(); Destroy();
} }
public void setValues(int damage, float destroyTime, float thrust)
{
this.damage = damage;
this.destroyTime = destroyTime;
this.thrust = thrust;
Invoke("Destroy", destroyTime);
}
} }
...@@ -4,13 +4,14 @@ using System.Collections; ...@@ -4,13 +4,14 @@ using System.Collections;
public class AI_FireAttack : WeightedAction public class AI_FireAttack : WeightedAction
{ {
GameObject nearestPlayer; GameObject target;
AI_Core myAI; AI_Core myAI;
private float restCooldown; private float restCooldown;
public float Cooldown; public float Cooldown;
public float attackRange; public float attackRange;
public int damage; public int damage;
public float destroyTime;
public GameObject fireBall; public GameObject fireBall;
public int volleySize; public int volleySize;
public float launchPower; public float launchPower;
...@@ -27,12 +28,7 @@ public class AI_FireAttack : WeightedAction ...@@ -27,12 +28,7 @@ public class AI_FireAttack : WeightedAction
void CheckConditions() void CheckConditions()
{ {
nearestPlayer = myAI.findNearestPlayer(); if (myAI.rangeCheckFailed(transform, attackRange))
float dist = Vector2.Distance(transform.position, nearestPlayer.transform.position);
if (dist > attackRange)
{ {
return; return;
} }
...@@ -55,13 +51,14 @@ public class AI_FireAttack : WeightedAction ...@@ -55,13 +51,14 @@ public class AI_FireAttack : WeightedAction
IEnumerator fireVolley() IEnumerator fireVolley()
{ {
target = GameObject.FindGameObjectWithTag("Player");
launchPower = 10; launchPower = 10;
for (int i = 0; i < volleySize; i++) for (int i = 0; i < volleySize; i++)
{ {
launchPower += 3; launchPower += 3;
GameObject projectile = Instantiate(fireBall, shotspawn.position, shotspawn.rotation); GameObject projectile = Instantiate(fireBall, shotspawn.position, shotspawn.rotation);
projectile.GetComponent<AI_FireProjectile>().damage = damage; projectile.GetComponent<AI_FireProjectile>().setValues(damage, destroyTime);
if (nearestPlayer.transform.position.x > this.transform.position.x) if (target.transform.position.x > this.transform.position.x)
{ {
projectile.GetComponent<Rigidbody2D>().velocity = new Vector2(launchPower, launchPower); projectile.GetComponent<Rigidbody2D>().velocity = new Vector2(launchPower, launchPower);
} }
......
...@@ -2,7 +2,13 @@ using UnityEngine; ...@@ -2,7 +2,13 @@ using UnityEngine;
public class AI_FireProjectile : MonoBehaviour public class AI_FireProjectile : MonoBehaviour
{ {
public int damage; private int damage;
private float destroyTime;
void Destroy()
{
Destroy(gameObject);
}
private void OnTriggerEnter2D(Collider2D other) private void OnTriggerEnter2D(Collider2D other)
{ {
...@@ -16,5 +22,12 @@ public class AI_FireProjectile : MonoBehaviour ...@@ -16,5 +22,12 @@ public class AI_FireProjectile : MonoBehaviour
} }
Destroy(gameObject); Destroy(gameObject);
} }
public void setValues(int damage, float destroyTime)
{
this.damage = damage;
this.destroyTime = destroyTime;
Invoke("Destroy", destroyTime);
}
}