Commit f5a8c2da authored by TTK18SP Ruottinen Perttu Sakari's avatar TTK18SP Ruottinen Perttu Sakari
Browse files

Distiller smoke and ammo drop

parent a4e641db
fileFormatVersion: 2
guid: b04569eb804d6ac488125f0ec28a920f
ModelImporter:
serializedVersion: 19300
internalIDToNameTable:
- first:
74: -8046342648439026570
second: Ammo Box|Ammo Box Idle
- first:
74: 2326587313352654370
second: Ammo Box|Ammo Box Reload Stage 2
- first:
74: -8060421845814494588
second: Ammo Box|Ammo Box Reload Stage 3
- first:
74: 195480226963709501
second: Ammo Box|Belt Idle
- first:
74: -6959799609958224318
second: Ammo Box|Belt Reload Stage 2
- first:
74: 2963638823656055764
second: Ammo Box|Belt Reload Stage 3
- first:
74: -5099928189444609404
second: Boolet Belt|Ammo Box Idle
- first:
74: 2436891746736811127
second: Boolet Belt|Ammo Box Reload Stage 2
- first:
74: -2715136379342778110
second: Boolet Belt|Ammo Box Reload Stage 3
- first:
74: 1597685365440827544
second: Boolet Belt|Belt Idle
- first:
74: -4354754327313521759
second: Boolet Belt|Belt Reload Stage 2
- first:
74: 7278071278258215879
second: Boolet Belt|Belt Reload Stage 3
- first:
74: -6483017190007986719
second: Boolets|Ammo Box Idle
- first:
74: 470291337408319409
second: Boolets|Ammo Box Reload Stage 2
- first:
74: -5043650986059737336
second: Boolets|Ammo Box Reload Stage 3
- first:
74: -1245332800700827349
second: Boolets|Belt Idle
- first:
74: 4763271767514834270
second: Boolets|Belt Reload Stage 2
- first:
74: -2019404147263774310
second: Boolets|Belt Reload Stage 3
externalObjects: {}
materials:
materialImportMode: 1
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 7860e2d2285f9c14abf79f5e35fefa21
ModelImporter:
serializedVersion: 19300
internalIDToNameTable:
- first:
74: -8046342648439026570
second: Ammo Box|Ammo Box Idle
- first:
74: 2326587313352654370
second: Ammo Box|Ammo Box Reload Stage 2
- first:
74: -8060421845814494588
second: Ammo Box|Ammo Box Reload Stage 3
- first:
74: 195480226963709501
second: Ammo Box|Belt Idle
- first:
74: -6959799609958224318
second: Ammo Box|Belt Reload Stage 2
- first:
74: 2963638823656055764
second: Ammo Box|Belt Reload Stage 3
externalObjects: {}
materials:
materialImportMode: 1
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
......@@ -13,8 +13,11 @@ public class EnemyPhysics : MonoBehaviour
[SerializeField]
private NavMeshAgent nav;
//public GameObject stAmmoDrop, rAmmoDrop;
public GameObject[] ammoDrops;
public float health;
private int score;
private int score, randomInt;
// Start is called before the first frame update
void Start()
......@@ -69,6 +72,10 @@ public class EnemyPhysics : MonoBehaviour
PlayerPrefs.SetInt("Score", PlayerPrefs.GetInt("Score") + score);
randomInt = Random.Range(0, ammoDrops.Length);
GameObject ammoBox = Instantiate(ammoDrops[randomInt], transform.position, Quaternion.identity);
Destroy(ammoBox, 30f);
if (gnomeHolder != null)
{
Destroy(gnomeHolder, 3f);
......
......@@ -4,7 +4,8 @@ using UnityEngine;
public class PickupItem : MonoBehaviour
{
public GameObject gun;
public GameObject shotgun;
public GameObject rifle;
public GameObject trap;
public GameObject obstacle;
int Ammo = 0;
......@@ -37,11 +38,15 @@ public class PickupItem : MonoBehaviour
{
if(collider.gameObject.tag == "Player")
{
if(gameObject.tag == "Ammo")
if(gameObject.tag == "ShotgunAmmo")
{
PickupAmmo();
PickupShotgunAmmo();
}
if(gameObject.tag == "Health")
if (gameObject.tag == "RifleAmmo")
{
PickupRifleAmmo();
}
if (gameObject.tag == "Health")
{
PickupHealth();
}
......@@ -56,26 +61,26 @@ public class PickupItem : MonoBehaviour
}
}
void PickupAmmo()
void PickupShotgunAmmo()
{
Weapon weapon = gun.GetComponent<Weapon>();
Weapon weapon = shotgun.GetComponent<Weapon>();
if(weapon.ammo < 20 && weapon.ammo > 12)
if (weapon.ammo < 20)
{
Debug.Log("Ammo picked up");
weapon.ammo = 20;
Destroy(gameObject);
}
else if (weapon.ammo < 12)
}
void PickupRifleAmmo()
{
Rifle r = rifle.GetComponent<Rifle>();
if (r.ammo < 20)
{
Debug.Log("Ammo picked up");
weapon.ammo += 8;
r.ammo = 20;
Destroy(gameObject);
}
else
{
return;
}
}
void PickupHealth()
......@@ -132,7 +137,7 @@ public class PickupItem : MonoBehaviour
}
}
public void BuyStuff(string buyWhat)
/*public void BuyStuff(string buyWhat)
{
GameObject toBuy = Instantiate(gameObject);
PickupItem pickupItem = toBuy.GetComponent<PickupItem>();
......@@ -155,5 +160,5 @@ public class PickupItem : MonoBehaviour
{
Destroy(toBuy);
}
}
}*/
}
......@@ -24,6 +24,7 @@ public class PlaceableManager : MonoBehaviour
//public GameObject inGameCanvas;
//Distiller
public ParticleSystem distillerSmoke;
private int berries, mushrooms, score;
private float distillerTimer, drinkEffectTimer;
private bool ingredients, distillerActive, drinkReady, drinkEffect;
......@@ -34,8 +35,8 @@ public class PlaceableManager : MonoBehaviour
berries = 0;
mushrooms = 0;
distillerTimer = 10f;
drinkEffectTimer = 5f;
distillerTimer = 20f;
drinkEffectTimer = 30f;
ingredients = false;
distillerActive = false;
drinkReady = false;
......@@ -98,8 +99,8 @@ public class PlaceableManager : MonoBehaviour
if (Input.GetKeyDown(KeyCode.E) && drinkReady)
{
Debug.Log("Drink used");
distillerTimer = 10f;
drinkEffectTimer = 5f;
distillerTimer = 20f;
drinkEffectTimer = 30f;
drinkReady = false;
drinkEffect = true;
}
......@@ -132,10 +133,11 @@ public class PlaceableManager : MonoBehaviour
if (distillerActive)
{
distillerTimer -= Time.deltaTime;
//Debug.Log(distillerTimer);
distillerSmoke.Play();
if (distillerTimer <= 0)
{
distillerSmoke.Stop();
Debug.Log("Drink ready");
drinkReady = true;
distillerActive = false;
......
......@@ -54,7 +54,6 @@ public class StationaryWeapon : MonoBehaviour
void Update()
{
GameObject Cam = GameObject.Find("Camera");
//GameObject barrel = GameObject.Find("Gun");
rotationY -= Input.GetAxis("Mouse Y") * 360 * Time.deltaTime;
rotationX = Input.GetAxis("Mouse X") * 360 * Time.deltaTime;
......
This diff is collapsed.
fileFormatVersion: 2
guid: 31776d138a971914098347263f37515b
guid: 1ea38d3c63d824a418730393de089d02
PrefabImporter:
externalObjects: {}
userData:
......
......@@ -63,6 +63,9 @@ MonoBehaviour:
gnomeHolder: {fileID: 8898221211294516647}
gnomeModel: {fileID: 0}
nav: {fileID: 8898221211294516669}
ammoDrops:
- {fileID: 8848986012237259618, guid: f602858f89b913d40a08d16a3fa3bc08, type: 3}
- {fileID: 2472976892461617457, guid: cb614fe16fd3fae4ea719bd7b25999fc, type: 3}
health: 1
--- !u!54 &8898221212247820338
Rigidbody:
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &205865960532436113
--- !u!1 &2472976892461617457
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
......@@ -8,46 +8,49 @@ GameObject:
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7481303620429802378}
- component: {fileID: 6618217367806260792}
- component: {fileID: 7570832722989800203}
- component: {fileID: 1444141149869204258}
- component: {fileID: 7589014000339605780}
- component: {fileID: 4210040387206555117}
- component: {fileID: 8692987135106430068}
- component: {fileID: 5216281770321097707}
- component: {fileID: 663438420372685394}
m_Layer: 0
m_Name: Boolet Belt
m_TagString: Untagged
m_Name: AmmoBoxRifle
m_TagString: RifleAmmo
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7481303620429802378
--- !u!4 &1444141149869204258
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 205865960532436113}
m_GameObject: {fileID: 2472976892461617457}
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.058861036, y: 0.17844841, z: -0.009616639}
m_LocalScale: {x: 0.031195581, y: 0.031195581, z: 0.031195581}
m_LocalPosition: {x: 567.9851, y: 84.33624, z: 679.8081}
m_LocalScale: {x: 2, y: 2, z: 2}
m_Children:
- {fileID: 430810541663223544}
m_Father: {fileID: 6309717969095133676}
- {fileID: 2614603089178853700}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &6618217367806260792
--- !u!33 &7589014000339605780
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 205865960532436113}
m_Mesh: {fileID: -6096824071095131082, guid: bc2ae22546566544bb6a55c70e73c21c, type: 3}
--- !u!23 &7570832722989800203
m_GameObject: {fileID: 2472976892461617457}
m_Mesh: {fileID: -2781883738177848365, guid: b04569eb804d6ac488125f0ec28a920f, type: 3}
--- !u!23 &4210040387206555117
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 205865960532436113}
m_GameObject: {fileID: 2472976892461617457}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
......@@ -59,7 +62,8 @@ MeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: -8649992195856677659, guid: bc2ae22546566544bb6a55c70e73c21c, type: 3}
- {fileID: -6629797300637803691, guid: b04569eb804d6ac488125f0ec28a920f, type: 3}
- {fileID: -8274133419916619345, guid: b04569eb804d6ac488125f0ec28a920f, type: 3}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
......@@ -80,7 +84,52 @@ MeshRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &2080451064310906708
--- !u!65 &8692987135106430068
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2472976892461617457}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.18383473, y: 0.19324574, z: 0.30818164}
m_Center: {x: -0.0036907084, y: 0.096607015, z: 0.015151292}
--- !u!114 &5216281770321097707
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2472976892461617457}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: aba571034f62195419d62e2ecb581796, type: 3}
m_Name:
m_EditorClassIdentifier:
shotgun: {fileID: 0}
rifle: {fileID: 0}
trap: {fileID: 0}
obstacle: {fileID: 0}
--- !u!54 &663438420372685394
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2472976892461617457}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!1 &4702149065319353951
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
......@@ -88,45 +137,46 @@ GameObject:
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 430810541663223544}
- component: {fileID: 995835127118067046}
- component: {fileID: 3019359143713433378}
- component: {fileID: 2614603089178853700}
- component: {fileID: 1748135565381033206}
- component: {fileID: 3065545717597548997}
m_Layer: 0
m_Name: Boolets
m_Name: Boolet Belt
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &430810541663223544
--- !u!4 &2614603089178853700
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2080451064310906708}
<