Reworked code, Code cleanup, No new Version
This commit is contained in:
84
Assets/Scripts/Handler/EasterEggHandler.cs
Normal file
84
Assets/Scripts/Handler/EasterEggHandler.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
using Steamworks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Scripts
|
||||
{
|
||||
class EasterEggHandler
|
||||
{
|
||||
public static void applyEasterEgg(Player player)
|
||||
{
|
||||
if (player.getPlayerName().ToLower().Length > 0)
|
||||
{
|
||||
applyNameEasterEgg(player);
|
||||
}
|
||||
}
|
||||
|
||||
private static void applyNameEasterEgg(Player player)
|
||||
{
|
||||
//maxHealth, maxSecondary, strength, dexterity, intelligence
|
||||
int[] result = new int[5];
|
||||
int[] stats = player.getStats();
|
||||
switch (player.getPlayerName().ToLower())
|
||||
{
|
||||
case "threetimes8":
|
||||
result[0] = 240;
|
||||
result[1] = 240;
|
||||
result[2] = 24;
|
||||
result[3] = 24;
|
||||
result[4] = 24;
|
||||
break;
|
||||
case "finnchen123":
|
||||
result[0] = 1230;
|
||||
result[1] = 1230;
|
||||
result[2] = 123;
|
||||
result[3] = 123;
|
||||
result[4] = 123;
|
||||
break;
|
||||
case "thefluffeypanda":
|
||||
result[0] = 470;
|
||||
result[1] = 470;
|
||||
result[2] = 47;
|
||||
result[3] = 47;
|
||||
result[4] = 47;
|
||||
break;
|
||||
case "nicola":
|
||||
result[0] = stats[1];
|
||||
result[1] = stats[3];
|
||||
result[2] = stats[4];
|
||||
result[3] = stats[5];
|
||||
result[4] = stats[6];
|
||||
SteamWorksHandler.getGodModeAchievement();
|
||||
break;
|
||||
default:
|
||||
result[0] = stats[1];
|
||||
result[1] = stats[3];
|
||||
result[2] = stats[4];
|
||||
result[3] = stats[5];
|
||||
result[4] = stats[6];
|
||||
break;
|
||||
}
|
||||
player.setStats(result);
|
||||
}
|
||||
|
||||
public static bool isGodMode(Player player)
|
||||
{
|
||||
bool result = false;
|
||||
if (player != null)
|
||||
{
|
||||
if (player.getPlayerName() != null)
|
||||
{
|
||||
if (player.getPlayerName().ToLower() == "nicola")
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user