The Huntress is a project of more than 40 students. Participants from all four programs work together on a single project, experiencing the teamwork, constraints and challenges of delivering a playable product.
15-weeks production
FPS Horror
Unity
Visual Studios C#
– Script C# systems : inventory, crafting, dialog and UI
– Create, document and maintain tools for designers
– Assist the design team and help to debug
– Integration of UI including quick slots, chest, documents and lootable
– Cheat Tools for inventories and crafting
– Multiple types of items with different functions depending on the inventory
– Scriptable objects saved with JSON
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/**********************
Fait par : Daisy
Derniere revision: 19-05-2021
***********************/
[CreateAssetMenu(fileName = "Inventory", menuName = "SO/Inventory")]
public class SO_Inventory : ScriptableObject
{
public int slots;
public List inv;
public SO_EventManager em;
private int stackChest = 99;
public static bool isFull = false;
public int UpdateItemAdd(SO_Items item, int amount = 1, bool isChest = false)
{
for (int i = 0; i < amount; i++)
{
bool addToSlot = false;
for (int j = 0; j < inv.Count; j++)
{
if (inv[j].item == item)
{
if (!isChest)
{
if (inv[j].amount < inv[j].item.maxStackSize)
{
inv[j].amount++;
item.qtyInventory++;
addToSlot = true;
break;
}
}
else
{
if (inv[j].amount < stackChest)
{
inv[j].amount++;
item.qtyChest++;
addToSlot = true;
break;
}
}
}
}
if (!addToSlot)
{
if (inv.Count + 1 > slots)
{
em.notifHUD.Invoke(1, true);
return amount - i;
}
else
{
inv.Add(new InvSlot() { item = item, amount = 1 });
if (!isChest)
{
item.qtyInventory++;
}
else
{
item.qtyChest++;
}
}
}
}
em.invEvent.Invoke(this);
return 0;
}
public void UpdateItemRemove(SO_Items item, int qtyRemove)
{
for (int i = inv.Count - 1; i >= 0; i--)
{
if (inv[i].item == item)
{
if(inv[i].amount <= qtyRemove)
{
qtyRemove -= inv[i].amount;
inv.Remove(inv[i]);
}
else
{
inv[i].amount -= qtyRemove;
break;
}
}
}
em.invEvent.Invoke(this);
}
public void Swap(int indexA, int indexB)
{
InvSlot tmp = inv[indexA];
inv[indexA] = inv[indexB];
inv[indexB] = tmp;
em.invEvent.Invoke(this);
}
public int EmptySlotCount
{
get
{
int counter = slots;
counter -= inv.Count;
//Debug.Log($"Il reste {counter} espace d'inventaire");
return counter;
}
}
public InvSlot FindItem(SO_Items item)
{
for (int i = 0; i < inv.Count; i++)
{
if (inv[i].item == item)
{
return inv[i];
}
}
return null;
}
public InvSlot GetEmptySlot()
{
for (int i = 0; i < inv.Count; i++)
{
if (inv[i].item == null)
{
return inv[i];
}
}
return null;
}
public void ResetInv()
{
for (int i = 0; i < inv.Count; i++)
{
inv[i].item.ResetAll();
}
inv.Clear();
}
}
[System.Serializable]
public class InvSlot
{
public int amount;
public SO_Items item;
}
– System of JSON Files – Convert all dialogues to ID efficiently
– Easy-to-use system for narration & level designer
– Tool of triggers with ID
– Integration of dialogues, notifications, objectives, tutorials
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
/**********************
Fait par : Daisy
Derniere revision: 17/06/2021
***********************/
public class Man_Dialogue : Singleton
{
private Dictionary dicoDialogue = new Dictionary();
void Start()
{
var dialogTxt = Resources.Load("dialogueFR");
Dialogue[] dataDialogue = JsonHelper.FromJson(dialogTxt.ToString());
for (int i = 0; i < dataDialogue.Length; i++)
{
dicoDialogue.Add(dataDialogue[i].id, dataDialogue[i].text);
}
}
public string GetDialogue(string key)
{
if(key == "") return ($"Aucune key id assigne");
if (dicoDialogue.ContainsKey(key)) {
return dicoDialogue[key];
}
else
{
return ($"L'id {key} n'existe pas");
}
}
}
[System.Serializable]
public class Dialogue
{
public string id;
public string text;
}
– NPC with chest inventory, save and crafting
– Design and create doors
– Key system to unlock doors and elevator