Skip to content

Commit

Permalink
1.3.0.0 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
Nolenz committed Jul 2, 2020
1 parent 7e9b09d commit 0af5d84
Show file tree
Hide file tree
Showing 13 changed files with 446 additions and 35 deletions.
21 changes: 21 additions & 0 deletions WurstMod/Any/AICoverPoint.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace WurstMod.Any
{
/// <summary>
/// AI take cover here. Place on floor, rotation doesn't matter.
/// </summary>
public class AICoverPoint : MonoBehaviour
{
private void OnDrawGizmos()
{
Gizmos.color = new Color(0.0f, 0.6f, 0.0f, 0.5f);
Gizmos.matrix = transform.localToWorldMatrix;
Gizmos.DrawSphere(Vector3.zero, 0.1f);
}
}
}
21 changes: 21 additions & 0 deletions WurstMod/Any/FVRHandGrabPoint.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace WurstMod.Any
{
/// <summary>
/// Place this class on any geometry you want to be able to climb, like ladders!
/// Climbable geometry must be in the Interactable layer.
/// </summary>
public class FVRHandGrabPoint : MonoBehaviour
{
[Tooltip("A DISABLED gameObject visualizing the ability to grab this object. This is the glowy bit when your hands are near a ladder.")]
public GameObject UXGeo_Hover;

[Tooltip("A DISABLED gameObject visualizing you grabbing this object. This is the glowy bit when you are grabbing a ladder.")]
public GameObject UXGeo_Held;
}
}
37 changes: 37 additions & 0 deletions WurstMod/Any/FVRReverbEnvironment.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace WurstMod.Any
{
/// <summary>
/// Placed on an object with a non-trigger box collider, on the NoCol layer.
/// </summary>
public class FVRReverbEnvironment : MonoBehaviour
{
public enum FVRSoundEnvironment
{
None = 0,
Forest = 1,
InsideNarrow = 10,
InsideSmall = 11,
InsideWarehouse = 12,
InsideNarrowSmall = 13,
InsideLarge = 14,
InsideWarehouseSmall = 15,
InsideMedium = 16,
InsideLargeHighCeiling = 17,
OutsideOpen = 20,
OutsideEnclosed = 21,
OutsideEnclosedNarrow = 22,
SniperRange = 30,
ShootingRange = 31,
}

public FVRSoundEnvironment Environment;
public int Priority;

}
}
248 changes: 248 additions & 0 deletions WurstMod/Any/PMat.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace WurstMod.Any
{
public class PMat : MonoBehaviour
{
private readonly string[] DefResourcePaths = new string[]
{
"PMat_Acrylic",
"PMat_Air",
"PMat_Aluminum",
"PMat_Asphalt",
"PMat_Basalt",
"PMat_BotArmor",
"PMat_BotArmorLight",
"PMat_BotMeat",
"PMat_Brass",
"PMat_Brick",
"PMat_BulletPopLarge",
"PMat_BulletPopNormal",
"PMat_CandyCane",
"PMat_Carbon",
"PMat_Cardboard",
"PMat_Cement",
"PMat_ClayPigeon",
"PMat_Cloth",
"PMat_Concrete",
"PMat_Copper",
"PMat_Default",
"PMat_Dirt",
"PMat_Flesh",
"PMat_Glass",
"PMat_Granite",
"PMat_Ice",
"PMat_Iron",
"PMat_Lead",
"PMat_Maeblon",
"PMat_Marble",
"PMat_NanoFill",
"PMat_Osmium",
"PMat_Plaster",
"PMat_Plastic",
"PMat_Pumpkin",
"PMat_PVC",
"PMat_RotMeat",
"PMat_Rubber",
"PMat_Sand",
"PMat_SodaCanFull",
"PMat_Steel",
"PMat_SteelSword",
"PMat_Styrofoam",
"PMat_Tantalum",
"PMat_Titanium",
"PMat_Tungsten",
"PMat_Vanadium",
"PMat_Water",
"PMat_Wood",
"NONE"
};
public string GetDef(int idx) { return DefResourcePaths[idx]; }

public enum Def
{
Acrylic,
Air,
Aluminum,
Asphalt,
Basalt,
BotArmor,
BotArmorLight,
BotMeat,
Brass,
Brick,
BulletPopLarge,
BulletPopNormal,
CandyCane,
Carbon,
Cardboard,
Cement,
ClayPigeon,
Cloth,
Concrete,
Copper,
Default,
Dirt,
Flesh,
Glass,
Granite,
Ice,
Iron,
Lead,
Maeblon,
Marble,
NanoFill,
Osmium,
Plaster,
Plastic,
Pumpkin,
PVC,
RotMeat,
Rubber,
Sand,
SodaCanFull,
Steel,
SteelSword,
Styrofoam,
Tantalum,
Titanium,
Tungsten,
Vanadium,
Water,
Wood,
None
}




private readonly string[] MatDefResourcePaths = new string[]
{
"agents/GasMask",
"agents/HeavyArmor_Metal",
"agents/HeavyFabric",
"agents/LightArmor_Kevlar",
"agents/Meat",
"agents/MediumArmor_Metal",
"agents/MediumArmor_Padded",
"agents/RotMeat",
"heldobjects/Testing_MEat",
"heldobjects/Testing_Soft",
"nature/ground/Ground_Dirt",
"nature/ground/Ground_Grass",
"nature/ground/Ground_Sand",
"nature/ground/Ground_Water",
"nature/props/Hedge",
"nature/props/Rock_Large",
"nature/props/Rock_Small",
"props/Claypot",
"props/PlasticTableTop",
"props/Tires",
"props/WaterMelon",
"props/melee/Melee_Metal",
"props/melee/Melee_Polymer",
"props/melee/Melee_Wood",
"structural/armor/Armor_Solid",
"structural/armor/Armor_Thick",
"structural/armor/Armor_Thin",
"structural/barriers/ConcreteBarrier",
"structural/barriers/Sandbag",
"structural/barriers/Water",
"structural/floors/Floor_CarpetOverConcrete",
"structural/floors/Floor_CarpetOverWood",
"structural/floors/Floor_Concrete",
"structural/floors/Floor_Metal",
"structural/floors/Floor_MetalGrating",
"structural/floors/Floor_TileOverConcrete",
"structural/floors/Floor_TileOverConcreteSolid",
"structural/floors/Floor_TileOverWood",
"structural/floors/Floor_Wood",
"structural/metal/Metal_Plate",
"structural/metal/Metal_Sheet",
"structural/metal/Metal_Strut",
"structural/solid/_Impenetrable",
"structural/solid/Solid_Armor",
"structural/solid/Solid_Concrete",
"structural/solid/Solid_Metal",
"structural/walls/Wall_Brick",
"structural/walls/Wall_DryWall",
"structural/walls/Wall_GlassBrick",
"structural/walls/Wall_GlassWindow",
"structural/walls/Wall_SheetMetal",
"structural/walls/Wall_WoodSolid",
"structural/walls/Wall_WoodThick",
"structural/walls/Wall_WoodThin",
"thin/Paper"
};
public string GetMatDef(int idx) { return MatDefResourcePaths[idx]; }

public enum MatDef
{
GasMask,
HeavyArmor_Metal,
HeavyFabric,
LightArmor_Kevlar,
Meat,
MediumArmor_Metal,
MediumArmor_Padded,
RotMeat,
Testing_MEat,
Testing_Soft,
Ground_Dirt,
Ground_Grass,
Ground_Sand,
Ground_Water,
Hedge,
Rock_Large,
Rock_Small,
Claypot,
PlasticTableTop,
Tires,
WaterMelon,
Melee_Metal,
Melee_Polymer,
Melee_Wood,
Armor_Solid,
Armor_Thick,
Armor_Thin,
ConcreteBarrier,
Sandbag,
Water,
Floor_CarpetOverConcrete,
Floor_CarpetOverWood,
Floor_Concrete,
Floor_Metal,
Floor_MetalGrating,
Floor_TileOverConcrete,
Floor_TileOverConcreteSolid,
Floor_TileOverWood,
Floor_Wood,
Metal_Plate,
Metal_Sheet,
Metal_Strut,
_Impenetrable,
Solid_Armor,
Solid_Concrete,
Solid_Metal,
Wall_Brick,
Wall_DryWall,
Wall_GlassBrick,
Wall_GlassWindow,
Wall_SheetMetal,
Wall_WoodSolid,
Wall_WoodThick,
Wall_WoodThin,
Paper
}


[Tooltip("Not all static colliders (anything a bullet might hit) have a def. Is this for penetrative properties? Legacy?")]
public Def def;
[Tooltip("It seems like all static colliders (anything a bullet might hit) have a matDef.")]
public MatDef matDef;
}
}
9 changes: 5 additions & 4 deletions WurstMod/Any/Trigger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public enum TriggeredBy { Player, Sosig, Bullet, AnyRigidbody }
public enum TriggerType { Any, Each }

[RequireComponent(typeof(Collider))]
[AddComponentMenu("")] // TODO Disabled for now, need to figure out how to handle layer wonkiness... Force require box collider only and use bounds overlap?
class Trigger : MonoBehaviour
{
// Inspectables
Expand All @@ -30,7 +31,7 @@ class Trigger : MonoBehaviour
// TODO Rigidbody is the only tigger currently working.
void OnTriggerEnter(Collider other)
{
Debug.Log("SOMETHING entered trigger");
Debug.Log("SOMETHING entered trigger: " + other.gameObject.name);
if (IsCorrectType(other))
{
numInside++;
Expand Down Expand Up @@ -58,9 +59,9 @@ void OnTriggerExit(Collider other)
//TODO This will bug out "Each", need to cache valid parents, not objects this returns true on. Modify extension to return the parent object.
private bool IsCorrectType(Collider other)
{
bool triggerPlayer = triggeredBy == TriggeredBy.Player && other.GetComponentBidirectional<FistVR.FVRPlayerHitbox>() != null;
bool triggerSosig = triggeredBy == TriggeredBy.Sosig && other.GetComponentBidirectional<FistVR.Sosig>() != null;
bool triggerBullet = triggeredBy == TriggeredBy.Bullet && other.GetComponentBidirectional<FistVR.FVRProjectile>() != null;
bool triggerPlayer = triggeredBy == TriggeredBy.Player && other.GetComponentBidirectional<FistVR.FVRPlayerHitbox>() != null; // Does not work, collision bug
bool triggerSosig = triggeredBy == TriggeredBy.Sosig && other.GetComponentBidirectional<FistVR.Sosig>() != null; // Does not work, unknown
bool triggerBullet = triggeredBy == TriggeredBy.Bullet && other.GetComponentBidirectional<FistVR.FVRProjectile>() != null; // Does not work, collision bug
bool triggerAny = triggeredBy == TriggeredBy.AnyRigidbody && other.GetComponentBidirectional<Rigidbody>() != null;
return triggerPlayer || triggerSosig || triggerBullet || triggerAny;
}
Expand Down
1 change: 0 additions & 1 deletion WurstMod/Exporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using UnityEngine.UI;
using UnityEngine.SceneManagement;


namespace WurstMod
{
public enum LevelType { TNH, Generic };
Expand Down
Loading

0 comments on commit 0af5d84

Please sign in to comment.