Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,39 @@
using UnityEngine;
using System.Collections;

public class ALexCamMovement : MonoBehaviour {

public float sensitivity;
public float actualSensitivity;
public float speed;




public GameObject camera;

public float fixer = 1f;

void Awake (){
camera = FindObjectOfType<Camera>().gameObject;
actualSensitivity = sensitivity;
}


void FixedUpdate (){


transform.Rotate(0f,Input.GetAxis("Mouse X")*actualSensitivity,0f);
camera.transform.Rotate (-Input.GetAxis ("Mouse Y") * actualSensitivity, 0f, 0f);

transform.Translate(-Input.GetAxis("Horizontal")*speed,0f,-Input.GetAxis("Vertical")*speed);

camera.transform.rotation = Quaternion.Euler(new Vector3(Mathf.Clamp(camera.transform.rotation.eulerAngles.x,25f,70f),
camera.transform.rotation.eulerAngles.y,0f));

// MEGA MASTER AWUSUM FIXs
if (camera.transform.localRotation.eulerAngles.y > 180f) {
camera.transform.localRotation = Quaternion.Euler (camera.transform.rotation.eulerAngles.x, 175.5f, 0f);
}
}
}
@@ -0,0 +1,10 @@
using UnityEngine;
using System.Collections;

public class Bar : GenericRoom {

// Update is called once per frame
void Update () {

}
}
@@ -0,0 +1,15 @@
using UnityEngine;
using System.Collections;

public class Bedroom : GenericRoom {

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}
}
@@ -0,0 +1,17 @@
using UnityEngine;
using System.Collections;

public class Bullet : MonoBehaviour {

void Awake(){
Destroy(this.gameObject,2f);
GetComponent<AudioSource>().Play();
}

void OnCollisionEnter (Collision other){

Destroy(GetComponent<Renderer>());
Destroy(GetComponent<Collider>());
Destroy(GetComponent<TrailRenderer>());
}
}
@@ -0,0 +1,43 @@
using UnityEngine;
using System.Collections;

public class ConferenceRoom : GenericRoom {

// Use this for initialization
// void Awake () {
// // Set vars
// name = "Conference Room";
// flavor = "Something awesome happens every day!";
// //roomEvents = [];
// // Get the size and the grid
// size.x = Random.Range(minSize.x, maxSize.x);
// size.z = Random.Range(minSize.z, maxSize.z);
// tileGrid = new RoomCell[size.x, size.z];
// // Generate the grid and make the walls
// GenerateGrid ();
// MakeWalls ();
// // Get the door cells
// doors = GetDoors();
// // Generate the middle
// RoomCell middleCell = GetCellAt (new IntVector2(size.x / 2, size.z / 2));
// float floorY = FindObjectOfType<ConferenceRoom>().gameObject.transform.position.y;
// middle = Instantiate (middlePrefab) as GameObject;
// middle.transform.position = middleCell.transform.position + new Vector3 (2.5f, -5f, 2.5f);
// middle.transform.SetParent (this.transform);
// GetCellAt (new IntVector2 (size.x / 2, size.z / 2)).setFull();
// GetCellAt (new IntVector2 (size.x / 2 + 1, size.z / 2)).setFull();
// GetCellAt (new IntVector2 (size.x / 2, size.z / 2 + 1)).setFull ();
// GetCellAt (new IntVector2 (size.x / 2 + 1, size.z / 2 + 1)).setFull();
// // Fill with furniture
//
// // Fill with NPCs
// spawnNPCs ();
// }

// Update is called once per frame
void Update () {

}


}
@@ -0,0 +1,165 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class Corridor : GenericRoom {

// A single cell
public CorridorCell corridorCell;

// Delay for generation (debug)
public float generationStepDelay;
// Probability for a corner
public float cornerProbability;

// A random coordinate for this corridor
public IntVector2 RandomCoordinates {
get {
return new IntVector2(Random.Range(10, size.x-10), Random.Range(10, size.z-10));
}
}

// The grid
private CorridorCell[,] cells;
// Dictionary with the generated cells
//private ArrayList cellList = new ArrayList();
[SerializeField]
public List<CorridorCell> cellList = new List<CorridorCell>();

void Awake () {
isCorridor = true;
}
// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}

// Gets the cell at given coords
public CorridorCell GetCell(IntVector2 coordinates) {
if (ContainsCoordinates (coordinates)) {
return cells [coordinates.x, coordinates.z];
} else {
return null;
}
}// getcell

// Generate the corridor
public void Generate() {
cells = new CorridorCell[size.x, size.z];
bool turned = false, turnedRecently = false;
// Current coordinates, initialised with -1, -1
IntVector2 currentCoordinates;
// Coordinates to generate the next cell on
IntVector2 nextCoordinates = RandomCoordinates;
// The direction to generate the next cell to
CorridorDirection nextDirection = CorridorDirections.RandomValue;
// Direction of the current cell
CorridorDirection currentDirection = nextDirection;

CreateFirstCell (nextCoordinates, nextDirection);
currentCoordinates = nextCoordinates;
currentDirection = nextDirection;

// Generate the cells
while(true) {

turned = false;
// Check if change direction or not
if(Random.Range(0, 100) < cornerProbability && !turnedRecently) {
// Try random direction. If wrong, try until right
nextDirection = CorridorDirections.RandomValue;
while (nextDirection == CorridorDirections.OppositeOf(currentDirection)) {
nextDirection = CorridorDirections.RandomValue;
}// while
turned = true;
}// if
else {
nextDirection = currentDirection;
}
turnedRecently = turned;
nextCoordinates += currentDirection.ToIntVector2();

if(!(ContainsCoordinates(nextCoordinates) && GetCell(nextCoordinates) == null)) {
break;
}
CreateCell(nextCoordinates, currentDirection, nextDirection);
cellList.Add(GetCell (currentCoordinates));
currentDirection = nextDirection;
currentCoordinates = nextCoordinates;
}// while

// Spawn the npcs
corridorSpawnNPCs ();
}// generate

// Create the first cell (speshal)
private void CreateFirstCell(IntVector2 nextCoordinates, CorridorDirection nextDirection) {
CorridorCell newCell;
newCell = Instantiate (corridorCell) as CorridorCell;
newCell.PointTo (nextDirection);
cells [nextCoordinates.x, nextCoordinates.z] = newCell;
newCell.name = "First Cell " + nextCoordinates.x + ", " + nextCoordinates.z;
newCell.transform.parent = transform;
newCell.transform.localPosition = new Vector3 (nextCoordinates.x - size.x * 0.5f + 0.5f,
0f, nextCoordinates.z - size.z * 0.5f + 0.5f);
newCell.setFull ();

cellList.Add(newCell);

// Set spawn point as this cell
spawn = new IntVector2 ((int)newCell.transform.position.x, (int)newCell.transform.position.z);
}// createFirstCell

// Create a single corridor cell
private void CreateCell (IntVector2 nextCoordinates, CorridorDirection currentDirection, CorridorDirection nextDirection) {
// Cell's neighbors
CorridorCell north = GetCell (new IntVector2(nextCoordinates.x, nextCoordinates.z + 1));
CorridorCell south = GetCell (new IntVector2(nextCoordinates.x, nextCoordinates.z - 1));
CorridorCell east = GetCell (new IntVector2(nextCoordinates.x + 1, nextCoordinates.z));
CorridorCell west = GetCell (new IntVector2(nextCoordinates.x - 1, nextCoordinates.z));

// The new cell
CorridorCell newCell;
newCell = Instantiate (corridorCell) as CorridorCell;
newCell.PointFromTo (currentDirection, nextDirection);

cells [nextCoordinates.x, nextCoordinates.z] = newCell;
//newCell.material.color = new Color (Random.Range (0f, 1f), Random.Range (0f, 1f), Random.Range (0f, 1f));
newCell.name = "Corridor Cell " + nextCoordinates.x + ", " + nextCoordinates.z;
newCell.transform.parent = transform;
newCell.transform.localPosition = new Vector3 (nextCoordinates.x - size.x * 0.5f + 0.5f,
0f, nextCoordinates.z - size.z * 0.5f + 0.5f);

cellList.Add(newCell);
}// createCell

// Checks whether the given coordinates is whithin the corridor
public bool ContainsCoordinates(IntVector2 coordinate) {
return coordinate.x >= 0 && coordinate.x < size.x
&& coordinate.z >= 0 && coordinate.z < size.z;
}// containsCoordinates

// Spawn the npcs
private void corridorSpawnNPCs () {
foreach (CorridorCell theCell in cellList) {
if (theCell.isEmpty() && npcProbability > Random.Range (0, 100)) {
// If spawn enemies
if(enemyProbability > Random.Range(0, 100)){
// Spawn enemy
enemy = Instantiate(enemyPrefabs[Random.Range(0, enemyPrefabs.Length)]) as GameObject;
enemy.transform.position = theCell.transform.position;
enemy.transform.SetParent(this.gameObject.transform);
} else {
neutral = Instantiate(neutralPrefabs[Random.Range(0, neutralPrefabs.Length)]) as GameObject;
neutral.transform.position = theCell.transform.position;
neutral.transform.SetParent(this.gameObject.transform);
}// else
}//if
}// for
}// spawn npcs
}
@@ -0,0 +1,95 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class CorridorCell : MonoBehaviour {

// The probability of door per a given wall
public int wallDoorProbability;
// The coordinates of this cell
public IntVector2 coordinates;
// The material
public Material material;
// Door
public GameObject doorPrefab;
private GameObject doorInstance;
// The floor
private GameObject floor;
// The walls
public GameObject[] walls = new GameObject[4];
// empty
private bool empty = true;

// Use this for initialization
void Awake () {
material = GetComponentInChildren<Renderer> ().material;
floor = GameObject.FindGameObjectWithTag("floor");
}

// Update is called once per frame
void Update () {

}

public void PointTo(CorridorDirection to) {
if (to == CorridorDirection.North) {
walls [0].SetActive (false);
} else if (to == CorridorDirection.South) {
walls [1].SetActive (false);
} else if (to == CorridorDirection.East) {
walls [2].SetActive (false);
} else if (to == CorridorDirection.West) {
walls [3].SetActive (false);
}
}// PointTo

// Rotate the cell
public void PointFromTo(CorridorDirection from, CorridorDirection to) {
if (from == CorridorDirection.North) {
walls [1].SetActive (false);
} else if (from == CorridorDirection.South) {
walls [0].SetActive (false);
} else if (from == CorridorDirection.East) {
walls [3].SetActive (false);
} else if (from == CorridorDirection.West) {
walls [2].SetActive (false);
}
if (to == CorridorDirection.North) {
walls [0].SetActive (false);
} else if (to == CorridorDirection.South) {
walls [1].SetActive (false);
} else if (to == CorridorDirection.East) {
walls [2].SetActive (false);
} else if (to == CorridorDirection.West) {
walls [3].SetActive (false);
}

// Generate the door
foreach (GameObject wall in walls) {
if(wall.activeSelf){
if(Random.Range(0, 100) < wallDoorProbability) {
// Generate new door
wall.GetComponent<WallControl>().door = true;
doorInstance = Instantiate(doorPrefab) as GameObject;
doorInstance.transform.SetParent(wall.transform);
doorInstance.transform.localPosition = new Vector3(0f, 0f, -0.05f);
doorInstance.transform.localRotation = Quaternion.Euler(new Vector3(0f, 180f, 0f));
doorInstance.transform.localScale = new Vector3(0.1f, 0.1f, 0.3f);
//wall.GetComponent<MeshRenderer>().material.color = Color.blue;
}
}// if
}// foreach
}// point from to

public void setEmpty() {
empty = true;
}

public void setFull() {
empty = false;
}

public bool isEmpty() {
return empty;
}
}
@@ -0,0 +1,8 @@
using UnityEngine;

public enum CorridorDirection {
North,
East,
South,
West
}
@@ -0,0 +1,42 @@
using UnityEngine;
using System.Collections;

public static class CorridorDirections {

public const int Count = 4;

private static IntVector2[] vectors = {
new IntVector2 (0, 1),
new IntVector2 (1, 0),
new IntVector2 (0, -1),
new IntVector2 (-1, 0)
};

// Gets a random direction
public static CorridorDirection RandomValue {
get {
return (CorridorDirection)Random.Range (0, Count);
}
}// RandomValue

// Converts into int vectors
public static IntVector2 ToIntVector2 (this CorridorDirection direction) {
return vectors [(int)direction];
}

// Gets the inverse
public static CorridorDirection OppositeOf(CorridorDirection direction) {
switch (direction) {
case CorridorDirection.North:
return CorridorDirection.South;
case CorridorDirection.South:
return CorridorDirection.North;
case CorridorDirection.East:
return CorridorDirection.West;
case CorridorDirection.West:
return CorridorDirection.East;
default:
return CorridorDirection.North;
}// switch
}// inverse
}
@@ -0,0 +1,52 @@
using UnityEngine;
using System.Collections;

public class DroppableLoot : MonoBehaviour {

private int quantity;
private string type;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}

public void SetQuantity(int quantity) {
this.quantity = quantity;
}

public void SetType(string type) {
this.type = type;
}

void OnTriggerEnter (Collider col) {
if (col.gameObject.tag == "Player") {
Player player = col.gameObject.transform.parent.gameObject.GetComponent<Player> ();
switch (type) {
case "ammo":
player.ammo += quantity;
break;
case "armor":
if (player.armor + quantity >= player.maxArmor) {
player.armor = player.maxArmor;
} else {
player.armor += quantity;
}
break;
case "vodka":
if (player.currentHP + quantity >= player.maxHP) {
player.currentHP = player.maxHP;
} else {
player.currentHP += quantity;
}
break;
}
Destroy(this.gameObject);
}
}
}
@@ -0,0 +1,20 @@
using UnityEngine;
using System.Collections;

public class EndScene : MonoBehaviour {

private void Awake () {
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
}

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}
}
@@ -0,0 +1,159 @@
using UnityEngine;
using System.Collections;
using UnityEngine.Audio;

public class EnemyAI : MonoBehaviour {

public Player player;

// Use this for initialization
public int hp;
public int dmg;
public int givenXp;
public bool ranged = true;
public int aggroRange;
public int moveSpeed;
public int minMeleeRange = 1;
public int minRangedRange = 5;
public AudioClip meleeDmg;
public AudioClip deathSound;
public AudioMixerGroup effects;

private bool isFollowingPlayer = false;
private Ray ray;
private RaycastHit hit;
private Vector3 lastPlayerPosition;
private Vector3 origin;
private bool isDead = false;

public GameObject bar1;
public GameObject bul;
public GameObject bulIns;

private GameObject vodkaInstance;
private GameObject ammoInstance;
private GameObject armorInstance;

private AudioSource dmgAudioSource;
private AudioSource deathAudioSource;

public float timeNow,timeDelay;

void Awake () {

player = FindObjectOfType<Player>();

gameObject.GetComponent<SphereCollider> ().radius = aggroRange;
origin = transform.position;

// Update stats depending on plaer level
hp += (int)(hp * player.level * 1.1);
dmg += (int)(dmg * player.level * 0.7);

// Add audiosources
deathAudioSource = gameObject.AddComponent<AudioSource>();
deathAudioSource.clip = deathSound;
deathAudioSource.outputAudioMixerGroup = effects;
dmgAudioSource = gameObject.AddComponent<AudioSource> ();
dmgAudioSource.clip = meleeDmg;
dmgAudioSource.outputAudioMixerGroup = effects;
}

void Update (){

if (hp <= 0 && !isDead) {
player.GiveXP (givenXp);
//AudioSource.PlayClipAtPoint (deathSound, transform.position);
deathAudioSource.Play();
dropLoot ();
isDead = true;
} else if (isDead) {
Destroy (this.gameObject);
}
}

void OnCollisionEnter (Collision other){
if (other.gameObject.tag == "Bullet"){
hp -= player.damage*player.ExtraDMG;
}
}

void OnTriggerEnter (Collider other) {
if (other.gameObject.tag == "knife" && player.hasKnife) {
hp -= player.damage * player.ExtraDMG;
}
}

// shoots from range
public void Shooooooooot (){
bulIns = Instantiate(bul,bar1.transform.position,Quaternion.identity) as GameObject;
bulIns.GetComponent<EnemyBullet>().damage = dmg ;
bulIns.GetComponent<Rigidbody>().AddForceAtPosition(bar1.transform.right*50,transform.position,ForceMode.Impulse);
}

public void HitMelee() {
player.DamagePlayer (dmg);

//AudioSource.PlayClipAtPoint (meleeDmg, transform.position);
dmgAudioSource.Play();
}

void OnTriggerStay(Collider other) {
if (other.gameObject.tag == "Player" && ! player.isPaused()) {
ray = new Ray(transform.position, (other.transform.position - transform.position));
if(Physics.Raycast(ray, out hit, (float)aggroRange)) {
if(hit.collider.gameObject.tag == "Player"){
// hit

//shoot here somewhererere
if (ranged && timeNow < Time.time){
Shooooooooot();
timeNow = Time.time + timeDelay;
} else if(timeNow < Time.time && Vector3.Distance(transform.position, other.transform.position) < 3) {
HitMelee();
timeNow = Time.time + timeDelay;
}

transform.LookAt(other.transform);
isFollowingPlayer = true;
lastPlayerPosition = other.transform.position;
// Move towards player
if((ranged && Vector3.Distance(transform.position, other.transform.position) > minRangedRange) ||
(!ranged && Vector3.Distance(transform.position, other.transform.position) > minMeleeRange)) {
transform.position = Vector3.MoveTowards(transform.position, other.transform.position, Time.deltaTime * moveSpeed);
}
} else if(isFollowingPlayer && transform.position != lastPlayerPosition ){
transform.position = Vector3.MoveTowards(transform.position, lastPlayerPosition, Time.deltaTime * moveSpeed);
} else {
isFollowingPlayer = false;
}
}
}// if
}// on trigger stay

public void dropLoot() {
switch (Random.Range (0, 3)) {
case 0:
vodkaInstance = Instantiate (player.vodkaPrefab) as GameObject;
vodkaInstance.transform.position = this.transform.position;
vodkaInstance.GetComponent<DroppableLoot>().SetQuantity(Random.Range(10, player.maxHP/4));
vodkaInstance.GetComponent<DroppableLoot>().SetType("vodka");
vodkaInstance.transform.SetParent(player.room.transform);
break;
case 1:
ammoInstance = Instantiate (player.ammoPrefab) as GameObject;
ammoInstance.transform.position = this.transform.position;
ammoInstance.GetComponent<DroppableLoot>().SetQuantity(Random.Range(10, 200));
ammoInstance.GetComponent<DroppableLoot>().SetType("ammo");
ammoInstance.transform.SetParent(player.room.transform);
break;
case 2:
armorInstance = Instantiate (player.armorPrefab) as GameObject;
armorInstance.transform.position = this.transform.position;
armorInstance.GetComponent<DroppableLoot>().SetQuantity(Random.Range(1, player.maxArmor/8));
armorInstance.GetComponent<DroppableLoot>().SetType("armor");
armorInstance.transform.SetParent(player.room.transform);
break;
}
}// droploot
}
@@ -0,0 +1,20 @@
using UnityEngine;
using System.Collections;

public class EnemyBullet : MonoBehaviour {

public int damage;

void Awake(){
Destroy(this.gameObject,2f);
GetComponent<AudioSource>().Play();
}

void OnCollisionEnter (Collision other){

if (other.gameObject.tag == "Player") {
FindObjectOfType<Player> ().DamagePlayer (damage);
Destroy (this.gameObject);
}
}
}
@@ -0,0 +1,10 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

[System.Serializable]
public class EventPool : MonoBehaviour {

public List<EventRoom> events = new List<EventRoom>();

}
@@ -0,0 +1,30 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

using UnityEngine.UI;

[System.Serializable]
public class EventRoom {


public string name;
public int id;

public string displayText;


public Text textHolder;
public string[] optionsTexts;
public Button[] optionsHolder;
public Vector3[] optionsRewards;

// public EventRoom (string newName,int newId,string newDisplayText,Text newText,Button[] newButtonArray){
//
// name = newName;
// id = newId;
// displayText = newDisplayText;
// textHolder = newText;
// options = newButtonArray;
// }
}
@@ -0,0 +1,134 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class GameManager : MonoBehaviour {

public Corridor corridorPrefab;
public ConferenceRoom conferenceRoomPrefab;
public Bar barPrefab;
public Bedroom bedroomPrefab;
public Pool poolPrefab;
public GameObject startRoomInstance;
public Camera initialCamera;
private Corridor corridorInstance;
private Bar barInstance;
private Pool poolInstance;

private GameObject musicPlayer;

private Bedroom bedroomInstance;
private ConferenceRoom conferenceRoomInstance;
// Player prefab
public GameObject playerPF;

//Player
public GameObject player = null;

public Camera mainCam;
public GameObject OLcanvas;
public GameObject StartRoom;

private void Awake () {
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
}

private void Start () {

OLcanvas = GameObject.FindGameObjectWithTag ("canvas");
OLcanvas.gameObject.SetActive (false);
StartRoom = GameObject.FindGameObjectWithTag ("startroom");
musicPlayer = GameObject.FindGameObjectWithTag ("musicPlayer");

musicPlayer.GetComponent<MusicPlayer> ().transitionTo (1);
}

void Update() {
// If deaded
if (player != null && player.GetComponent<Player> ().currentHP == 0) {
// Restart game
this.GameOver ();
}

}
private void BeginGame () {
Vector3 initialPutinPosition = startRoomInstance.transform.FindChild ("putin").transform.position;
Destroy(startRoomInstance.transform.FindChild ("putin").gameObject);
Destroy(startRoomInstance.transform.FindChild ("Canvas-MM").gameObject);
Destroy(startRoomInstance.transform.FindChild ("ak47").gameObject);
OLcanvas.gameObject.SetActive (true);
player = Instantiate(playerPF,initialPutinPosition, Quaternion.identity) as GameObject;

Destroy (initialCamera.gameObject);

Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
}

public void pauseGame() {
player.GetComponent<Player> ().setPanelActive (true);
}
public void unPauseGame() {
player.GetComponent<Player>().setPanelActive(false);
}

public void RestartGame () {
Application.LoadLevel (0);
}

public void GameOver() {
musicPlayer.GetComponent<MusicPlayer> ().transitionTo (4);
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
Application.LoadLevel (1);
}

public void newRoom() {
int randomRoom = Random.Range (0, 5);
Transform putinTransform = FindObjectOfType<TurnPutin> ().gameObject.transform;
switch (randomRoom) {
case 0:
// Another corridor
corridorInstance = Instantiate (corridorPrefab) as Corridor;
corridorInstance.Generate();
FindObjectOfType<Player> ().gameObject.transform.position = new Vector3(
corridorInstance.GetSpawn ().x, 0f, corridorInstance.GetSpawn ().z);
putinTransform.localPosition = new Vector3(0f, 0f, 0f);
FindObjectOfType<Player> ().room = corridorInstance;
break;
case 1:
conferenceRoomInstance = Instantiate (conferenceRoomPrefab) as ConferenceRoom;
FindObjectOfType<Player> ().gameObject.transform.position = new Vector3(
conferenceRoomInstance.GetSpawn ().x, 0f, conferenceRoomInstance.GetSpawn ().z);
putinTransform.localPosition = new Vector3(0f, -14f, 0f);
FindObjectOfType<Player> ().room = conferenceRoomInstance;
break;
case 2:
barInstance = Instantiate (barPrefab) as Bar;
FindObjectOfType<Player> ().gameObject.transform.position = new Vector3(
barInstance.GetSpawn ().x, 0f, barInstance.GetSpawn ().z);
putinTransform.localPosition = new Vector3(0f, -14f, 0f);
FindObjectOfType<Player> ().room = barInstance;
break;
case 3:
bedroomInstance = Instantiate (bedroomPrefab) as Bedroom;
FindObjectOfType<Player> ().gameObject.transform.position = new Vector3(
bedroomInstance.GetSpawn ().x, 0f, bedroomInstance.GetSpawn ().z);
putinTransform.localPosition = new Vector3(0f, 0f, 0f);
FindObjectOfType<Player> ().room = bedroomInstance;
break;
case 4:
poolInstance = Instantiate (poolPrefab) as Pool;
FindObjectOfType<Player> ().gameObject.transform.position = new Vector3(
poolInstance.GetSpawn ().x, 0f, poolInstance.GetSpawn ().z);
putinTransform.localPosition = new Vector3(0f, 0f, 0f);
FindObjectOfType<Player> ().room = poolInstance;
break;
}
}
public void Play_game(){
BeginGame();
musicPlayer.GetComponent<MusicPlayer> ().transitionTo (2);
}
}
@@ -0,0 +1,236 @@
using UnityEngine;
using System.Collections;

public abstract class GenericRoom : MonoBehaviour {
public string name;
public string flavor;
//public RoomEvent[] roomEvents;
public IntVector2 size;
public RoomCell[,] tileGrid;
protected GameObject middle;
protected GameObject doorInstance;
public IntVector2 minSize;
public IntVector2 maxSize;
public GameObject doorPrefab;
public GameObject middlePrefab;
public IntVector2 middlePrefabGridSize;
public GameObject[] furniture;
public RoomCell cell;
public RoomCell[] doors;
public IntVector2 spawn;
public GameObject wall;
public int enemyProbability;
public int npcProbability;
public GameObject[] enemyPrefabs;
public Material wallMaterial;
public Material floorMaterial;
protected GameObject enemy;
public GameObject[] neutralPrefabs;
protected GameObject neutral;
protected bool isCorridor = false;

// Use this for initialization
void Awake () {
//roomEvents = [];
// Get the size and the grid
if (!isCorridor) {
size.x = Random.Range (minSize.x, maxSize.x);
size.z = Random.Range (minSize.z, maxSize.z);
tileGrid = new RoomCell[size.x, size.z];
// Generate the grid and make the walls
GenerateGrid ();
MakeWalls ();
// Get the door cells
doors = GetDoors ();
// Generate the middle
RoomCell middleCell = GetCellAt (new IntVector2 (size.x / 2 -1, size.z / 2 -1));
float floorY = gameObject.transform.position.y;
middle = Instantiate (middlePrefab) as GameObject;
middle.transform.position = middleCell.transform.position + new Vector3 (5f, 0f, 5f);
middle.transform.SetParent (this.transform);
GetCellAt (new IntVector2 (size.x / 2, size.z / 2)).setFull ();
GetCellAt (new IntVector2 (size.x / 2, size.z / 2 - 1)).setFull ();
GetCellAt (new IntVector2 (size.x / 2 - 1, size.z / 2)).setFull ();
GetCellAt (new IntVector2 (size.x / 2 - 1, size.z / 2 - 1)).setFull ();
// Fill with furniture

// Fill with NPCs
spawnNPCs ();
}
}

// Generates the grid
protected void GenerateGrid() {
for (int i = 0; i< size.x; i++) {
for (int j = 0; j< size.z; j++) {
RoomCell newCell = Instantiate (cell) as RoomCell;
newCell.name = "Room Cell at " + i + ", " + j;
newCell.gameObject.transform.GetChild(0).gameObject.GetComponent<Renderer>().material = floorMaterial;
tileGrid[i, j] = newCell;
newCell.transform.parent = transform;
newCell.transform.localPosition = new Vector3 (i - size.x * 0.5f + 0.5f,
0f, j - size.z * 0.5f + 0.5f);
}
}
}// Generate

public RoomCell GetCellAt(IntVector2 coords) {
try {
return tileGrid[coords.x, coords.z];
} catch (System.Exception e) {
return null;
}
}// getcellat

protected void MakeWalls() {
RoomCell theCell;
Vector3 cellPosition;
Transform wTransform;
// Set walls for south
for (int i = 0; i < size.x; i++) {
// Create the wall
wall = Instantiate(wall) as GameObject;
wall.GetComponent<Renderer>().material = wallMaterial;
wTransform = wall.transform;
// Get cell and set the wall as child
theCell = GetCellAt(new IntVector2(i, 0));
cellPosition = theCell.transform.position;
wTransform.SetParent(theCell.transform);
// Set wall position
wTransform.position = new Vector3(cellPosition.x, cellPosition.y + 5f, cellPosition.z-5f);
wTransform.localScale = 1 * Vector3.one;

}//for
// Set walls for north
for (int i = 0; i < size.x; i++) {
// Create the wall
wall = Instantiate(wall) as GameObject;
wall.GetComponent<Renderer>().material = wallMaterial;
wTransform = wall.transform;
// Get cell and set the wall as child
theCell = GetCellAt(new IntVector2(i, size.z-1));
cellPosition = theCell.transform.position;
wTransform.SetParent(theCell.transform);
// Set wall position
wTransform.position = new Vector3(cellPosition.x, cellPosition.y + 5f, cellPosition.z+5f);
wTransform.localScale = 1 * Vector3.one;
wTransform.rotation = Quaternion.Euler(0f, 0f, 0f);
}//for
// Set walls for east
for (int i = 0; i < size.z; i++) {
// Create the wall
wall = Instantiate(wall) as GameObject;
wall.GetComponent<Renderer>().material = wallMaterial;
wTransform = wall.transform;
// Get cell and set the wall as child
theCell = GetCellAt(new IntVector2(0, i));
cellPosition = theCell.transform.position;
wTransform.SetParent(theCell.transform);
// Set wall position
wTransform.position = new Vector3(cellPosition.x - 5f, cellPosition.y + 5f, cellPosition.z);
wTransform.localScale = 1 * Vector3.one;
wTransform.rotation = Quaternion.Euler(0f, -90f, 0f);
}//for
// Set walls for west
for (int i = 0; i < size.z; i++) {
// Create the wall
wall = Instantiate(wall) as GameObject;
wall.GetComponent<Renderer>().material = wallMaterial;
wTransform = wall.transform;
// Get cell and set the wall as child
theCell = GetCellAt(new IntVector2(size.x-1, i));
cellPosition = theCell.transform.position;
wTransform.SetParent(theCell.transform);
// Set wall position
wTransform.position = new Vector3(cellPosition.x + 5f, cellPosition.y + 5f, cellPosition.z);
wTransform.localScale = 1 * Vector3.one;
wTransform.rotation = Quaternion.Euler(0f, 90f, 0f);
}//for
}// makeWalls

// Randomise the doors, and also the enter door (spawn point in this room)
protected RoomCell[] GetDoors() {
// Number of doors
int numberOfDoors = Random.Range (1, 4);
int spawnDoor = Random.Range(0, numberOfDoors-1);
RoomCell[] doors = new RoomCell[numberOfDoors];
IntVector2 coords;

if (numberOfDoors > 0) {
coords = new IntVector2 (size.x-1, Random.Range (2, size.z - 2));
doors [--numberOfDoors] = GetCellAt (coords);
// If this is the spawn door
if (spawnDoor == numberOfDoors) {
spawn = new IntVector2 ((int)GetCellAt (coords).gameObject.transform.position.x,
(int)GetCellAt (coords).gameObject.transform.position.z);
}// if
}
if (numberOfDoors > 0) {
coords = new IntVector2 (Random.Range (2, size.x - 2), size.z-1);
doors [--numberOfDoors] = GetCellAt (coords);
// If this is the spawn door
if (spawnDoor == numberOfDoors) {
spawn = new IntVector2 ((int)GetCellAt (coords).gameObject.transform.position.x,
(int)GetCellAt (coords).gameObject.transform.position.z);
}// if
}
if (numberOfDoors > 0) {
coords = new IntVector2 (0, Random.Range (2, size.z - 2));
doors [--numberOfDoors] = GetCellAt (coords);
// If this is the spawn door
if (spawnDoor == numberOfDoors) {
spawn = new IntVector2 ((int)GetCellAt (coords).gameObject.transform.position.x,
(int)GetCellAt (coords).gameObject.transform.position.z);
}// if
}
if (numberOfDoors > 0) {
coords = new IntVector2 (Random.Range (2, size.x - 2), 0);
doors [--numberOfDoors] = GetCellAt (coords);
// If this is the spawn door
if (spawnDoor == numberOfDoors) {
spawn = new IntVector2 ((int)GetCellAt (coords).gameObject.transform.position.x,
(int)GetCellAt (coords).gameObject.transform.position.z);
}// if
}


// TODO : PUT DOORS ON WALLS
foreach (RoomCell door in doors) {
door.transform.GetChild(1).gameObject.GetComponent<WallControl>().door = true;
//door.transform.GetChild(1).gameObject.GetComponent<MeshRenderer>().material.color = Color.blue;

doorInstance = Instantiate(doorPrefab) as GameObject;
doorInstance.transform.SetParent(door.transform.GetChild(1).gameObject.GetComponent<WallControl>().gameObject.transform);
doorInstance.transform.localPosition = new Vector3(0f, 0f, -0.05f);
doorInstance.transform.localRotation = Quaternion.Euler(new Vector3(0f, 180f, 0f));
doorInstance.transform.localScale = new Vector3(0.1f, 0.1f, 0.3f);
}
return doors;
}// getDoors

public IntVector2 GetSpawn() {
return spawn;
}

// Spawn the npcs
public void spawnNPCs () {
for (int i=0; i<size.x; i++) {
for (int j=0; j<size.z; j++) {
// If spawn something
if (GetCellAt(new IntVector2(i, j)) != null && GetCellAt(new IntVector2(i, j)).isEmpty() && npcProbability > Random.Range (0, 100)) {
// If spawn enemies
if(enemyProbability > Random.Range(0, 100)){
// Spawn enemy
enemy = Instantiate(enemyPrefabs[Random.Range(0, enemyPrefabs.Length)]) as GameObject;
enemy.transform.position = GetCellAt(new IntVector2(i, j)).transform.position;
enemy.transform.SetParent(this.gameObject.transform);
} else {
neutral = Instantiate(neutralPrefabs[Random.Range(0, neutralPrefabs.Length)]) as GameObject;
neutral.transform.position = GetCellAt(new IntVector2(i, j)).transform.position;
neutral.transform.SetParent(this.gameObject.transform);
}// else
}//if
}// for
}// for
}// spawn npcs
}// class
@@ -0,0 +1,21 @@
using UnityEngine;
using System.Collections;

[System.Serializable]
public struct IntVector2 {

public int x, z;

// Constructor
public IntVector2 (int x, int z) {
this.x = x;
this.z = z;
}// constructor

// Add two vectors
public static IntVector2 operator + (IntVector2 a, IntVector2 b) {
a.x += b.x;
a.z += b.z;
return a;
}// operator +
}
@@ -0,0 +1,73 @@
using UnityEngine;
using System.Collections;

[AddComponentMenu("Camera-Control/Mouse Orbit with zoom")]
public class MouseOrbitImproved : MonoBehaviour {

public Transform target;
public float distance = 20.0f;
public float xSpeed = 120.0f;
public float ySpeed = 120.0f;

public float yMinLimit = -20f;
public float yMaxLimit = 80f;

public float distanceMin = .5f;
public float distanceMax = 15f;

private Rigidbody rigidbody;

float x = 0.0f;
float y = 0.0f;

// Use this for initialization
void Start ()
{
Vector3 angles = transform.eulerAngles;
x = angles.y;
y = angles.x;

rigidbody = GetComponent<Rigidbody>();

// Make the rigid body not change rotation
if (rigidbody != null)
{
rigidbody.freezeRotation = true;
}
}

void LateUpdate ()
{
if (target)
{
x += Input.GetAxis("Mouse X") * xSpeed * distance * 0.02f;
y -= Input.GetAxis("Mouse Y") * ySpeed * 0.01f;

y = ClampAngle(y, yMinLimit, yMaxLimit);

Quaternion rotation = Quaternion.Euler(y, x, 0);

distance = Mathf.Clamp(distance - Input.GetAxis("Mouse ScrollWheel")*5, distanceMin, distanceMax);

RaycastHit hit;
if (Physics.Linecast (target.position, transform.position, out hit))
{
distance -= hit.distance;
}
Vector3 negDistance = new Vector3(0.0f, 0.0f, -distance);
Vector3 position = rotation * negDistance + target.position;

transform.rotation = rotation;
//transform.position = position;
}
}

public static float ClampAngle(float angle, float min, float max)
{
if (angle < -360F)
angle += 360F;
if (angle > 360F)
angle -= 360F;
return Mathf.Clamp(angle, min, max);
}
}
@@ -0,0 +1,75 @@
using UnityEngine;
using System.Collections;
using UnityEngine.Audio;

public class MusicPlayer : MonoBehaviour {

public AudioMixerSnapshot intro;
public AudioMixerSnapshot inGame;
public AudioMixerSnapshot paused;
public AudioMixerSnapshot outro;
public AudioMixerSnapshot mute;

private AudioSource introSource;
private AudioSource inGameSource;
private AudioSource outroSource;
private AudioMixerSnapshot currentSnap;

private bool isMute = false;

public int bpm = 128;

private float timeTransition;
private float timeQuarterNote;

// Use this for initialization
void Awake () {
timeQuarterNote = 60 / bpm;
timeTransition = 4 * timeQuarterNote;

AudioSource[] sources = gameObject.GetComponents<AudioSource> ();
introSource = sources [0];
inGameSource = sources [1];
outroSource = sources [2];
}

public void transitionTo(int snapshot) {
switch (snapshot) {
case(1):
introSource.Play ();
intro.TransitionTo (timeTransition);
currentSnap = intro;
break;
case(2):
inGameSource.Play ();
inGame.TransitionTo (timeTransition);
currentSnap = inGame;
break;
case(3):
paused.TransitionTo (timeTransition);
currentSnap = paused;
break;
case(4):
outroSource.Play ();
outro.TransitionTo (timeTransition);
currentSnap = outro;
break;
}
}

public void Update() {
if (Input.GetKeyDown (KeyCode.M))
ToggleMute ();
}

private void ToggleMute() {
isMute = !isMute;

if (isMute) {
// Mute
mute.TransitionTo (4 * timeTransition);
} else {
currentSnap.TransitionTo (4 * timeTransition);
}
}
}
@@ -0,0 +1,233 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;

public class Player : MonoBehaviour {

public Transform putinTrans;

// ENJOY THE LEGACY CODE

public float speed;
public GameObject bul;
private GameObject bulIns;
public Transform bar;

public int mag,ammo;
public float nowTime, delayTime;

public int maxHP;
public int currentHP;

public int maxArmor;
public int armor;

public int level;
public int currentXP;
public int XPtoLVL;
public int ExtraDMG;
public int SexAppeal;

public int damage;
public AudioClip painSound;

public CharPanel panel;
public bool isPanelactive = false;
public Camera cam;

public GameObject vodkaPrefab;
public GameObject ammoPrefab;
public GameObject armorPrefab;

public GenericRoom room;

public bool[] weaponsEnabled;
[SerializeField]
public GameObject[] weapons;
public bool hasKnife = false;
private GameObject currentWeapon = null;
private GameObject canvas;
private int delay = 0;
private float cameraSensitivity;

// Use this for initialization
void Start () {

}
void Awake() {
panel = FindObjectOfType<CharPanel> ();
level = 1;
currentXP = 0;
XPtoLVL = 100;
maxHP = 100;
currentHP = maxHP;
ExtraDMG = 1;
cameraSensitivity = transform.FindChild("putin").GetComponent<ALexCamMovement>().sensitivity;

for (int i=0; i<weaponsEnabled.Length; i++) {
weaponsEnabled [i] = false;
}
weaponsEnabled [0] = true;
weaponsEnabled [1] = true;

EquipWeapon (1);
hasKnife = false;

canvas = GameObject.FindWithTag ("canvas");
}

// Update is called once per frame
void Update () {
if (delay % 20 == 0) {
delay = 0;
}
// if ((Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.S) || Input.GetKey (KeyCode.A) || Input.GetKey(KeyCode.D)) && !GetComponent<AudioSource>().isPlaying)
// GetComponent<AudioSource>().Play();
// XP slider test
if (Input.GetKeyDown (KeyCode.X))
GiveXP (10);
// dmg/slider test
if (Input.GetKeyDown (KeyCode.G))
armor = 100;
if (Input.GetKeyDown (KeyCode.F))
DamagePlayer (10);
//show character panel on C press
if (Input.GetKeyDown (KeyCode.C)) {
isPanelactive = !isPanelactive;
}
if (currentHP > 0 && !this.isPaused ()) {
this.doGameStuff ();
}
}

public bool isPaused() {
if (canvas.active) {
if (isPanelactive) {
panel.canvasGroup.alpha = 1f;
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
transform.FindChild ("putin").GetComponent<ALexCamMovement> ().actualSensitivity = 0;
// Paused, Don't shoot or do anything else
return true;
} else {
panel.canvasGroup.alpha = 0f;
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
transform.FindChild ("putin").GetComponent<ALexCamMovement> ().actualSensitivity = cameraSensitivity;
// Not paused, Continue updating
return false;
}
}
return false;
}

private void doGameStuff() {
// Reload
if (Input.GetKeyDown (KeyCode.R) && ammo > 0 && mag < 30) {
Reload ();
}
if (Input.GetKeyDown (KeyCode.Alpha1))
EquipWeapon (0);
if (Input.GetKeyDown (KeyCode.Alpha2))
EquipWeapon (1);
if (Input.GetKeyDown (KeyCode.Alpha3))
EquipWeapon (2);
if (Input.GetKeyDown (KeyCode.Alpha4))
EquipWeapon (3);
if (Input.GetKeyDown (KeyCode.Alpha5))
EquipWeapon (4);

// Zoom
cam.fieldOfView =Mathf.Clamp(cam.fieldOfView - Input.GetAxis("Mouse ScrollWheel")*20,35,80);

// Shoot i guess
if (currentWeapon.GetComponent<Weapon> ().name != "knife") {

if (Input.GetKey (KeyCode.Mouse0) && nowTime < Time.time && mag > 0) {

bulIns = Instantiate (bul, currentWeapon.transform.FindChild ("bar").transform.position, Quaternion.identity) as GameObject;
bulIns.GetComponent<Rigidbody> ().AddForceAtPosition (bar.transform.right * 100, transform.position, ForceMode.Impulse);
mag--;
nowTime = Time.time + delayTime;
delay = 0;
}// if
} else {
GameObject knife = currentWeapon;
if (Input.GetKeyDown (KeyCode.Mouse0) && nowTime < Time.time) {
knife.transform.localRotation = Quaternion.Euler (90f, 90f, 0f);
delay = 0;
hasKnife = true;
nowTime = Time.time + delayTime;
}
if(delay == 5){
knife.transform.localRotation = Quaternion.Euler (0f, 90f, 0f);
delay = 0;
hasKnife = false;
}
delay ++;
}
}// update

public void EquipWeapon (int value) {
if (value >= 0 && value < weaponsEnabled.Length && weaponsEnabled [value]) {
if(currentWeapon != null)
Destroy(currentWeapon.gameObject);
currentWeapon = weapons [value];
currentWeapon = Instantiate(currentWeapon) as GameObject;
currentWeapon.transform.SetParent(transform.FindChild("putin").transform.FindChild("weapon").transform);
currentWeapon.transform.localPosition = Vector3.zero;
currentWeapon.transform.localRotation = Quaternion.Euler(Vector3.zero);
if(currentWeapon.GetComponent<Weapon>().name != "knife") {
bar = currentWeapon.transform.FindChild("bar").transform;
}
else {
currentWeapon.transform.localRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f));
}
this.damage = currentWeapon.GetComponent<Weapon>().damage;
}
else {
EquipWeapon(1);
}
}
private void Reload() {
GetComponent<AudioSource> ().Play ();
int ammoToSubstract = 30 - mag;
mag = ammo >= ammoToSubstract ? 30 : mag + ammo;
ammo = ammo >= ammoToSubstract ? ammo - ammoToSubstract : 0;
}// Reload

public void GiveXP(int amount) {
currentXP += amount;
if (currentXP >= XPtoLVL) {
currentXP -= XPtoLVL;
LevelUp();
}
}
public void LevelUp(){
level++;
ExtraDMG += 2;
maxHP += (int)(maxHP * 0.1 * level);
maxArmor += (int)(maxArmor * 0.1 * level);
XPtoLVL =(int)(XPtoLVL*1.5);
}
public void DamagePlayer(int amount) {
if (armor >= amount) {
armor -= amount;
} else {
amount -= armor;
armor = 0;
}
if (currentHP >= amount) {
currentHP -= amount;
} else {
currentHP = 0;
}

AudioSource.PlayClipAtPoint (painSound, transform.position);
}//use when damaging player

public void setPanelActive(bool value) {
this.isPanelactive = value;
}
}
@@ -0,0 +1,15 @@
using UnityEngine;
using System.Collections;

public class Pool : GenericRoom {

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}
}
@@ -0,0 +1,15 @@
using UnityEngine;
using System.Collections;

public class Room : MonoBehaviour {

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}
}
@@ -0,0 +1,38 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class RoomCell : MonoBehaviour {

// The coordinates of this cell
public IntVector2 coordinates;
// The material
public Material material;
// The floor
private GameObject floor;
// If empty
public bool empty = true;

// Use this for initialization
void Awake () {
material = GetComponentInChildren<Renderer> ().material;
floor = GameObject.FindGameObjectWithTag("floor");
}

// Update is called once per frame
void Update () {

}

public void setEmpty() {
empty = true;
}

public void setFull() {
empty = false;
}

public bool isEmpty() {
return empty;
}
}
@@ -0,0 +1,41 @@
using UnityEngine;
using System.Collections;

public class TurnPutin : MonoBehaviour {
public float speed = 10f;
// Use this for initialization
void Start () {

}

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

void Turning ()
{
// Move player
transform.Translate (new Vector3 (Input.GetAxis ("Horizontal") * -speed * Time.deltaTime, 0f,
Input.GetAxis ("Vertical") * -speed * Time.deltaTime));
// Create a ray from the mouse cursor on screen in the direction of the camera.
Ray camRay = Camera.main.ScreenPointToRay (Input.mousePosition);

// Create a RaycastHit variable to store information about what was hit by the ray.
RaycastHit floorHit;

// Perform the raycast and if it hits something on the floor layer...
if(Physics.Raycast (camRay, out floorHit))
{
// Create a vector from the player to the point on the floor the raycast from the mouse hit.
Vector3 playerToMouse = -(floorHit.point - transform.position);
//Vector3 playerToMouse = new Vector3(Input.mousePosition.x, 0.0f, Input.mousePosition.y) - transform.position;

// Ensure the vector is entirely along the floor plane.
playerToMouse.y = 0f;
transform.LookAt(transform.position + playerToMouse, Vector3.up);

}// if
//Camera.main.gameObject.transform.position = transform.position + new Vector3(0f, 32.1f, 0f);
}// turning
}
@@ -0,0 +1,26 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class ArmorSlider : MonoBehaviour {
public Player player;
public float val;
public CanvasGroup canvasGroup;
// Use this for initialization
void Awake() {
canvasGroup = FindObjectOfType<CanvasGroup> ();
}
// Update is called once per frame
void Update () {

if (player == null)
player = FindObjectOfType<Player> ();
if (player.armor != 0){
canvasGroup.alpha = 1f;
GetComponent<Slider> ().value = player.armor;
}
else {
canvasGroup.alpha = 0f;
}
}
}
@@ -0,0 +1,16 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class CharPanel : MonoBehaviour {
public CanvasGroup canvasGroup;
// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}
}
@@ -0,0 +1,23 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class DmgDisp : MonoBehaviour {

public Player player;
public Text tex;


void Awake(){

tex = GetComponent<Text>();
}

void Update(){

if (player == null)
player = FindObjectOfType<Player>();

tex.text = "Extra DMG: " + player.ExtraDMG;
}
}
@@ -0,0 +1,23 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class GrabAmmo : MonoBehaviour {

public Player player;
public Text tex;


void Awake(){

tex = GetComponent<Text>();
}

void Update(){

if (player == null)
player = FindObjectOfType<Player>();

tex.text = "AMMO:" + player.mag + " / " + player.ammo;
}
}
@@ -0,0 +1,20 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class Hpslider : MonoBehaviour {
public Player player;

// Use this for initialization
void Start () {

}
void Awake() {
}
// Update is called once per frame
void Update () {
if (player == null)
player = FindObjectOfType<Player> ();
GetComponent<Slider> ().value = player.currentHP;
}
}
@@ -0,0 +1,23 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class LevelDIsplay : MonoBehaviour {

public Player player;
public Text tex;


void Awake(){

tex = GetComponent<Text>();
}

void Update(){

if (player == null)
player = FindObjectOfType<Player>();

tex.text = "Level: " + player.level;
}
}
@@ -0,0 +1,23 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class MaxHPDisplay : MonoBehaviour {

public Player player;
public Text tex;


void Awake(){

tex = GetComponent<Text>();
}

void Update(){

if (player == null)
player = FindObjectOfType<Player>();

tex.text = "Max HP: " + player.maxHP;
}
}
@@ -0,0 +1,23 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class SexDisp : MonoBehaviour {

public Player player;
public Text tex;


void Awake(){

tex = GetComponent<Text>();
}

void Update(){

if (player == null)
player = FindObjectOfType<Player>();

tex.text = "Sex Appeal: " + player.SexAppeal;
}
}
@@ -0,0 +1,17 @@
using UnityEngine;
using System.Collections;

public class UI_functions : MonoBehaviour {

public GameObject gameManager;

public void Quit(){
Application.Quit();
}
public void Restart() {
Application.LoadLevel (0);
}
public void Resume() {
gameManager.GetComponent<GameManager> ().unPauseGame ();
}
}
@@ -0,0 +1,20 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class XPSlider : MonoBehaviour {
public Player player;

// Use this for initialization
void Awake () {

}

// Update is called once per frame
void Update () {
if (player == null)
player = FindObjectOfType<Player> ();
GetComponent<Slider> ().value = player.currentXP;
GetComponent<Slider> ().maxValue = player.XPtoLVL;
}
}
@@ -0,0 +1,15 @@
using UnityEngine;
using System.Collections;

public class Wall : MonoBehaviour {

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}
}
@@ -0,0 +1,42 @@
using UnityEngine;
using System.Collections;

public class WallControl : MonoBehaviour {
public bool door = false;
// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}

void OnCollisionStay (Collision col)
{
if(door && col.gameObject.name == "putin" && Input.GetKey(KeyCode.E))
{
FindObjectOfType<Player>().gameObject.transform.position = new Vector3(1000f, 1000f, 1000f);
if(GameObject.Find("Corridor(Clone)")) {
Destroy(FindObjectOfType<Corridor>().gameObject);
}
if(GameObject.Find("ConferenceRoom(Clone)")) {
Destroy(FindObjectOfType<ConferenceRoom>().gameObject);
}
if(GameObject.Find("StartRoom")) {
Destroy(GameObject.Find("StartRoom").gameObject);
}
if(GameObject.Find("Bar(Clone)")) {
Destroy(GameObject.Find("Bar(Clone)").gameObject);
}
if(GameObject.Find("Bedroom(Clone)")) {
Destroy(GameObject.Find("Bedroom(Clone)").gameObject);
}
if(GameObject.Find("Pool(Clone)")) {
Destroy(GameObject.Find("Pool(Clone)").gameObject);
}
FindObjectOfType<GameManager>().newRoom();
}
}
}
@@ -0,0 +1,18 @@
using UnityEngine;
using System.Collections;

public class Weapon : MonoBehaviour {

public string name;
public int damage;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}
}
@@ -0,0 +1,16 @@
using UnityEngine;
using System.Collections;

public class knife : MonoBehaviour {

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}

}