Add source files

This commit is contained in:
2025-05-21 20:19:45 +02:00
parent 0f2a242b30
commit 71163fc589
284 changed files with 272526 additions and 1 deletions

View File

@@ -135,7 +135,7 @@ namespace BanquetForCyka {
}
}
[HarmonyPatch(typeof(LevelUp), "IncreaseAmount")]
[HarmonyPatch(typeof(LevelUp), "IncreaseAmt")]
public class Actions_IncreaseAmount {
public static void Postfix(ref int __result) {
Main.LogDebug("Original amount: " + __result, Main.debugLevelUpEntry);

View File

@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly-CSharp\Assembly-CSharp.csproj", "{7F2F647A-CC44-4F99-A411-8C0F6446A5CE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7F2F647A-CC44-4F99-A411-8C0F6446A5CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7F2F647A-CC44-4F99-A411-8C0F6446A5CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7F2F647A-CC44-4F99-A411-8C0F6446A5CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7F2F647A-CC44-4F99-A411-8C0F6446A5CE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
using System;
using UnityEngine;
// Token: 0x02000081 RID: 129
public class AddressablesManager : MonoBehaviour
{
}

View File

@@ -0,0 +1,149 @@
using System;
using UnityEngine;
// Token: 0x02000012 RID: 18
public class Ailment : MonoBehaviour
{
// Token: 0x0600018D RID: 397 RVA: 0x0001F899 File Offset: 0x0001DA99
private void OnEnable()
{
this.Reset();
}
// Token: 0x0600018E RID: 398 RVA: 0x0001F8A1 File Offset: 0x0001DAA1
private void Reset()
{
this._ProcAilment = false;
this._TileCount = 0;
this._TurnCount = 0;
}
// Token: 0x0600018F RID: 399 RVA: 0x0001F8B8 File Offset: 0x0001DAB8
public void Inflicted()
{
}
// Token: 0x06000190 RID: 400 RVA: 0x0001F8BA File Offset: 0x0001DABA
public void Healed(bool dead, bool doRemove)
{
}
// Token: 0x0400031C RID: 796
[Header("Table Info")]
public GameObject databaseObj;
// Token: 0x0400031D RID: 797
private GameObject databaseObjMain;
// Token: 0x0400031E RID: 798
public string _Table;
// Token: 0x0400031F RID: 799
public int tableID;
// Token: 0x04000320 RID: 800
public int _TurnCount;
// Token: 0x04000321 RID: 801
public int _TileCount;
// Token: 0x04000322 RID: 802
public int _CureID;
// Token: 0x04000323 RID: 803
public bool _ProcAilment;
// Token: 0x04000324 RID: 804
private float TotalProcs;
// Token: 0x04000325 RID: 805
public string _AilmentID;
// Token: 0x04000326 RID: 806
public string _ProcAction;
// Token: 0x04000327 RID: 807
public float _ProcTrigger;
// Token: 0x04000328 RID: 808
public float _TriggerCount;
// Token: 0x04000329 RID: 809
public string _EmitNoiseType;
// Token: 0x0400032A RID: 810
public string descriptionText;
// Token: 0x0400032B RID: 811
public string displayName;
// Token: 0x0400032C RID: 812
public int potency;
// Token: 0x0400032D RID: 813
[Header("Players")]
public Character targetAI;
// Token: 0x0400032E RID: 814
[Header("Players")]
public Character attackerAI;
// Token: 0x0400032F RID: 815
public Stats charInfo;
// Token: 0x04000330 RID: 816
public GameObject target;
// Token: 0x04000331 RID: 817
public GameObject attacker;
// Token: 0x04000332 RID: 818
public Item currItem;
// Token: 0x04000333 RID: 819
public string currAction;
// Token: 0x04000334 RID: 820
[Header("Misc")]
public bool fromLoad;
// Token: 0x04000335 RID: 821
public string typeText;
// Token: 0x04000336 RID: 822
public string cureText;
// Token: 0x04000337 RID: 823
public string effectPrefab = "";
// Token: 0x04000338 RID: 824
private StringFast str = new StringFast(64);
// Token: 0x04000339 RID: 825
private StringFast str1 = new StringFast(64);
// Token: 0x0400033A RID: 826
public AudioSource audio1;
// Token: 0x0400033B RID: 827
[Header("Progress")]
public int currTileCount;
// Token: 0x0400033C RID: 828
public int currTurnCount;
// Token: 0x0400033D RID: 829
public int currTriggerCount;
// Token: 0x0400033E RID: 830
public Vector3 currTilePos;
// Token: 0x0400033F RID: 831
public int aimLocation;
// Token: 0x04000340 RID: 832
public bool inflicted;
// Token: 0x04000341 RID: 833
public bool didFall;
}

View File

@@ -0,0 +1,228 @@
using System;
using System.Collections.Generic;
using UnityEngine;
// Token: 0x02000078 RID: 120
public class AllSounds : MonoBehaviour
{
// Token: 0x06000BAD RID: 2989 RVA: 0x000E10D4 File Offset: 0x000DF2D4
public AudioClip PlaySound(string type, int id, int num, string extra)
{
if (type == "Human")
{
if (id < this.characters.Count && id > -1)
{
if (num == 0)
{
this.curr = this.characters[id].walk;
}
if (num == 1)
{
this.curr = this.characters[id].run;
}
if (num == 2)
{
this.curr = this.characters[id].hit;
}
if (num == 3)
{
this.curr = this.characters[id].death;
}
if (num == 4)
{
this.curr = this.characters[id].jump;
}
if (num == 6)
{
this.curr = this.characters[id].idle;
}
if (num == 7)
{
this.curr = this.characters[id].hit;
}
if (this.curr != null)
{
if (this.curr.Count <= 0)
{
return null;
}
if (num == 0 && id == 0)
{
int num2 = 0;
int num3 = this.curr.Count;
if (extra.Contains("Guts"))
{
num2 = 15;
num3 = 20;
}
else if (extra.Contains("Fabric"))
{
num2 = 0;
num3 = 5;
}
else if (extra.Contains("Snow"))
{
num2 = 20;
num3 = 25;
}
else if (extra.Contains("Wood"))
{
num2 = 10;
num3 = 15;
}
else if (extra.Contains("Grass"))
{
num2 = 5;
num3 = 10;
}
else if (extra.Contains("Puddle"))
{
num2 = 25;
num3 = 30;
}
else if (extra.Contains("Sand"))
{
num2 = 30;
num3 = 35;
}
else if (extra.Contains("Rocks"))
{
num2 = 35;
num3 = 40;
}
return this.curr[Random.Range(num2, num3)];
}
return this.curr[Random.Range(0, this.curr.Count)];
}
}
this.curr = null;
return null;
}
if (type == "Animal")
{
if (num == 0)
{
this.curr = this.animals[id].walk;
}
if (num == 1)
{
this.curr = this.animals[id].run;
}
if (num == 2)
{
this.curr = this.animals[id].hit;
}
if (num == 3)
{
this.curr = this.animals[id].death;
}
if (num == 4)
{
this.curr = this.animals[id].melee;
}
if (num == 5)
{
this.curr = this.animals[id].range;
}
if (num == 6)
{
this.curr = this.animals[id].idle;
}
if (num == 7)
{
this.curr = this.animals[id].heard;
}
if (this.curr == null)
{
this.curr = null;
return null;
}
if (this.curr.Count > 0)
{
return this.curr[Random.Range(0, this.curr.Count)];
}
return null;
}
else if (type == "Talking")
{
if (num == 10)
{
this.curr = this.talking[id].happy;
}
if (num == 11)
{
this.curr = this.talking[id].neutral;
}
if (num == 12)
{
this.curr = this.talking[id].hostile;
}
if (num == 13)
{
this.curr = this.talking[id].question;
}
if (num == 14)
{
this.curr = this.talking[id].exclaim;
}
if (num == 15)
{
this.curr = this.talking[id].spooked;
}
if (this.curr == null)
{
this.curr = null;
return null;
}
if (this.curr.Count > 0)
{
return this.curr[Random.Range(0, this.curr.Count)];
}
return null;
}
else
{
if (!(type == "Critter"))
{
return null;
}
if (num == 0)
{
this.curr = this.critters[id].idle;
}
if (num == 1)
{
this.curr = this.critters[id].move;
}
if (num == 2)
{
this.curr = this.critters[id].death;
}
if (this.curr == null)
{
this.curr = null;
return null;
}
if (this.curr.Count > 0)
{
return this.curr[Random.Range(0, this.curr.Count)];
}
return null;
}
}
// Token: 0x040011EB RID: 4587
public List<SoundSet.CharacterSounds> characters = new List<SoundSet.CharacterSounds>();
// Token: 0x040011EC RID: 4588
public List<SoundSet.AnimalSounds> animals = new List<SoundSet.AnimalSounds>();
// Token: 0x040011ED RID: 4589
public List<SoundSet.HumanTalking> talking = new List<SoundSet.HumanTalking>();
// Token: 0x040011EE RID: 4590
public List<SoundSet.CritterSounds> critters = new List<SoundSet.CritterSounds>();
// Token: 0x040011EF RID: 4591
private List<AudioClip> curr;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,79 @@
using System;
using UnityEngine;
// Token: 0x0200005B RID: 91
public class AnimationFlags : MonoBehaviour
{
// Token: 0x06000B39 RID: 2873 RVA: 0x000DD3BF File Offset: 0x000DB5BF
private void Start()
{
this.ClearAll();
}
// Token: 0x06000B3A RID: 2874 RVA: 0x000DD3C8 File Offset: 0x000DB5C8
public void StartQTE()
{
this.startQTE = true;
Debug.Log("start qte " + Time.timeSinceLevelLoad.ToString());
}
// Token: 0x06000B3B RID: 2875 RVA: 0x000DD3F8 File Offset: 0x000DB5F8
public void HitTarget()
{
this.hitTarget = true;
Debug.Log("hit target " + Time.timeSinceLevelLoad.ToString());
}
// Token: 0x06000B3C RID: 2876 RVA: 0x000DD428 File Offset: 0x000DB628
public void LeavePocket()
{
this.end = true;
}
// Token: 0x06000B3D RID: 2877 RVA: 0x000DD431 File Offset: 0x000DB631
public void StartTargetFollow()
{
this.targetFollow = true;
}
// Token: 0x06000B3E RID: 2878 RVA: 0x000DD43A File Offset: 0x000DB63A
public void StartBounce()
{
this.bounce = true;
}
// Token: 0x06000B3F RID: 2879 RVA: 0x000DD443 File Offset: 0x000DB643
public void PlayAnimation()
{
this.animate = true;
}
// Token: 0x06000B40 RID: 2880 RVA: 0x000DD44C File Offset: 0x000DB64C
public void ClearAll()
{
this.end = false;
this.hitTarget = false;
this.startQTE = false;
this.targetFollow = false;
this.bounce = false;
this.animate = false;
}
// Token: 0x0400102E RID: 4142
public bool end;
// Token: 0x0400102F RID: 4143
public bool startQTE;
// Token: 0x04001030 RID: 4144
public bool hitTarget;
// Token: 0x04001031 RID: 4145
public bool targetFollow;
// Token: 0x04001032 RID: 4146
public bool bounce;
// Token: 0x04001033 RID: 4147
public bool animate;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,145 @@
using System;
using System.Collections.Generic;
using DarkTonic.MasterAudio;
using UnityEngine;
// Token: 0x02000013 RID: 19
public class Armor : MonoBehaviour
{
// Token: 0x06000192 RID: 402 RVA: 0x0001F8EC File Offset: 0x0001DAEC
private void Awake()
{
if (!this.tr)
{
this.tr = base.transform;
}
if (!this.camTr)
{
this.camTr = Links.x.worldCamera.gameObject.transform;
}
this.forw = Vector3.forward;
this.up = Vector3.up;
}
// Token: 0x06000193 RID: 403 RVA: 0x0001F950 File Offset: 0x0001DB50
public void UpdateArmor(int curr)
{
SpriteRenderer spriteRenderer = null;
this.currentArmor = curr;
float num = (float)this.pieces.Count;
float num2 = (float)this.maxArmor / num;
float num3 = (float)curr;
this.segments = num3;
for (int i = 0; i < this.pieces.Count; i++)
{
float num4 = (float)i * num2;
if (num3 > num4)
{
this.pieces[i].color = this.normal;
}
else
{
if (this.pieces[i].color == this.normal)
{
spriteRenderer = this.pieces[i];
}
this.pieces[i].color = this.broken;
}
}
if (spriteRenderer)
{
MasterAudio.PlaySound3DAtVector3AndForget("Armor Break", this.character.torsoPosition, 1f, new float?(1f), 0.5f, "", null);
RectTransform hannahAnimator = Links.x.cellar.GetHannahAnimator(1);
hannahAnimator.gameObject.SetActive(true);
hannahAnimator.gameObject.GetComponent<HannahAnimator>().Play("Idle");
Vector3 vector = Links.x.worldCamera.WorldToScreenPoint(spriteRenderer.transform.position);
vector.z = 0f;
vector.x = vector.x * (1920f / (float)Screen.width) - 960f;
vector.y = vector.y * (Links.x.canvasRT.sizeDelta.y / (float)Screen.height) - Links.x.canvasRT.sizeDelta.y / 2f;
hannahAnimator.localPosition = vector;
if (this.type == "Armor")
{
GameObject pooledGameObject = Links.x.cellar.GetPooledGameObject(119);
pooledGameObject.transform.position = this.character.torsoPosition;
pooledGameObject.SetActive(true);
this.str.Clear();
this.str.Append(this.character.stats.GetName());
this.str.Append("'s armor is damaged");
Links.x.gameFeed.AddFeed(this.str.ToString());
}
}
}
// Token: 0x06000194 RID: 404 RVA: 0x0001FBAB File Offset: 0x0001DDAB
public void End()
{
Object.Destroy(base.gameObject);
}
// Token: 0x06000195 RID: 405 RVA: 0x0001FBB8 File Offset: 0x0001DDB8
public void Setup(Character c, int max, int curr, string counterType)
{
this.character = c;
this.type = counterType;
this.currentArmor = curr;
this.maxArmor = max;
this.UpdateArmor(curr);
this.LateUpdate();
}
// Token: 0x06000196 RID: 406 RVA: 0x0001FBE4 File Offset: 0x0001DDE4
private void LateUpdate()
{
this.tr.LookAt(this.tr.position + this.camTr.rotation * this.forw, this.camTr.rotation * this.up);
if (this.type == "Armor")
{
this.tr.position = this.character.body.GetHead().position + new Vector3(0f, 1f, 0f);
return;
}
if (this.character.party)
{
this.tr.position = this.character.body.GetHead().position + new Vector3(0f, 1.1f, 0f);
return;
}
this.tr.position = this.character.body.GetHead().position + new Vector3(0f, 1.85f, 0f);
}
// Token: 0x04000342 RID: 834
public List<SpriteRenderer> pieces = new List<SpriteRenderer>();
// Token: 0x04000343 RID: 835
public Character character;
// Token: 0x04000344 RID: 836
public int maxArmor;
// Token: 0x04000345 RID: 837
public int currentArmor;
// Token: 0x04000346 RID: 838
public float segments;
// Token: 0x04000347 RID: 839
private Transform tr;
// Token: 0x04000348 RID: 840
private Transform camTr;
// Token: 0x04000349 RID: 841
private Vector3 forw;
// Token: 0x0400034A RID: 842
private Vector3 up;
// Token: 0x0400034B RID: 843
public Color normal;
// Token: 0x0400034C RID: 844
public Color broken;
// Token: 0x0400034D RID: 845
private StringFast str = new StringFast(32);
// Token: 0x0400034E RID: 846
public string type;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,382 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7F2F647A-CC44-4F99-A411-8C0F6446A5CE}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Assembly-CSharp</RootNamespace>
<AssemblyName>Assembly-CSharp</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="AstarPathfindingProject">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\AstarPathfindingProject.dll</HintPath>
</Reference>
<Reference Include="Boxophobic.TheVegetationEngine.Runtime">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\Boxophobic.TheVegetationEngine.Runtime.dll</HintPath>
</Reference>
<Reference Include="MagicaClothV2">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\MagicaClothV2.dll</HintPath>
</Reference>
<Reference Include="netstandard">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\netstandard.dll</HintPath>
</Reference>
<Reference Include="Unity.InputSystem">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\Unity.InputSystem.dll</HintPath>
</Reference>
<Reference Include="Unity.TextMeshPro">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\Unity.TextMeshPro.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AnimationModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.AnimationModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AudioModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.AudioModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.ImageConversionModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.ImageConversionModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.ParticleSystemModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.ParticleSystemModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PhysicsModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.TerrainModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.TerrainModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UIModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.UIModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.VideoModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.VideoModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.VRModule">
<HintPath>..\..\..\..\..\..\..\..\..\..\Games\Banquet.for.Fools.Build.18497011\Banquet for Fools_Data\Managed\UnityEngine.VRModule.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Compile Include="Actions.cs" />
<Compile Include="AddressablesManager.cs" />
<Compile Include="Ailment.cs" />
<Compile Include="AllSounds.cs" />
<Compile Include="AnimateButton.cs" />
<Compile Include="AnimationFlags.cs" />
<Compile Include="Archives.cs" />
<Compile Include="Armor.cs" />
<Compile Include="ArrowKit.cs" />
<Compile Include="AttackAI.cs" />
<Compile Include="AudioListenForMain.cs" />
<Compile Include="AudioSourceDebugging.cs" />
<Compile Include="Bag.cs" />
<Compile Include="BakedMeshAnimation.cs" />
<Compile Include="BakedMeshAnimator.cs" />
<Compile Include="BakedMeshAnimatorUpdater.cs" />
<Compile Include="Billboard.cs" />
<Compile Include="BirdMaterialChanger.cs" />
<Compile Include="Boat.cs" />
<Compile Include="Body.cs" />
<Compile Include="BoneListener.cs" />
<Compile Include="Books.cs" />
<Compile Include="Boro.cs" />
<Compile Include="Breakable.cs" />
<Compile Include="BreakableActions.cs" />
<Compile Include="BtnAlphaThreshold.cs" />
<Compile Include="ButtonMultiTargets.cs" />
<Compile Include="ButtonSmartNavigation.cs" />
<Compile Include="ByeProbuilder.cs" />
<Compile Include="cakeslice\LinkedSet.cs" />
<Compile Include="cakeslice\LinkedSetGlow.cs" />
<Compile Include="cakeslice\Outline.cs" />
<Compile Include="cakeslice\OutlineEffect.cs" />
<Compile Include="cakeslice\OutlineEffectGlow.cs" />
<Compile Include="cakeslice\OutlineGlow.cs" />
<Compile Include="CameraControls.cs" />
<Compile Include="CameraEffects.cs" />
<Compile Include="CameraFogOfWar.cs" />
<Compile Include="CameraParams.cs" />
<Compile Include="CaptureAreaInfo.cs" />
<Compile Include="CaptureBackgrounds.cs" />
<Compile Include="Cellar.cs" />
<Compile Include="Character.cs" />
<Compile Include="CharacterQuips.cs" />
<Compile Include="Chest.cs" />
<Compile Include="ChestActions.cs" />
<Compile Include="Cinematics.cs" />
<Compile Include="ClayShaderVariables.cs" />
<Compile Include="CleanIK.cs" />
<Compile Include="CollectCharacters.cs" />
<Compile Include="CollisionListener.cs" />
<Compile Include="Combat.cs" />
<Compile Include="CompanionDrop.cs" />
<Compile Include="CompanionIcon.cs" />
<Compile Include="ContentSizeFitterEx.cs" />
<Compile Include="CoolAudioSource.cs" />
<Compile Include="CopyShadows.cs" />
<Compile Include="CopyShadowsBaker.cs" />
<Compile Include="CreateCircle.cs" />
<Compile Include="Creation.cs" />
<Compile Include="CreationSkills.cs" />
<Compile Include="CreatureActions.cs" />
<Compile Include="CreatureBoat.cs" />
<Compile Include="Creatures.cs" />
<Compile Include="CritterActions.cs" />
<Compile Include="Critters.cs" />
<Compile Include="Culling.cs" />
<Compile Include="Data.cs" />
<Compile Include="DeathScreen.cs" />
<Compile Include="Dialogue.cs" />
<Compile Include="DialogueSounds.cs" />
<Compile Include="Diorama.cs" />
<Compile Include="DockFriend.cs" />
<Compile Include="Door.cs" />
<Compile Include="DoorActions.cs" />
<Compile Include="DrawBounds.cs" />
<Compile Include="DrawMesh.cs" />
<Compile Include="DrawSettingController.cs" />
<Compile Include="DrawSettings.cs" />
<Compile Include="DrawViewController.cs" />
<Compile Include="Effects.cs" />
<Compile Include="EnchantItem.cs" />
<Compile Include="EnemyGroup.cs" />
<Compile Include="EnvironmentNodes.cs" />
<Compile Include="Equipment.cs" />
<Compile Include="Fauna.cs" />
<Compile Include="Fellowship.cs" />
<Compile Include="Flag.cs" />
<Compile Include="FloatExtensions.cs" />
<Compile Include="FlockChild.cs" />
<Compile Include="FlockChildSound.cs" />
<Compile Include="FlockController.cs" />
<Compile Include="FlockScare.cs" />
<Compile Include="FlockWaypointTrigger.cs" />
<Compile Include="Forfeits.cs" />
<Compile Include="Formation.cs" />
<Compile Include="FOWRevealer.cs" />
<Compile Include="FOWRevealerInterior.cs" />
<Compile Include="FOWSystem.cs" />
<Compile Include="FOWSystemInterior.cs" />
<Compile Include="FPS.cs" />
<Compile Include="Gaia.cs" />
<Compile Include="GameCard.cs" />
<Compile Include="GameFeed.cs" />
<Compile Include="Gameplay.cs" />
<Compile Include="GameSecondCounter.cs" />
<Compile Include="GatherEmeraldsXP.cs" />
<Compile Include="Gauge.cs" />
<Compile Include="GhostBrush.cs" />
<Compile Include="Gore.cs" />
<Compile Include="GoreListen.cs" />
<Compile Include="GroundBag.cs" />
<Compile Include="GroundItemText.cs" />
<Compile Include="Groupies.cs" />
<Compile Include="guiE3.cs" />
<Compile Include="guiMenu.cs" />
<Compile Include="HannahAnimator.cs" />
<Compile Include="HannahAnimatorSimple.cs" />
<Compile Include="HUD.cs" />
<Compile Include="Huddle.cs" />
<Compile Include="HuddleButton.cs" />
<Compile Include="InputActions.cs" />
<Compile Include="InputControls.cs" />
<Compile Include="Interact.cs" />
<Compile Include="InteractionIconAnimator.cs" />
<Compile Include="Interactive.cs" />
<Compile Include="InteriorLights.cs" />
<Compile Include="Inventory.cs" />
<Compile Include="InventoryContainer.cs" />
<Compile Include="Item.cs" />
<Compile Include="ItemBook.cs" />
<Compile Include="ItemCard.cs" />
<Compile Include="ItemCollector.cs" />
<Compile Include="ItemEquipped.cs" />
<Compile Include="ItemLabelGrid.cs" />
<Compile Include="Journal.cs" />
<Compile Include="JournalScroll.cs" />
<Compile Include="KeyboardScript.cs" />
<Compile Include="KeyControl.cs" />
<Compile Include="KeyDrag.cs" />
<Compile Include="KeyDrop.cs" />
<Compile Include="LandingButtons.cs" />
<Compile Include="LandingSpot.cs" />
<Compile Include="LandingSpotController.cs" />
<Compile Include="LevelUp.cs" />
<Compile Include="Library.cs" />
<Compile Include="LibrarySetup.cs" />
<Compile Include="LineWave.cs" />
<Compile Include="LineWaveCollider.cs" />
<Compile Include="Links.cs" />
<Compile Include="ListenerQTE.cs" />
<Compile Include="LookAtCamera.cs" />
<Compile Include="LookAtController.cs" />
<Compile Include="LOS\AttackShapes.cs" />
<Compile Include="LOS\ILOSSource.cs" />
<Compile Include="LOS\LineOfSightCone.cs" />
<Compile Include="LOS\LOSBufferStorage.cs" />
<Compile Include="LOS\LOSCuller.cs" />
<Compile Include="LOS\LOSFinalResolve.cs" />
<Compile Include="LOS\LOSHelper.cs" />
<Compile Include="LOS\LOSLayerExcluder.cs" />
<Compile Include="LOS\LOSManager.cs" />
<Compile Include="LOS\LOSQualityLevel.cs" />
<Compile Include="LOS\LOSSource.cs" />
<Compile Include="LOS\Materials.cs" />
<Compile Include="LOS\PixelOperation.cs" />
<Compile Include="LOS\PointLightShadows.cs" />
<Compile Include="LOS\ShaderID.cs" />
<Compile Include="LOS\Shaders.cs" />
<Compile Include="LOS\Util.cs" />
<Compile Include="MainMenu.cs" />
<Compile Include="Manual.cs" />
<Compile Include="MapConfirm.cs" />
<Compile Include="MapExit.cs" />
<Compile Include="MapExitActions.cs" />
<Compile Include="MapExitIcon.cs" />
<Compile Include="MapPawn.cs" />
<Compile Include="MapPiece.cs" />
<Compile Include="MaskColors.cs" />
<Compile Include="meanPos.cs" />
<Compile Include="MechanimSounds.cs" />
<Compile Include="MenuCameraCrossFade.cs" />
<Compile Include="MenuInputActions.cs" />
<Compile Include="Merchant.cs" />
<Compile Include="MeshSaver.cs" />
<Compile Include="Minigame.cs" />
<Compile Include="MiniMap.cs" />
<Compile Include="Moonlight.cs" />
<Compile Include="MoonlightRevealer.cs" />
<Compile Include="MoonlightSystem.cs" />
<Compile Include="MouseOrbitImproved.cs" />
<Compile Include="MTE\TileContainer.cs" />
<Compile Include="MultiTargetGraphics.cs" />
<Compile Include="NGSSFrustumShadowsSS.cs" />
<Compile Include="Options.cs" />
<Compile Include="OverHeadUI.cs" />
<Compile Include="OverworldMap.cs" />
<Compile Include="OverworldMapMenu.cs" />
<Compile Include="ParticleSunRotation.cs" />
<Compile Include="PartyCollider.cs" />
<Compile Include="Pickups.cs" />
<Compile Include="Pin.cs" />
<Compile Include="PinHolder.cs" />
<Compile Include="PlayerBorders.cs" />
<Compile Include="PlayVideo.cs" />
<Compile Include="Pocket.cs" />
<Compile Include="Pointer.cs" />
<Compile Include="Portrait.cs" />
<Compile Include="Projectile.cs" />
<Compile Include="PromptActions.cs" />
<Compile Include="Prompts.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Puzzle.cs" />
<Compile Include="PuzzleActions.cs" />
<Compile Include="PuzzleListener.cs" />
<Compile Include="QTE.cs" />
<Compile Include="QuestEnd.cs" />
<Compile Include="QuestObjects.cs" />
<Compile Include="QuestTimePoint.cs" />
<Compile Include="QuipSet.cs" />
<Compile Include="RallyStage.cs" />
<Compile Include="RandomAnimationStart.cs" />
<Compile Include="RandomMaterial.cs" />
<Compile Include="Records.cs" />
<Compile Include="RenderPortraits.cs" />
<Compile Include="RenderPortraitSetup.cs" />
<Compile Include="rendertype.cs" />
<Compile Include="ResourceLocation.cs" />
<Compile Include="Rest.cs" />
<Compile Include="RoleSheet.cs" />
<Compile Include="Rope.cs" />
<Compile Include="RtsCamera.cs" />
<Compile Include="SaveKeeper.cs" />
<Compile Include="SaveLoad.cs" />
<Compile Include="SceneCamera.cs" />
<Compile Include="SceneInfo.cs" />
<Compile Include="SceneItem.cs" />
<Compile Include="SceneMap.cs" />
<Compile Include="SceneMapRender.cs" />
<Compile Include="ScrollRectNoDragging.cs" />
<Compile Include="SelectionBox.cs" />
<Compile Include="SelectionCircle.cs" />
<Compile Include="Sensory.cs" />
<Compile Include="SetSpellMaterial.cs" />
<Compile Include="ShadowCaster.cs" />
<Compile Include="ShadowCasterBaker.cs" />
<Compile Include="SkillBag.cs" />
<Compile Include="SkillButton.cs" />
<Compile Include="SoundSet.cs" />
<Compile Include="Spellcrafting.cs" />
<Compile Include="SpellVine.cs" />
<Compile Include="StackSplit.cs" />
<Compile Include="Stamina.cs" />
<Compile Include="Stats.cs" />
<Compile Include="StatusRing.cs" />
<Compile Include="StopMotionAnimations.cs" />
<Compile Include="StringFast.cs" />
<Compile Include="StringSplitter.cs" />
<Compile Include="Sunlight.cs" />
<Compile Include="TerrainDetailDistance.cs" />
<Compile Include="TextFieldBehavior.cs" />
<Compile Include="TextParser.cs" />
<Compile Include="TileEffects.cs" />
<Compile Include="TimedBreakable.cs" />
<Compile Include="TimelineIcon.cs" />
<Compile Include="TimeOfDay.cs" />
<Compile Include="Tooltip.cs" />
<Compile Include="ToonyColorsPro\Runtime\PlanarReflection.cs" />
<Compile Include="TranslateShaderOffset.cs" />
<Compile Include="UITriggerButton.cs" />
<Compile Include="UndergroundMap.cs" />
<Compile Include="UndergroundMapPiece.cs" />
<Compile Include="UnitySourceGeneratedAssemblyMonoScriptTypes_v1.cs" />
<Compile Include="UnityStandardAssets\ImageEffects\BlurOptimized.cs" />
<Compile Include="UnluckDistanceDisabler.cs" />
<Compile Include="Vignettes.cs" />
<Compile Include="Vine.cs" />
<Compile Include="WaterCollisions.cs" />
<Compile Include="WindowHandles.cs" />
<Compile Include="Windows.cs" />
<Compile Include="Wings.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,242 @@
using System;
using System.Collections;
using UnityEngine;
// Token: 0x02000015 RID: 21
public class AudioListenForMain : MonoBehaviour
{
// Token: 0x0600020F RID: 527 RVA: 0x0002C690 File Offset: 0x0002A890
private void Start()
{
this.coolAudio = base.gameObject.GetComponent<CoolAudioSource>();
this.coolAudio.audioSource.volume = 0f;
this.distance = this.coolAudio.audioSource.maxDistance;
this.offDistance = this.distance + 10f;
this.position = base.gameObject.transform.position;
this.maxAudioVolume = 1f;
if (this.coolAudio.is2D)
{
this.maxAudioVolume = 0.9f;
if (this.coolAudio.audioSource.clip.name.Contains("Bar"))
{
this.maxAudioVolume = 0.5f;
}
if (this.coolAudio.audioSource.clip.name.Contains("Rozafir"))
{
this.keepPlayingThroughInterior = true;
}
}
if (this.coolAudio.audioSource.clip.name.Contains("RozafirDrums"))
{
this.listenForCharacter = true;
this.overrideMainSoundtrack = true;
this.characterListenName = "RozafirDancerFlutist";
}
}
// Token: 0x06000210 RID: 528 RVA: 0x0002C7B4 File Offset: 0x0002A9B4
private void Update()
{
if (Links.x.hasMain)
{
if (!Records.x.inMenus && !Links.x.gaia.loadingCharacterCreation)
{
float sqrMagnitude = (Links.x.main.currentPosition - this.position).sqrMagnitude;
if (sqrMagnitude < this.distance * this.distance)
{
bool flag = false;
if (this.listenForCharacter)
{
if (!this.character)
{
this.character = Links.x.diorama.FindCharacterAnyState(this.characterListenName);
}
if (this.character && !this.character.dead && !this.character.stunned)
{
flag = true;
}
}
if (!this.inRange && (this.coolAudio.playEveryTimePlayerIsNear || this.endAudio == null) && (!this.listenForCharacter || flag))
{
this.coolAudio.audioSource.Play();
if (this.endAudio == null)
{
this.coolAudio.audioSource.volume = 0f;
}
this.inRange = true;
this.StartAudioBegin();
}
}
else if (this.inRange && sqrMagnitude > this.offDistance * this.offDistance && this.endAudio == null)
{
if (this.keepPlayingThroughInterior)
{
if (!(Links.x.rtsCamera.currentBoundsName == "interior_frog_bridgeA") && !Links.x.cameraEffects.transitioning)
{
this.StartAudioEnd();
}
}
else
{
this.StartAudioEnd();
}
}
}
if (this.playing && Links.x.gaia.loadingCharacterCreation)
{
this.StartAudioEnd();
}
}
}
// Token: 0x06000211 RID: 529 RVA: 0x0002C974 File Offset: 0x0002AB74
private void StartAudioBegin()
{
if (this.startAudio == null)
{
this.startAudio = this.AudioFadeIn();
base.StartCoroutine(this.startAudio);
}
}
// Token: 0x06000212 RID: 530 RVA: 0x0002C998 File Offset: 0x0002AB98
private void OnDisable()
{
if (this.endAudio != null)
{
base.StopCoroutine(this.endAudio);
this.endAudio = null;
}
if (this.inRange)
{
if (Links.x.hasMain && ((this.coolAudio.loopIt && this.overrideMainSoundtrack) || !this.coolAudio.loopIt))
{
Links.x.gaia.playingSoundtrackFromInWorld = false;
Links.x.gaia.SetEnvironmentPlaylist(Links.x.gameplay.sailing, Links.x.main.inTown, true);
}
this.inRange = false;
this.coolAudio.audioSource.Stop();
}
if (this.startAudio != null)
{
base.StopCoroutine(this.startAudio);
this.startAudio = null;
if (Links.x.hasMain && ((this.coolAudio.loopIt && this.overrideMainSoundtrack) || !this.coolAudio.loopIt))
{
Links.x.gaia.playingSoundtrackFromInWorld = false;
Links.x.gaia.SetEnvironmentPlaylist(Links.x.gameplay.sailing, Links.x.main.inTown, true);
}
this.inRange = false;
}
}
// Token: 0x06000213 RID: 531 RVA: 0x0002CADF File Offset: 0x0002ACDF
private IEnumerator AudioFadeIn()
{
if ((this.coolAudio.loopIt && this.overrideMainSoundtrack) || !this.coolAudio.loopIt)
{
Links.x.gaia.playingSoundtrackFromInWorld = true;
Links.x.gaia.FadeOutPlaylist(true, 0.5f);
}
float startValue = this.coolAudio.audioSource.volume;
float num = Links.x.options.soundVolume * this.maxAudioVolume;
float timeToLerp = 3f;
float percentage = 0f;
float startTime = Time.realtimeSinceStartup;
while (percentage < 1f)
{
num = Links.x.options.soundVolume;
num *= this.maxAudioVolume;
percentage = (Time.realtimeSinceStartup - startTime) / timeToLerp;
float num2 = Mathf.Lerp(startValue, num, percentage);
this.coolAudio.audioSource.volume = num2;
yield return null;
}
this.startAudio = null;
yield break;
}
// Token: 0x06000214 RID: 532 RVA: 0x0002CAEE File Offset: 0x0002ACEE
private void StartAudioEnd()
{
if (this.endAudio == null)
{
this.endAudio = this.AudioFadeOut();
base.StartCoroutine(this.endAudio);
}
}
// Token: 0x06000215 RID: 533 RVA: 0x0002CB11 File Offset: 0x0002AD11
private IEnumerator AudioFadeOut()
{
this.playing = false;
float startValue = this.coolAudio.audioSource.volume;
float endValue = 0f;
float timeToLerp = 3f;
float percentage = 0f;
float startTime = Time.realtimeSinceStartup;
while (percentage < 1f)
{
percentage = (Time.realtimeSinceStartup - startTime) / timeToLerp;
float num = Mathf.Lerp(startValue, endValue, percentage);
this.coolAudio.audioSource.volume = num;
yield return null;
}
if (Links.x.hasMain && ((this.coolAudio.loopIt && this.overrideMainSoundtrack) || !this.coolAudio.loopIt))
{
Links.x.gaia.playingSoundtrackFromInWorld = false;
Links.x.gaia.SetEnvironmentPlaylist(Links.x.gameplay.sailing, Links.x.main.inTown, true);
}
this.inRange = false;
this.coolAudio.audioSource.Stop();
if (!this.coolAudio.playEveryTimePlayerIsNear)
{
float num2 = Random.Range(3f, 5f) * 60f;
yield return new WaitForSeconds(num2);
}
this.endAudio = null;
yield break;
}
// Token: 0x040003D7 RID: 983
public CoolAudioSource coolAudio;
// Token: 0x040003D8 RID: 984
private float distance;
// Token: 0x040003D9 RID: 985
private float offDistance;
// Token: 0x040003DA RID: 986
private Vector3 position;
// Token: 0x040003DB RID: 987
public bool inRange;
// Token: 0x040003DC RID: 988
public bool playing;
// Token: 0x040003DD RID: 989
public bool keepPlayingThroughInterior;
// Token: 0x040003DE RID: 990
public bool listenForCharacter;
// Token: 0x040003DF RID: 991
public string characterListenName;
// Token: 0x040003E0 RID: 992
private IEnumerator startAudio;
// Token: 0x040003E1 RID: 993
private IEnumerator endAudio;
// Token: 0x040003E2 RID: 994
private float maxAudioVolume;
// Token: 0x040003E3 RID: 995
private Character character;
// Token: 0x040003E4 RID: 996
private bool overrideMainSoundtrack;
}

View File

@@ -0,0 +1,14 @@
using System;
using UnityEngine;
// Token: 0x0200008B RID: 139
public class AudioSourceDebugging : MonoBehaviour
{
// Token: 0x06000DDB RID: 3547 RVA: 0x00105600 File Offset: 0x00103800
private void Update()
{
}
// Token: 0x04001664 RID: 5732
private AudioSource[] sources;
}

View File

@@ -0,0 +1,86 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
// Token: 0x02000095 RID: 149
public class Bag : MonoBehaviour
{
// Token: 0x06000E5E RID: 3678 RVA: 0x0011444A File Offset: 0x0011264A
private void Awake()
{
this.Setup();
}
// Token: 0x06000E5F RID: 3679 RVA: 0x00114454 File Offset: 0x00112654
public void Setup()
{
if (this.gridTrs.Count == 0)
{
foreach (object obj in this.gridTr)
{
Transform transform = (Transform)obj;
if (transform != this.gridTr)
{
this.gridImg.Add(transform.gameObject.GetComponent<Image>());
this.gridTrs.Add(transform);
this.gridState.Add(false);
transform.gameObject.GetComponent<Image>().sprite = this.emptySprite;
}
}
}
}
// Token: 0x06000E60 RID: 3680 RVA: 0x00114508 File Offset: 0x00112708
public void End()
{
for (int i = 0; i < this.gridImg.Count; i++)
{
if (!this.gridImg[i].sprite != this.emptySprite)
{
this.gridImg[i].sprite = this.emptySprite;
}
this.gridState[i] = false;
}
}
// Token: 0x06000E61 RID: 3681 RVA: 0x00114578 File Offset: 0x00112778
public Vector3 SubtractVectors(Vector3 a, Vector3 b)
{
Vector3 vector;
vector.x = a.x - b.x;
vector.y = a.y - b.y;
vector.z = a.z - b.z;
return vector;
}
// Token: 0x040016D9 RID: 5849
public Transform gridTr;
// Token: 0x040016DA RID: 5850
public int gridAmt;
// Token: 0x040016DB RID: 5851
public int mainBagX = 6;
// Token: 0x040016DC RID: 5852
public int mainBagY = 6;
// Token: 0x040016DD RID: 5853
public List<Image> gridImg = new List<Image>();
// Token: 0x040016DE RID: 5854
public List<bool> gridState = new List<bool>();
// Token: 0x040016DF RID: 5855
public List<Transform> gridTrs = new List<Transform>();
// Token: 0x040016E0 RID: 5856
public List<int> dragHoverImg = new List<int>();
// Token: 0x040016E1 RID: 5857
public bool secondary;
// Token: 0x040016E2 RID: 5858
public Sprite emptySprite;
}

View File

@@ -0,0 +1,37 @@
using System;
using UnityEngine;
// Token: 0x020000FB RID: 251
public class BakedMeshAnimation : MonoBehaviour
{
// Token: 0x040025D0 RID: 9680
public Mesh[] meshes;
// Token: 0x040025D1 RID: 9681
public float playSpeed = 30f;
// Token: 0x040025D2 RID: 9682
[HideInInspector]
public Renderer rendererComponent;
// Token: 0x040025D3 RID: 9683
public bool randomStartFrame = true;
// Token: 0x040025D4 RID: 9684
public bool loop = true;
// Token: 0x040025D5 RID: 9685
public bool pingPong;
// Token: 0x040025D6 RID: 9686
public bool playOnAwake = true;
// Token: 0x040025D7 RID: 9687
public Transform transformCache;
// Token: 0x040025D8 RID: 9688
public int transitionFrame;
// Token: 0x040025D9 RID: 9689
public int crossfadeFrame;
}

View File

@@ -0,0 +1,387 @@
using System;
using System.Collections.Generic;
using UnityEngine;
// Token: 0x020000FC RID: 252
public class BakedMeshAnimator : MonoBehaviour
{
// Token: 0x060015A7 RID: 5543 RVA: 0x0019B24C File Offset: 0x0019944C
private void Awake()
{
this.tr = base.transform;
this.currentAnimation = Mathf.Clamp(this.startAnimation, 0, this.animations.Length - 1);
if (this.animationMeshRenderer == null)
{
this.animationMeshRenderer = base.GetComponent<MeshRenderer>();
}
if (this.animationMeshRenderer == null)
{
Debug.LogError("BakedMeshAnimator: " + ((this != null) ? this.ToString() : null) + " has no assigned MeshRenderer!");
}
this.meshFilter = this.animationMeshRenderer.GetComponent<MeshFilter>();
this.meshCacheCount = this.animations[this.currentAnimation].meshes.Length;
this.currentSpeed = this.animations[this.currentAnimation].playSpeed;
this.CreateCrossFadeMesh();
this.StartCrossfade();
if (this.meshFilter.sharedMesh == null)
{
this.meshFilter.sharedMesh = this.animations[0].meshes[0];
}
}
// Token: 0x060015A8 RID: 5544 RVA: 0x0019B346 File Offset: 0x00199546
public void AnimateUpdate()
{
if (this.animations.Length == 0)
{
return;
}
this.Animate();
}
// Token: 0x060015A9 RID: 5545 RVA: 0x0019B358 File Offset: 0x00199558
public void SetAnimation(int _animation, int _transitionFrame)
{
if (this.currentAnimation == _animation)
{
return;
}
this.transitionFrame = _transitionFrame;
this.anim = _animation;
this.SetAnimCommon();
}
// Token: 0x060015AA RID: 5546 RVA: 0x0019B378 File Offset: 0x00199578
public void SetAnimation(int _animation)
{
if (this.currentAnimation == _animation)
{
return;
}
this.transitionFrame = this.animations[this.currentAnimation].transitionFrame;
this.anim = _animation;
this.SetAnimCommon();
}
// Token: 0x060015AB RID: 5547 RVA: 0x0019B3A9 File Offset: 0x001995A9
private void SetAnimCommon()
{
base.enabled = true;
this.transitioning = true;
this.StartCrossfade();
}
// Token: 0x060015AC RID: 5548 RVA: 0x0019B3C0 File Offset: 0x001995C0
public void Animate()
{
if (!this.animationMeshRenderer.isVisible)
{
return;
}
Vector3 cameraTargetPosition = Links.x.rtsCamera.cameraTargetPosition;
cameraTargetPosition.y = this.tr.position.y;
if ((this.tr.position - cameraTargetPosition).sqrMagnitude > 1600f)
{
return;
}
if (this.transitioning)
{
if (this.crossfade || (int)this.currentFrame == this.transitionFrame || this.failsafe > this.transitionFailsafe)
{
this.failsafe = 0f;
this.transitioning = false;
this.currentAnimation = this.anim;
this.meshCacheCount = this.animations[this.currentAnimation].meshes.Length;
this.currentSpeed = this.animations[this.currentAnimation].playSpeed;
if (Time.time < 1f && this.animations[this.currentAnimation].randomStartFrame)
{
this.currentFrame = (float)Random.Range(this.meshCacheCount, 0);
}
else if (this.crossfade)
{
this.currentFrame = (float)this.animations[this.currentAnimation].crossfadeFrame;
}
else
{
this.currentFrame = (float)this.animations[this.currentAnimation].transitionFrame;
}
}
else
{
this.failsafe += Time.deltaTime;
}
}
if (!this.doCrossfade)
{
if (this.animations[this.currentAnimation].pingPong)
{
this.PingPongFrame();
}
else
{
this.NextFrame();
}
if (this.currentFrameInt != (int)this.currentFrame)
{
this.currentFrameInt = (int)this.currentFrame;
if (this.crossfade && this.crossfadeNormalFix)
{
this.animations[this.currentAnimation].meshes[(int)this.currentFrame].GetVertices(this.norms);
this.crossfadeMeshEnd.SetVertices(this.norms);
}
else
{
this.meshFilter.sharedMesh = this.animations[this.currentAnimation].meshes[(int)this.currentFrame];
}
}
}
this.UpdateCrossfade();
}
// Token: 0x060015AD RID: 5549 RVA: 0x0019B5EC File Offset: 0x001997EC
public bool NextFrame()
{
this.currentFrame += this.currentSpeed * Time.deltaTime * this.playSpeedMultiplier;
if (this.currentFrame > (float)(this.meshCacheCount + 1))
{
this.currentFrame = 0f;
if (!this.animations[this.currentAnimation].loop)
{
base.enabled = false;
}
return true;
}
if (this.currentFrame >= (float)this.meshCacheCount)
{
this.currentFrame = (float)this.meshCacheCount - this.currentFrame;
if (!this.animations[this.currentAnimation].loop)
{
base.enabled = false;
}
return true;
}
return false;
}
// Token: 0x060015AE RID: 5550 RVA: 0x0019B694 File Offset: 0x00199894
public bool PingPongFrame()
{
if (this.pingPongToggle)
{
this.currentFrame += this.currentSpeed * Time.deltaTime * this.playSpeedMultiplier;
}
else
{
this.currentFrame -= this.currentSpeed * Time.deltaTime * this.playSpeedMultiplier;
}
if (this.currentFrame <= 0f)
{
this.currentFrame = 0f;
this.pingPongToggle = true;
return true;
}
if (this.currentFrame >= (float)this.meshCacheCount)
{
this.pingPongToggle = false;
this.currentFrame = (float)(this.meshCacheCount - 1);
return true;
}
return false;
}
// Token: 0x060015AF RID: 5551 RVA: 0x0019B734 File Offset: 0x00199934
public void SetSpeedMultiplier(float speed)
{
this.playSpeedMultiplier = speed;
}
// Token: 0x060015B0 RID: 5552 RVA: 0x0019B740 File Offset: 0x00199940
private void CrossfadeInit()
{
if (this.vertsDiff == null)
{
this.vertsDiff = new Vector3[this.vertsStart.Count];
}
this.crossfadeMestTo.GetVertices(this.meshVerts);
for (int i = 0; i < this.vertsStart.Count; i++)
{
this.vertsDiff[i] = this.meshVerts[i] - this.vertsStart[i];
}
}
// Token: 0x060015B1 RID: 5553 RVA: 0x0019B7BC File Offset: 0x001999BC
private void CreateCrossFadeMesh()
{
if (!this.crossfade)
{
return;
}
this.crossfadeMeshStart = this.meshFilter.sharedMesh;
this.crossfadeMeshStart.GetVertices(this.vertsStart);
if (this.crossfadeMeshEnd == null)
{
this.crossfadeMeshEnd = new Mesh();
this.crossfadeMeshEnd.MarkDynamic();
this.crossfadeMeshEnd.SetVertices(this.vertsStart);
this.crossfadeMeshEnd.triangles = this.crossfadeMeshStart.triangles;
this.crossfadeMeshEnd.uv = this.crossfadeMeshStart.uv;
this.crossfadeMeshStart.GetNormals(this.norms);
this.crossfadeMeshEnd.SetNormals(this.norms);
}
}
// Token: 0x060015B2 RID: 5554 RVA: 0x0019B878 File Offset: 0x00199A78
private void StartCrossfade()
{
if (!this.crossfade)
{
return;
}
this.crossfadeMeshStart = this.meshFilter.sharedMesh;
this.crossfadeMeshStart.GetVertices(this.vertsStart);
this.doCrossfade = true;
this.crossfadeWeight = 0f;
this.crossfadeMeshEnd.SetVertices(this.vertsStart);
this.meshFilter.mesh = this.crossfadeMeshEnd;
this.crossfadeMeshStart.GetVertices(this.vertsStart);
if (this.vertsCurrent == null)
{
this.vertsCurrent = new Vector3[this.vertsStart.Count];
}
}
// Token: 0x060015B3 RID: 5555 RVA: 0x0019B914 File Offset: 0x00199B14
private void UpdateCrossfade()
{
if (!this.crossfade)
{
return;
}
this.nextUpdate += Time.deltaTime;
if (this.nextUpdate < this.crossfadeFrequency)
{
return;
}
this.nextUpdate = 0f;
if (this.crossfadeWeight >= 1f)
{
this.doCrossfade = false;
return;
}
this.crossfadeMestTo = this.animations[this.currentAnimation].meshes[this.animations[this.currentAnimation].crossfadeFrame];
if (this.crossfadeWeight == 0f)
{
this.CrossfadeInit();
}
for (int i = 0; i < this.vertsCurrent.Length; i++)
{
this.vertsCurrent[i] = this.vertsStart[i];
}
if (this.vertsDiff.Length != this.vertsStart.Count)
{
return;
}
for (int j = 0; j < this.vertsCurrent.Length; j++)
{
this.vertsCurrent[j] += this.vertsDiff[j] * this.crossfadeWeight;
}
this.crossfadeMeshEnd.SetVertices(this.vertsCurrent);
this.crossfadeWeight += this.crossfadeWeightAdd;
}
// Token: 0x040025DA RID: 9690
public MeshRenderer animationMeshRenderer;
// Token: 0x040025DB RID: 9691
public BakedMeshAnimation[] animations;
// Token: 0x040025DC RID: 9692
public int startAnimation;
// Token: 0x040025DD RID: 9693
private int currentAnimation;
// Token: 0x040025DE RID: 9694
private MeshFilter meshFilter;
// Token: 0x040025DF RID: 9695
public float currentFrame;
// Token: 0x040025E0 RID: 9696
private int currentFrameInt;
// Token: 0x040025E1 RID: 9697
private float currentSpeed;
// Token: 0x040025E2 RID: 9698
private bool pingPongToggle;
// Token: 0x040025E3 RID: 9699
public float playSpeedMultiplier = 1f;
// Token: 0x040025E4 RID: 9700
private int meshCacheCount;
// Token: 0x040025E5 RID: 9701
public float transitionFailsafe = 0.4f;
// Token: 0x040025E6 RID: 9702
private float failsafe;
// Token: 0x040025E7 RID: 9703
private int transitionFrame;
// Token: 0x040025E8 RID: 9704
private int anim;
// Token: 0x040025E9 RID: 9705
private bool transitioning = true;
// Token: 0x040025EA RID: 9706
private Transform tr;
// Token: 0x040025EB RID: 9707
public bool crossfade;
// Token: 0x040025EC RID: 9708
public bool crossfadeNormalFix;
// Token: 0x040025ED RID: 9709
public float crossfadeFrequency = 0.05f;
// Token: 0x040025EE RID: 9710
public float crossfadeWeightAdd = 0.221f;
// Token: 0x040025EF RID: 9711
private bool doCrossfade;
// Token: 0x040025F0 RID: 9712
private float crossfadeWeight = 1f;
// Token: 0x040025F1 RID: 9713
private Mesh crossfadeMestTo;
// Token: 0x040025F2 RID: 9714
private Mesh crossfadeMeshStart;
// Token: 0x040025F3 RID: 9715
private Mesh crossfadeMeshEnd;
// Token: 0x040025F4 RID: 9716
private List<Vector3> vertsStart = new List<Vector3>();
// Token: 0x040025F5 RID: 9717
private List<Vector3> norms = new List<Vector3>();
// Token: 0x040025F6 RID: 9718
private Vector3[] vertsCurrent;
// Token: 0x040025F7 RID: 9719
private Vector3[] vertsDiff;
// Token: 0x040025F8 RID: 9720
private List<Vector3> meshVerts = new List<Vector3>();
// Token: 0x040025F9 RID: 9721
private float nextUpdate;
}

View File

@@ -0,0 +1,60 @@
using System;
using UnityEngine;
// Token: 0x020000FD RID: 253
public class BakedMeshAnimatorUpdater : MonoBehaviour
{
// Token: 0x060015B5 RID: 5557 RVA: 0x0019BAC8 File Offset: 0x00199CC8
private void Start()
{
if (this.updateChildren)
{
this.children = base.transform.GetComponentsInChildren<BakedMeshAnimator>();
for (int i = 0; i < this.children.Length; i++)
{
if (this.randomizeSpeed)
{
this.children[i].SetSpeedMultiplier(Random.Range(this.minSpeedMultiplier, this.maxSpeedMultiplier));
}
}
return;
}
this.animatedMesh = base.GetComponent<BakedMeshAnimator>();
if (this.randomizeSpeed)
{
this.animatedMesh.SetSpeedMultiplier(Random.Range(this.minSpeedMultiplier, this.maxSpeedMultiplier));
}
}
// Token: 0x060015B6 RID: 5558 RVA: 0x0019BB58 File Offset: 0x00199D58
private void Update()
{
if (this.updateChildren)
{
for (int i = 0; i < this.children.Length; i++)
{
this.children[i].AnimateUpdate();
}
return;
}
this.animatedMesh.AnimateUpdate();
}
// Token: 0x040025FA RID: 9722
private BakedMeshAnimator animatedMesh;
// Token: 0x040025FB RID: 9723
private BakedMeshAnimator[] children;
// Token: 0x040025FC RID: 9724
public bool updateChildren;
// Token: 0x040025FD RID: 9725
public bool randomizeSpeed;
// Token: 0x040025FE RID: 9726
public float minSpeedMultiplier = 1f;
// Token: 0x040025FF RID: 9727
public float maxSpeedMultiplier = 1f;
}

View File

@@ -0,0 +1,60 @@
using System;
using UnityEngine;
// Token: 0x02000096 RID: 150
public class Billboard : MonoBehaviour
{
// Token: 0x06000E63 RID: 3683 RVA: 0x00114611 File Offset: 0x00112811
private void OnEnable()
{
this.GetVariables();
}
// Token: 0x06000E64 RID: 3684 RVA: 0x0011461C File Offset: 0x0011281C
public void GetVariables()
{
if (!this.tr)
{
this.tr = base.transform;
}
if (Links.x.rallyStage.playing && this.inRally)
{
this.camTr = Links.x.rallyStage.rallyCamera.gameObject.transform;
}
else
{
this.camTr = Links.x.rtsCamera.tr;
}
this.forw = Vector3.forward;
this.up = Vector3.up;
this.hasVars = true;
}
// Token: 0x06000E65 RID: 3685 RVA: 0x001146B0 File Offset: 0x001128B0
private void LateUpdate()
{
if (!this.hasVars)
{
this.GetVariables();
}
this.tr.LookAt(this.tr.position + this.camTr.rotation * this.forw, this.camTr.rotation * this.up);
}
// Token: 0x040016E3 RID: 5859
private Transform tr;
// Token: 0x040016E4 RID: 5860
private Transform camTr;
// Token: 0x040016E5 RID: 5861
private Vector3 forw;
// Token: 0x040016E6 RID: 5862
private Vector3 up;
// Token: 0x040016E7 RID: 5863
private bool hasVars;
// Token: 0x040016E8 RID: 5864
public bool inRally;
}

View File

@@ -0,0 +1,25 @@
using System;
using UnityEngine;
// Token: 0x020000EF RID: 239
public class BirdMaterialChanger : MonoBehaviour
{
// Token: 0x0600154B RID: 5451 RVA: 0x001983D8 File Offset: 0x001965D8
private void Start()
{
this.ChangeMaterial();
}
// Token: 0x0600154C RID: 5452 RVA: 0x001983E0 File Offset: 0x001965E0
private void ChangeMaterial()
{
base.GetComponentInChildren<SkinnedMeshRenderer>().sharedMaterial = this.materials[BirdMaterialChanger.counter];
BirdMaterialChanger.counter++;
}
// Token: 0x04002529 RID: 9513
public Material[] materials;
// Token: 0x0400252A RID: 9514
private static int counter;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,19 @@
using System;
using UnityEngine;
// Token: 0x02000018 RID: 24
public class BoneListener : MonoBehaviour
{
// Token: 0x060002BE RID: 702 RVA: 0x00038B33 File Offset: 0x00036D33
private void Start()
{
}
// Token: 0x060002BF RID: 703 RVA: 0x00038B35 File Offset: 0x00036D35
private void OnCollisionEnter(Collision collision)
{
}
// Token: 0x040004ED RID: 1261
private float startTime;
}

View File

@@ -0,0 +1,670 @@
using System;
using System.Collections.Generic;
using DarkTonic.MasterAudio;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
// Token: 0x02000097 RID: 151
public class Books : MonoBehaviour
{
// Token: 0x06000E67 RID: 3687 RVA: 0x0011471A File Offset: 0x0011291A
private void Start()
{
this.tr = base.gameObject.transform;
}
// Token: 0x06000E68 RID: 3688 RVA: 0x00114730 File Offset: 0x00112930
public void CloseMenu()
{
if (Links.x.characterSheet.open)
{
MasterAudio.PlaySoundAndForget("Paper Open 2", 1f, new float?(1f), 0f, "", null);
}
this.ReturnSelected();
for (int i = 0; i < this.spells.Count; i++)
{
if (this.spells[i].star)
{
this.spells[i].star = null;
}
Links.x.cellar.ReturnPooledUIObject(49, this.spells[i].gameObject);
}
this.RemoveStars();
this.spells.Clear();
this.open = false;
this.anim.Play("CloseSubMenu");
Links.x.characterSheet.CheckLevelUp();
if (Links.x.joy)
{
Links.x.characterSheet.closeText.SetActive(true);
}
if (Links.x.joy)
{
Links.x.characterSheet.DraggingButtons(false);
}
if (Links.x.joy)
{
if (this.clickedOpen)
{
if (this.clickedOpen.activeSelf && this.clickedOpen.activeInHierarchy)
{
Links.x.gameplay.SetInteractableSelected(EventSystem.current, this.clickedOpen);
return;
}
Links.x.gameplay.SetInteractableSelected(EventSystem.current, Links.x.characterSheet.character.characterSheetPortrait.gameObject);
return;
}
else
{
Links.x.gameplay.SetInteractableSelected(EventSystem.current, Links.x.characterSheet.character.characterSheetPortrait.gameObject);
}
}
}
// Token: 0x06000E69 RID: 3689 RVA: 0x00114903 File Offset: 0x00112B03
public void OpenWords()
{
this.currentType = "Words";
this.SetGrid("Words", Links.x.characterSheet.character, false);
}
// Token: 0x06000E6A RID: 3690 RVA: 0x0011492C File Offset: 0x00112B2C
public void OpenSpells()
{
this.favoriteMessage.SetActive(false);
this.RemoveStars();
MasterAudio.PlaySoundAndForget("Paper Open", 1f, new float?(1f), 0f, "", null);
if (Links.x.arrowKit.open)
{
Links.x.arrowKit.CloseMenu();
}
if (Links.x.characterSheet.note.activeSelf)
{
Links.x.characterSheet.CloseNote();
}
this.currentType = "Spells";
this.SetGrid("Spells", Links.x.characterSheet.character, false);
Links.x.characterSheet.levelUpButton.SetActive(false);
if (Links.x.joy)
{
Links.x.characterSheet.closeText.SetActive(false);
}
if (Links.x.joy)
{
Links.x.characterSheet.DraggingButtons(true);
if (this.spells.Count > 0)
{
Links.x.gameplay.SetInteractableSelected(EventSystem.current, this.spells[0].gameObject);
}
}
if (Links.x.characterSheet.minstrel)
{
this.closeButton.SetActive(false);
}
else
{
this.closeButton.SetActive(true);
}
Links.x.characterSheet.SetPortraitNav(false);
if (Links.x.joy)
{
this.controllerSpellDelete.spriteAsset = Links.x.GetSpriteSheetAsset(Links.x.gameplay.currentSpriteSheetAsset);
this.str.Clear();
this.str.Append("<voffset=.4em><size=40><sprite=");
int num = Links.x.gameplay.GetControllerSprite("Action", Links.x.gameplay.controllerName);
this.str.Append(num);
this.str.Append("></size></voffset>Toggle Favorite ");
this.str.Append("<voffset=.4em><size=40><sprite=");
num = Links.x.gameplay.GetControllerSprite("Interact", Links.x.gameplay.controllerName);
this.str.Append(num);
this.str.Append("></size></voffset>Delete Spell ");
this.controllerSpellDelete.text = this.str.ToString();
return;
}
this.controllerSpellDelete.text = "";
}
// Token: 0x06000E6B RID: 3691 RVA: 0x00114BB0 File Offset: 0x00112DB0
public void OpenSongs()
{
this.controllerSpellDelete.text = "";
this.RemoveStars();
this.favoriteMessage.SetActive(false);
MasterAudio.PlaySoundAndForget("Paper Open", 1f, new float?(1f), 0f, "", null);
if (Links.x.arrowKit.open)
{
Links.x.arrowKit.CloseMenu();
}
if (Links.x.characterSheet.note.activeSelf)
{
Links.x.characterSheet.CloseNote();
}
this.autoCast.SetActive(false);
this.currentType = "Songs";
this.SetGrid("Songs", Links.x.characterSheet.character, false);
Links.x.characterSheet.levelUpButton.SetActive(false);
if (Links.x.joy)
{
Links.x.characterSheet.closeText.SetActive(false);
}
if (Links.x.joy)
{
Links.x.characterSheet.DraggingButtons(true);
if (this.spells.Count > 0 && !Links.x.characterSheet.minstrel)
{
Links.x.gameplay.SetInteractableSelected(EventSystem.current, this.spells[0].gameObject);
}
}
if (Links.x.characterSheet.minstrel)
{
this.closeButton.SetActive(false);
}
else
{
this.closeButton.SetActive(true);
}
this.knowledgeText.enabled = false;
this.krt.gameObject.SetActive(false);
Links.x.characterSheet.SetPortraitNav(false);
}
// Token: 0x06000E6C RID: 3692 RVA: 0x00114D74 File Offset: 0x00112F74
private void Update()
{
if (Links.x.characterSheet.open && (Links.x.characterSheet.character != this.character || this.doUpdate))
{
this.favoriteMessage.SetActive(false);
this.RemoveStars();
this.SetGrid(this.currentType, Links.x.characterSheet.character, false);
this.doUpdate = false;
}
}
// Token: 0x06000E6D RID: 3693 RVA: 0x00114DEB File Offset: 0x00112FEB
public void UpdateAbilityTriggers()
{
}
// Token: 0x06000E6E RID: 3694 RVA: 0x00114DF0 File Offset: 0x00112FF0
public void Equipped()
{
if (this.savedCharacter != Links.x.characterSheet.character)
{
this.abilityNames = Links.x.characterSheet.character.stats.abilityNames;
this.uniqueNames = Links.x.characterSheet.character.stats.uniqueNames;
this.spellLevels = Links.x.characterSheet.character.stats.abilityLevels;
this.abilityCosts = Links.x.characterSheet.character.stats.abilityCost;
this.abilityRows = Links.x.characterSheet.character.stats.abilityRows;
}
this.savedCharacter = Links.x.characterSheet.character;
this.songPointsText.text = Links.x.characterSheet.character.stats.songPoints.ToString();
}
// Token: 0x06000E6F RID: 3695 RVA: 0x00114EF8 File Offset: 0x001130F8
public void SetGrid(string type, Character c, bool allSpells)
{
this.ReturnSelected();
base.gameObject.SetActive(true);
this.open = true;
this.character = c;
if (this.savedCharacter != Links.x.characterSheet.character)
{
this.abilityNames = Links.x.characterSheet.character.stats.abilityNames;
this.uniqueNames = Links.x.characterSheet.character.stats.uniqueNames;
this.spellLevels = Links.x.characterSheet.character.stats.abilityLevels;
this.abilityCosts = Links.x.characterSheet.character.stats.abilityCost;
this.abilityRows = Links.x.characterSheet.character.stats.abilityRows;
}
this.savedCharacter = Links.x.characterSheet.character;
int count = this.abilityNames.Count;
if (this.spells.Count > 0)
{
for (int i = 0; i < this.spells.Count; i++)
{
if (this.spells[i].star)
{
this.spells[i].star = null;
}
Links.x.cellar.ReturnPooledUIObject(49, this.spells[i].gameObject);
}
this.spells.Clear();
}
if (allSpells)
{
this.headerText.text = c.stats.GetName() + "'s ";
TextMeshProUGUI textMeshProUGUI = this.headerText;
textMeshProUGUI.text += " Spell Variants";
}
if (type == "Spells")
{
this.pointsObject.SetActive(false);
this.knowledgeText.enabled = true;
this.knowledgeText.text = "";
this.knowledge = this.character.stats.knowledge;
this.str.Clear();
this.str.Append("\n\n<align=center><size=1.5em><font=Bold>Learned Effects</font></size></align>\n");
for (int j = 0; j < this.knowledge.Count; j++)
{
this.str.Append("<size=1.2em><font=Bold>");
Library.Pagan paganRow = Links.x.library.GetPaganRow(this.knowledge[j]);
this.str.Append(paganRow._DisplayName);
this.str.Append("</font></size>\n");
this.str.Append(paganRow._Description);
this.str.Append("\n\n");
}
if (this.knowledge.Count == 0)
{
this.str.Append("None\n");
}
this.str.Append("\n\n");
this.knowledgeText.text = this.str.ToString();
this.krt.sizeDelta = new Vector2(this.krt.sizeDelta.x, this.knowledgeText.preferredHeight);
}
else
{
this.pointsObject.SetActive(true);
}
if ((type == "Spells" && c.stats.HasSpellbook()) || (type == "Songs" && c.stats.HasSongbook()))
{
for (int k = 0; k < count; k++)
{
bool flag = false;
if (this.abilityRows[k]._IsSpell && allSpells)
{
flag = true;
}
string mainSkill = this.abilityRows[k]._MainSkill;
if (this.abilityRows[k]._IsSpell && type == "Spells" && !allSpells)
{
flag = true;
}
if (!this.abilityRows[k]._IsSpell && !this.abilityRows[k]._IsSong && !allSpells && type == "Words")
{
flag = true;
}
if (this.abilityRows[k]._IsSong && type == "Songs" && !allSpells)
{
flag = true;
}
if (flag)
{
GameObject pooledGameObject = Links.x.cellar.GetPooledGameObject(49);
pooledGameObject.SetActive(true);
pooledGameObject.transform.SetParent(this.gridTransform, false);
SkillButton component = pooledGameObject.GetComponent<SkillButton>();
component.inSpellMenu = false;
if (allSpells || type == "Spells")
{
component.abilityName = this.abilityNames[k];
component.uniqueName = this.uniqueNames[k];
component.index = k;
component.abilityCost = (float)((int)this.abilityCosts[k].x);
component.character = c;
component.spellStats = this.spellLevels[k];
if (allSpells)
{
component.inSpellMenu = true;
}
else
{
component.inSpellMenu = false;
}
if (this.character.stats.IsFavoriteSpell(component.uniqueName) && !component.star)
{
this.AddStar(component);
}
}
if (type == "Songs")
{
component.abilityName = this.abilityNames[k];
component.index = k;
component.character = c;
component.componentID = -1;
component.uniqueName = this.uniqueNames[k];
component.inSpellMenu = false;
}
if (type == "Words")
{
component.abilityName = this.abilityNames[k];
component.index = k;
component.character = c;
component.componentID = -1;
component.uniqueName = this.uniqueNames[k];
}
component.inWindow = false;
component.Setup(true, true);
this.spells.Add(component);
pooledGameObject.transform.localPosition = new Vector3(pooledGameObject.transform.localPosition.x, pooledGameObject.transform.localPosition.y, 0f);
}
}
}
if (this.spells.Count > 0)
{
this.noAbilitiesText.text = "";
this.headerText.text = c.stats.GetName() + "'s ";
if (type == "Spells")
{
TextMeshProUGUI textMeshProUGUI2 = this.headerText;
textMeshProUGUI2.text += "Spellbook";
}
if (type == "Songs")
{
TextMeshProUGUI textMeshProUGUI3 = this.headerText;
textMeshProUGUI3.text += "Songbook";
}
if (type == "Words")
{
TextMeshProUGUI textMeshProUGUI4 = this.headerText;
textMeshProUGUI4.text += " Words";
}
if (this.autoCast && !allSpells && this.currentType == "Spells")
{
this.autoCast.SetActive(true);
}
if (type == "Spells")
{
this.favoriteMessage.SetActive(true);
}
}
else
{
this.str.Clear();
this.str.Append(c.stats.GetName());
if (type == "Spells")
{
if (!c.stats.HasSpellbook())
{
this.str.Append(" doesn't have a spellbook");
}
else
{
this.str.Append(" has not crafted any spells yet");
}
this.headerText.text = "";
}
if (type == "Songs")
{
if (!c.stats.HasSongbook())
{
this.str.Append(" doesn't have a songbook");
}
else
{
this.str.Append(" hasn't learned any songs yet");
}
this.headerText.text = "";
}
if (type == "Words")
{
this.str.Append("Words of Power");
}
this.str.Append(".");
this.noAbilitiesText.text = this.str.ToString();
if (this.autoCast)
{
this.autoCast.SetActive(false);
}
}
if (this.empty && this.krt)
{
if (type == "Spells")
{
this.autoCast.transform.SetAsFirstSibling();
this.empty.gameObject.transform.SetAsLastSibling();
this.krt.gameObject.transform.SetAsLastSibling();
this.empty.SetActive(true);
this.krt.gameObject.SetActive(true);
this.favoriteMessage.transform.SetAsLastSibling();
}
else
{
this.krt.gameObject.SetActive(false);
this.empty.SetActive(false);
}
}
this.UpdateSelected();
}
// Token: 0x06000E70 RID: 3696 RVA: 0x00115818 File Offset: 0x00113A18
public void RemoveStars()
{
for (int i = 0; i < this.stars.Count; i++)
{
this.stars[i].SetActive(false);
this.stars[i].transform.SetParent(this.tr);
}
}
// Token: 0x06000E71 RID: 3697 RVA: 0x0011586C File Offset: 0x00113A6C
public void AddStar(SkillButton b)
{
GameObject gameObject = null;
bool flag = false;
for (int i = 0; i < this.stars.Count; i++)
{
if (!this.stars[i])
{
flag = true;
}
else if (!this.stars[i].activeSelf)
{
gameObject = this.stars[i];
break;
}
}
if (flag)
{
this.stars.RemoveAll((GameObject item) => item == null);
}
if (!gameObject)
{
gameObject = Object.Instantiate<GameObject>(this.stars[0], Vector3.zero, Quaternion.Euler(Vector3.zero), null);
this.stars.Add(gameObject);
}
b.star = gameObject;
b.star.SetActive(true);
b.star.transform.SetParent(b.transform);
b.star.transform.position = b.transform.position;
gameObject.transform.localScale = new Vector3(1f, 1f, 1f);
b.star.transform.localPosition = new Vector3(b.star.transform.localPosition.x, b.star.transform.localPosition.y, 0f);
}
// Token: 0x06000E72 RID: 3698 RVA: 0x001159D8 File Offset: 0x00113BD8
public void AddFavoriteSpell(SkillButton b)
{
if (!this.open)
{
return;
}
if (this.character.stats.IsFavoriteSpell(b.uniqueName))
{
this.RemoveFavoriteSpell(b);
return;
}
this.character.stats.AddFavoriteSpell(b.uniqueName);
if (!b.star)
{
this.AddStar(b);
}
}
// Token: 0x06000E73 RID: 3699 RVA: 0x00115A38 File Offset: 0x00113C38
public void RemoveFavoriteSpell(SkillButton b)
{
this.character.stats.RemoveFavoriteSpell(b.uniqueName);
if (b.star)
{
b.star.SetActive(false);
b.star = null;
}
}
// Token: 0x06000E74 RID: 3700 RVA: 0x00115A70 File Offset: 0x00113C70
public void UpdateSelected()
{
foreach (Image image in this.selectedImages)
{
image.enabled = false;
}
if (this.currentType == "Songs")
{
this.equippedList = this.character.stats.equippedSongList;
}
if (this.currentType == "Songs")
{
int num = 0;
int count = this.spells.Count;
for (int i = 0; i < count; i++)
{
if (this.equippedList.Contains(this.spells[i].uniqueName))
{
this.selectedImages[num].enabled = true;
this.selectedImages[num].gameObject.transform.SetParent(this.spells[i].iconBG.gameObject.transform, false);
this.selectedImages[num].gameObject.transform.localPosition = new Vector3(-6f, 4f, 0f);
num++;
}
}
}
this.Equipped();
}
// Token: 0x06000E75 RID: 3701 RVA: 0x00115BC0 File Offset: 0x00113DC0
public void ReturnSelected()
{
}
// Token: 0x06000E76 RID: 3702 RVA: 0x00115BC4 File Offset: 0x00113DC4
public void CloseSpellDelete()
{
this.deletePopup.SetActive(false);
if (Links.x.joy)
{
if (this.spells.Count > 0)
{
Links.x.gameplay.SetInteractableSelected(EventSystem.current, this.spells[0].gameObject);
return;
}
Links.x.gameplay.SetInteractableSelected(EventSystem.current, Links.x.characterSheet.character.characterSheetPortrait.gameObject);
}
}
// Token: 0x06000E77 RID: 3703 RVA: 0x00115C4A File Offset: 0x00113E4A
public void OpenSpellDelete(string spellname)
{
this.toDelete = spellname;
this.deletePopup.SetActive(true);
this.deletePopupText.text = "Are you sure you want to delete " + spellname + "?";
}
// Token: 0x06000E78 RID: 3704 RVA: 0x00115C7A File Offset: 0x00113E7A
public void Delete()
{
this.character.stats.RemoveSpell(this.toDelete);
this.SetGrid("Spells", this.character, false);
this.CloseSpellDelete();
}
// Token: 0x040016E9 RID: 5865
public List<Library.Abilities> abilityRows;
// Token: 0x040016EA RID: 5866
private List<string> uniqueNames;
// Token: 0x040016EB RID: 5867
private List<string> abilityNames;
// Token: 0x040016EC RID: 5868
private List<Vector2> abilityCosts;
// Token: 0x040016ED RID: 5869
private List<Vector4> spellLevels;
// Token: 0x040016EE RID: 5870
public List<SkillButton> spells = new List<SkillButton>();
// Token: 0x040016EF RID: 5871
public TextMeshProUGUI deletePopupText;
// Token: 0x040016F0 RID: 5872
public TextMeshProUGUI noAbilitiesText;
// Token: 0x040016F1 RID: 5873
public TextMeshProUGUI headerText;
// Token: 0x040016F2 RID: 5874
public TextMeshProUGUI songPointsText;
// Token: 0x040016F3 RID: 5875
public TextMeshProUGUI knowledgeText;
// Token: 0x040016F4 RID: 5876
public TextMeshProUGUI controllerSpellDelete;
// Token: 0x040016F5 RID: 5877
public GameObject deletePopup;
// Token: 0x040016F6 RID: 5878
private StringFast str = new StringFast(64);
// Token: 0x040016F7 RID: 5879
public string toDelete;
// Token: 0x040016F8 RID: 5880
public Character character;
// Token: 0x040016F9 RID: 5881
public Character savedCharacter;
// Token: 0x040016FA RID: 5882
public Transform gridTransform;
// Token: 0x040016FB RID: 5883
public Animator anim;
// Token: 0x040016FC RID: 5884
public string currentType;
// Token: 0x040016FD RID: 5885
public bool open;
// Token: 0x040016FE RID: 5886
public List<Image> selectedImages = new List<Image>();
// Token: 0x040016FF RID: 5887
private List<string> equippedList;
// Token: 0x04001700 RID: 5888
public GameObject pointsObject;
// Token: 0x04001701 RID: 5889
public bool doUpdate;
// Token: 0x04001702 RID: 5890
public GameObject clickedOpen;
// Token: 0x04001703 RID: 5891
public GameObject closeButton;
// Token: 0x04001704 RID: 5892
private List<string> knowledge;
// Token: 0x04001705 RID: 5893
public RectTransform krt;
// Token: 0x04001706 RID: 5894
public GameObject empty;
// Token: 0x04001707 RID: 5895
public GameObject autoCast;
// Token: 0x04001708 RID: 5896
public GameObject favoriteMessage;
// Token: 0x04001709 RID: 5897
public List<GameObject> stars = new List<GameObject>();
// Token: 0x0400170A RID: 5898
private Transform tr;
}

View File

@@ -0,0 +1,731 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Pathfinding;
using UnityEngine;
// Token: 0x02000019 RID: 25
public class Boro : MonoBehaviour
{
// Token: 0x060002C1 RID: 705 RVA: 0x00038B3F File Offset: 0x00036D3F
private void Start()
{
}
// Token: 0x060002C2 RID: 706 RVA: 0x00038B41 File Offset: 0x00036D41
public void Setup()
{
this.character = base.gameObject.GetComponent<Character>();
this.party = Links.x.portraitOrder;
}
// Token: 0x060002C3 RID: 707 RVA: 0x00038B64 File Offset: 0x00036D64
private void OnDisable()
{
this.Stop();
}
// Token: 0x060002C4 RID: 708 RVA: 0x00038B6C File Offset: 0x00036D6C
public void Call(Character callingParty)
{
if (this.corout == null && Links.x.gaia.pathfindingReady)
{
if (this.leaveCoroutine != null)
{
base.StopCoroutine(this.leaveCoroutine);
this.leaveCoroutine = null;
}
if (this.attempt == 0)
{
string text = "Calling " + Records.x.boroName + "...";
Links.x.gameFeed.AddFeed(text);
}
this.corout = this.FindSpot(callingParty, true);
base.StartCoroutine(this.corout);
}
}
// Token: 0x060002C5 RID: 709 RVA: 0x00038BFC File Offset: 0x00036DFC
public void Move(Character callingParty)
{
if (this.corout != null)
{
base.StopCoroutine(this.corout);
this.corout = null;
}
if (this.corout == null && Links.x.gaia.pathfindingReady)
{
this.corout = this.FindSpot(callingParty, true);
base.StartCoroutine(this.corout);
}
}
// Token: 0x060002C6 RID: 710 RVA: 0x00038C58 File Offset: 0x00036E58
private IEnumerator FindSpot(Character callingParty, bool instant)
{
float radius = 12f;
ConstantPath constPath = ConstantPath.ConstructFast(callingParty.node, Records.x.GetConstantPathRadius((int)radius), null);
this.SetNodeConstraint(null, false);
this.nodeConstraint.constrainWalkability = false;
constPath.nnConstraint = this.nodeConstraint;
AstarPath.StartPath(constPath, false);
yield return base.StartCoroutine(constPath.WaitForPath());
constPath.Claim(this);
this.allNodes = constPath.allNodes;
int num = this.allNodes.Count;
int num2 = num - 1;
this.SetNodeConstraint(this.character, true);
this.suitableNodes.Clear();
this.edgeNodes.Clear();
this.nearNodes.Clear();
radius *= Records.x.nodeSize;
for (int i = num2; i >= 0; i--)
{
GraphNode graphNode = this.allNodes[i];
if (((Vector3)graphNode.position - (Vector3)callingParty.node.position).sqrMagnitude < radius * radius && this.nodeConstraint.Suitable(graphNode))
{
this.suitableNodes.Add(graphNode);
}
}
constPath.Release(this, false);
num = this.suitableNodes.Count;
Vector3 position = callingParty.tr.position;
this.added.Clear();
for (int j = 0; j < num; j++)
{
this.added.Add(false);
}
for (int k = 0; k < 15; k++)
{
float num3 = float.PositiveInfinity;
int num4 = -1;
for (int l = 0; l < num; l++)
{
if (!this.added[l])
{
float sqrMagnitude = this.SubtractVectors(position, (Vector3)this.suitableNodes[l].position).sqrMagnitude;
if (sqrMagnitude < num3)
{
num3 = sqrMagnitude;
num4 = l;
}
}
}
if (num4 > -1)
{
this.added[num4] = true;
this.edgeNodes.Add(this.suitableNodes[num4]);
}
}
if (this.edgeNodes.Count > 0)
{
this.character.SetMeshState(false);
Links.x.gaia.boro.body.SetMeshState(false, true);
if (Links.x.gaia.boro.circleTr)
{
Links.x.gaia.boro.circleTr.gameObject.SetActive(false);
}
float num5 = Vector3.Distance(this.character.tr.position, callingParty.tr.position);
num5 *= 0.05f;
if (num5 < 1f)
{
num5 = 1f;
}
if (this.attempt == 0 && !instant)
{
yield return new WaitForSeconds(num5);
}
else if (this.attempt == 0 && instant)
{
yield return new WaitForSeconds(0.5f);
}
GraphNode graphNode2 = this.edgeNodes[this.edgeNodes.Count - 1];
int num6 = this.edgeNodes.Count - 1;
this.attempt = 0;
if (this.character.inactive)
{
this.character.TurnScriptsOn();
}
this.boroInvisible = false;
Records.x.boroInvisible = this.boroInvisible;
this.character.tr.position = (Vector3)this.edgeNodes[num6].position;
this.character.SetRotation(Quaternion.LookRotation(callingParty.tr.position - this.character.tr.position), false, true);
this.character.FirstPosition(this.edgeNodes[num6]);
this.character.SetMeshState(true);
Links.x.gaia.boro.body.SetMeshState(true, true);
if (Links.x.gaia.boro.circleTr)
{
Links.x.gaia.boro.circleTr.gameObject.SetActive(true);
}
Links.x.gaia.boro.body.SeeThroughColliders(true);
Links.x.gaia.boro.thisCollider.enabled = true;
this.character.PlaySoundFX(0, 6);
Links.x.hudControl.ToggleBoroButtonSprite();
}
else if (this.attempt < 5)
{
this.attempt++;
yield return new WaitForSeconds(0.5f);
this.corout = null;
this.Call(callingParty);
}
else
{
Links.x.hudControl.ToggleBoroButtonSprite();
Links.x.gameFeed.AddFeed("Boro cannot stand here");
Links.x.gameFeed.ShowNotice("Boro cannot find a place to stand here");
}
this.corout = null;
yield return new WaitForSeconds(0.1f);
yield break;
}
// Token: 0x060002C7 RID: 711 RVA: 0x00038C78 File Offset: 0x00036E78
public bool BoroNearby()
{
return this.character.sailing || (!this.boroInvisible && (Links.x.hasMain && (Links.x.main.currentPosition - this.character.tr.position).sqrMagnitude < 900f));
}
// Token: 0x060002C8 RID: 712 RVA: 0x00038CE0 File Offset: 0x00036EE0
public void StartLeaveWait()
{
if (this.leaveCoroutine == null)
{
this.leaveCoroutine = this.WaitToLeave(false);
base.StartCoroutine(this.leaveCoroutine);
}
}
// Token: 0x060002C9 RID: 713 RVA: 0x00038D04 File Offset: 0x00036F04
private IEnumerator WaitToLeave(bool fromButton)
{
Links.x.hudControl.ToggleBoroButtonSprite();
float timeToLerp = 3f;
float percentage = 0f;
float startTime = Time.time;
if (fromButton)
{
timeToLerp = 1f;
this.character.Flee(Links.x.main.node, false, Links.x.gameplay.seconds, 10f);
}
if (!Links.x.gaia.sceneLoaded)
{
timeToLerp = 0.0001f;
fromButton = true;
}
while (percentage < 1f && (!this.BoroNearby() || fromButton))
{
percentage = (Time.time - startTime) / timeToLerp;
yield return null;
}
if (!this.BoroNearby() || fromButton)
{
bool sceneLoaded = Links.x.gaia.sceneLoaded;
this.character.SetMeshState(false);
this.character.body.SetMeshState(false, sceneLoaded);
this.boroInvisible = true;
Records.x.boroInvisible = this.boroInvisible;
Links.x.gaia.boro.body.SeeThroughColliders(false);
Links.x.gaia.boro.thisCollider.enabled = false;
yield return new WaitForSeconds(0.5f);
this.character.RemoveLastNode(true);
this.character.TurnScriptsOff();
}
Links.x.hudControl.ToggleBoroButtonSprite();
this.leaveCoroutine = null;
yield break;
}
// Token: 0x060002CA RID: 714 RVA: 0x00038D1C File Offset: 0x00036F1C
public void Leave()
{
if (Records.x.partySailing)
{
return;
}
if (this.leaveCoroutine != null)
{
base.StopCoroutine(this.leaveCoroutine);
this.leaveCoroutine = null;
}
this.leaveCoroutine = this.WaitToLeave(true);
base.StartCoroutine(this.leaveCoroutine);
}
// Token: 0x060002CB RID: 715 RVA: 0x00038D6C File Offset: 0x00036F6C
public void BackToBeach()
{
if (this.coroutBack == null && Records.x.boroLastBeachPoint != Vector3.zero)
{
this.coroutBack = this.Back();
base.StartCoroutine(this.coroutBack);
return;
}
Links.x.gameFeed.AddFeed("Boro is busy");
}
// Token: 0x060002CC RID: 716 RVA: 0x00038DC5 File Offset: 0x00036FC5
private IEnumerator Back()
{
this.SetNodeConstraint(this.character, true);
GraphNode beachNode = this.character.NearNode(Records.x.boroLastBeachPoint, true, 0, -1, 0);
bool flag;
if (beachNode == null)
{
flag = false;
Links.x.gameFeed.AddFeed("Boro cannot find a place on beach");
Links.x.gameFeed.ShowNotice("Boro cannot find a place to stand");
}
else
{
flag = true;
}
if (flag)
{
this.character.SetMeshState(false);
Links.x.gaia.boro.body.SetMeshState(false, true);
if (Links.x.gaia.boro.circleTr)
{
Links.x.gaia.boro.circleTr.gameObject.SetActive(false);
}
float t = 0.5f;
yield return new WaitForSeconds(t);
this.character.tr.position = (Vector3)beachNode.position;
this.character.FirstPosition(beachNode);
yield return new WaitForSeconds(t);
this.character.SetMeshState(true);
Links.x.gaia.boro.body.SetMeshState(true, true);
if (Links.x.gaia.boro.circleTr)
{
Links.x.gaia.boro.circleTr.gameObject.SetActive(true);
}
this.character.PlaySoundFX(0, 6);
}
this.coroutBack = null;
yield break;
}
// Token: 0x060002CD RID: 717 RVA: 0x00038DD4 File Offset: 0x00036FD4
public void LeavingForCombat()
{
if (this.boroInvisible)
{
return;
}
if (this.character.sailing)
{
return;
}
if (this.coroutCombat != null)
{
base.StopCoroutine(this.coroutCombat);
this.coroutCombat = null;
}
if (this.coroutCombat == null && !this.boroInvisible)
{
this.savedNode = this.character.node;
this.coroutCombat = this.FindCombatRetreat(false, true);
base.StartCoroutine(this.coroutCombat);
}
}
// Token: 0x060002CE RID: 718 RVA: 0x00038E50 File Offset: 0x00037050
public void ComingBackFromCombat()
{
if (this.character.sailing)
{
return;
}
if (!Links.x.gaia.pathfindingReady)
{
return;
}
if (this.boroInvisible)
{
return;
}
if (this.coroutCombat != null)
{
base.StopCoroutine(this.coroutCombat);
this.coroutCombat = null;
}
if (this.coroutCombat == null && this.character.node == null)
{
this.coroutCombat = this.FindCombatRetreat(true, true);
base.StartCoroutine(this.coroutCombat);
return;
}
if (this.character.node != null)
{
this.character.TurnScriptsOn();
this.boroInvisible = false;
Records.x.boroInvisible = this.boroInvisible;
Links.x.gaia.boro.body.SetMeshState(true, true);
this.character.EndPath();
Links.x.gaia.boro.body.SeeThroughColliders(true);
Links.x.gaia.boro.thisCollider.enabled = true;
}
}
// Token: 0x060002CF RID: 719 RVA: 0x00038F5B File Offset: 0x0003715B
private IEnumerator FindCombatRetreat(bool state, bool instant)
{
bool enoughNodes = false;
float radius = 12f;
if (!state)
{
this.character.CircleAnimation("");
}
GraphNode centerNode = this.character.node;
if (state)
{
this.character.TurnScriptsOn();
this.character.FindCurrentNode(true);
}
if (this.character.node == null && Links.x.diorama.playerStartBoatDefault)
{
this.character.tr.position = Links.x.diorama.playerStartBoatDefault.position;
this.character.FirstPosition(null);
}
if (this.character.node == null)
{
Debug.Log("Sheep node is null");
this.character.SetMeshState(state);
Links.x.gaia.boro.body.SetMeshState(state, true);
if (!state)
{
this.boroInvisible = true;
}
else
{
this.boroInvisible = false;
}
Records.x.boroInvisible = this.boroInvisible;
if (this.boroInvisible)
{
Links.x.gaia.boro.body.SeeThroughColliders(false);
Links.x.gaia.boro.thisCollider.enabled = false;
}
else
{
Links.x.gaia.boro.body.SeeThroughColliders(true);
Links.x.gaia.boro.thisCollider.enabled = true;
}
}
else
{
if (state)
{
this.character.tr.position = (Vector3)this.character.node.position;
centerNode = this.savedNode;
}
ConstantPath constPath = ConstantPath.ConstructFast(centerNode, Records.x.GetConstantPathRadius((int)radius), null);
this.SetNodeConstraint(null, true);
this.nodeConstraint.constrainWalkability = false;
constPath.nnConstraint = this.nodeConstraint;
AstarPath.StartPath(constPath, false);
yield return base.StartCoroutine(constPath.WaitForPath());
constPath.Claim(this);
this.allNodes = constPath.allNodes;
int num = this.allNodes.Count;
int num2 = num - 1;
Vector3 zero = Vector3.zero;
Vector3 zero2 = Vector3.zero;
Vector3 zero3 = Vector3.zero;
Vector3 zero4 = Vector3.zero;
Vector3 forward = Vector3.forward;
Vector3 zero5 = Vector3.zero;
Vector3 zero6 = Vector3.zero;
this.SetNodeConstraint(this.character, true);
this.suitableNodes.Clear();
this.edgeNodes.Clear();
this.nearNodes.Clear();
radius *= Records.x.nodeSize;
if (!state)
{
for (int j = num2; j >= 0; j--)
{
GraphNode graphNode = this.allNodes[j];
if (((Vector3)graphNode.position - (Vector3)centerNode.position).sqrMagnitude < radius * radius && this.nodeConstraint.Suitable(graphNode))
{
this.suitableNodes.Add(graphNode);
}
}
}
else
{
for (int k = 0; k < num; k++)
{
GraphNode graphNode = this.allNodes[k];
if (((Vector3)graphNode.position - (Vector3)centerNode.position).sqrMagnitude < radius * radius && this.nodeConstraint.Suitable(graphNode))
{
this.suitableNodes.Add(graphNode);
}
}
}
num = this.suitableNodes.Count;
num2 = num - 1;
Vector3 position = this.character.tr.position;
for (int l = 0; l < num; l++)
{
if (!enoughNodes)
{
GraphNode graphNode = this.suitableNodes[l];
this.edgeNodes.Add(graphNode);
if (this.edgeNodes.Count >= 100)
{
enoughNodes = true;
break;
}
}
}
constPath.Release(this, false);
this.character.PlaySoundFX(0, 6);
int nodeIndex = -1;
if (this.edgeNodes.Count > 0)
{
bool foundPath = false;
int num3;
for (int i = 0; i < this.edgeNodes.Count; i = num3 + 1)
{
if (!foundPath)
{
ABPath p = ABPath.ConstructFast(this.character.node, this.edgeNodes[i], null);
p.nnConstraint = this.nodeConstraint;
AstarPath.StartPath(p, false);
yield return base.StartCoroutine(p.WaitForPath());
p.Claim(this);
if (!p.error)
{
foundPath = true;
nodeIndex = i;
}
p.Release(this, false);
p = null;
}
num3 = i;
}
}
GraphNode graphNode2 = null;
if (nodeIndex > -1)
{
graphNode2 = this.edgeNodes[nodeIndex];
}
if (graphNode2 == null || instant)
{
this.character.SetMeshState(state);
Links.x.gaia.boro.body.SetMeshState(state, true);
if (!state)
{
this.boroInvisible = true;
}
else
{
this.boroInvisible = false;
}
Records.x.boroInvisible = this.boroInvisible;
if (this.boroInvisible)
{
Links.x.gaia.boro.body.SeeThroughColliders(false);
Links.x.gaia.boro.thisCollider.enabled = false;
}
else
{
Links.x.gaia.boro.body.SeeThroughColliders(true);
Links.x.gaia.boro.thisCollider.enabled = true;
}
}
else
{
bool flag = true;
if (state)
{
flag = false;
}
this.character.MakePath(this.edgeNodes[nodeIndex], 10, false, flag, true);
yield return new WaitForSecondsRealtime(2f);
this.character.SetMeshState(state);
Links.x.gaia.boro.body.SetMeshState(state, true);
if (state)
{
this.character.CircleAnimation("");
}
if (!state)
{
this.boroInvisible = true;
}
else
{
this.boroInvisible = false;
}
Records.x.boroInvisible = this.boroInvisible;
if (this.boroInvisible)
{
Links.x.gaia.boro.body.SeeThroughColliders(false);
Links.x.gaia.boro.thisCollider.enabled = false;
}
else
{
Links.x.gaia.boro.body.SeeThroughColliders(true);
Links.x.gaia.boro.thisCollider.enabled = true;
}
if (!state)
{
yield return new WaitForSecondsRealtime(2f);
this.character.TargetReached();
this.character.RemoveLastNode(true);
this.character.TurnScriptsOff();
}
}
constPath = null;
}
Links.x.hudControl.ToggleBoroButtonSprite();
this.coroutCombat = null;
yield break;
}
// Token: 0x060002D0 RID: 720 RVA: 0x00038F78 File Offset: 0x00037178
private GraphNode GetSuitableNode()
{
for (int i = 0; i < this.edgeNodes.Count; i++)
{
if (this.nodeConstraint.Suitable(this.edgeNodes[i]))
{
return this.edgeNodes[i];
}
}
return null;
}
// Token: 0x060002D1 RID: 721 RVA: 0x00038FC2 File Offset: 0x000371C2
public void Stop()
{
this.attempt = 0;
if (this.corout != null)
{
base.StopCoroutine(this.corout);
this.corout = null;
}
if (this.coroutCombat != null)
{
base.StopCoroutine(this.coroutCombat);
this.coroutCombat = null;
}
}
// Token: 0x060002D2 RID: 722 RVA: 0x00039001 File Offset: 0x00037201
public void Sail()
{
}
// Token: 0x060002D3 RID: 723 RVA: 0x00039003 File Offset: 0x00037203
public void LevelUp()
{
}
// Token: 0x060002D4 RID: 724 RVA: 0x00039008 File Offset: 0x00037208
public void SetNodeConstraint(Character pathfinder, bool constrainTags)
{
this.nodeConstraint.constrainWalkability = true;
this.nodeConstraint.walkable = true;
this.nodeConstraint.constrainTags = constrainTags;
this.nodeConstraint.checkCircleID = 0;
if (!pathfinder)
{
this.nodeConstraint.passID = 0;
this.nodeConstraint.passID2 = 0;
this.nodeConstraint.checkConnections = 0;
this.nodeConstraint.constrainPenalty = 0;
}
else
{
this.nodeConstraint.passID = pathfinder.nodeStationaryID;
this.nodeConstraint.passID2 = pathfinder.nodeMovingID;
this.nodeConstraint.checkConnections = pathfinder.ConnectionNumber();
this.nodeConstraint.constrainPenalty = 0;
}
this.nodeConstraint.constrainToArea = -1;
}
// Token: 0x060002D5 RID: 725 RVA: 0x000390CC File Offset: 0x000372CC
public Vector3 CustomNormalize(Vector3 v)
{
double num = Math.Sqrt((double)(v.x * v.x + v.y * v.y + v.z * v.z));
if (num > 9.99999974737875E-06)
{
float num2 = (float)num;
v.x /= num2;
v.y /= num2;
v.z /= num2;
return v;
}
return Vector3.zero;
}
// Token: 0x060002D6 RID: 726 RVA: 0x00039143 File Offset: 0x00037343
public float GetDot(Vector3 vector1, Vector3 vector2)
{
return vector1.x * vector2.x + vector1.y * vector2.y + vector1.z * vector2.z;
}
// Token: 0x060002D7 RID: 727 RVA: 0x00039170 File Offset: 0x00037370
public Vector3 SubtractVectors(Vector3 a, Vector3 b)
{
Vector3 vector;
vector.x = a.x - b.x;
vector.y = a.y - b.y;
vector.z = a.z - b.z;
return vector;
}
// Token: 0x040004EE RID: 1262
private IEnumerator corout;
// Token: 0x040004EF RID: 1263
private IEnumerator coroutCombat;
// Token: 0x040004F0 RID: 1264
private IEnumerator coroutBack;
// Token: 0x040004F1 RID: 1265
private NNConstraint nodeConstraint = new NNConstraint();
// Token: 0x040004F2 RID: 1266
private List<GraphNode> allNodes;
// Token: 0x040004F3 RID: 1267
private Character character;
// Token: 0x040004F4 RID: 1268
private List<GraphNode> suitableNodes = new List<GraphNode>();
// Token: 0x040004F5 RID: 1269
private List<GraphNode> edgeNodes = new List<GraphNode>();
// Token: 0x040004F6 RID: 1270
private List<GraphNode> nearNodes = new List<GraphNode>();
// Token: 0x040004F7 RID: 1271
public int attempt;
// Token: 0x040004F8 RID: 1272
public bool nearbyDuringCombat;
// Token: 0x040004F9 RID: 1273
private List<Character> party;
// Token: 0x040004FA RID: 1274
private GraphNode savedNode;
// Token: 0x040004FB RID: 1275
public Vector3 lastBeachPoint;
// Token: 0x040004FC RID: 1276
public bool boroInvisible;
// Token: 0x040004FD RID: 1277
private List<bool> added = new List<bool>();
// Token: 0x040004FE RID: 1278
private IEnumerator leaveCoroutine;
}

View File

@@ -0,0 +1,160 @@
using System;
using UnityEngine;
// Token: 0x0200005C RID: 92
public class Breakable : MonoBehaviour
{
// Token: 0x04001034 RID: 4148
public int armor;
// Token: 0x04001035 RID: 4149
public int health = 1;
// Token: 0x04001036 RID: 4150
public GameObject linkedExit;
// Token: 0x04001037 RID: 4151
public Breakable.BreakableTypes type;
// Token: 0x04001038 RID: 4152
[Header("HOW TO BREAK IT")]
public Breakable.BreakableEffectRequired effectRequired;
// Token: 0x04001039 RID: 4153
public bool enemy;
// Token: 0x0400103A RID: 4154
[Header("WHAT'S INSIDE")]
public SceneItem.xmlNames itemA = SceneItem.xmlNames.None;
// Token: 0x0400103B RID: 4155
public int itemStackA;
// Token: 0x0400103C RID: 4156
public SceneItem.xmlNames itemB = SceneItem.xmlNames.None;
// Token: 0x0400103D RID: 4157
public int itemStackB;
// Token: 0x0400103E RID: 4158
public SceneItem.xmlNames itemC = SceneItem.xmlNames.None;
// Token: 0x0400103F RID: 4159
public int itemStackC;
// Token: 0x04001040 RID: 4160
public SceneItem.xmlNames itemD = SceneItem.xmlNames.None;
// Token: 0x04001041 RID: 4161
public int itemStackD;
// Token: 0x04001042 RID: 4162
public Breakable.BarrelLiquidTypes barrelLiquid;
// Token: 0x04001043 RID: 4163
[Header("If elyxir component")]
public Breakable.ComponentTypes component;
// Token: 0x04001044 RID: 4164
[Header("If puzzle connected")]
public Puzzle puzzle;
// Token: 0x04001045 RID: 4165
public Prompts prompt;
// Token: 0x020001BE RID: 446
public enum BreakableTypes
{
// Token: 0x04002BEA RID: 11242
Barrel,
// Token: 0x04002BEB RID: 11243
Fence,
// Token: 0x04002BEC RID: 11244
Gate,
// Token: 0x04002BED RID: 11245
Wall,
// Token: 0x04002BEE RID: 11246
Bramble,
// Token: 0x04002BEF RID: 11247
Plank,
// Token: 0x04002BF0 RID: 11248
Box,
// Token: 0x04002BF1 RID: 11249
Vase,
// Token: 0x04002BF2 RID: 11250
Urn,
// Token: 0x04002BF3 RID: 11251
Acorn,
// Token: 0x04002BF4 RID: 11252
Mushroom,
// Token: 0x04002BF5 RID: 11253
Shell,
// Token: 0x04002BF6 RID: 11254
Rock,
// Token: 0x04002BF7 RID: 11255
Frog,
// Token: 0x04002BF8 RID: 11256
Stick,
// Token: 0x04002BF9 RID: 11257
HollowStick,
// Token: 0x04002BFA RID: 11258
Berry,
// Token: 0x04002BFB RID: 11259
Egg,
// Token: 0x04002BFC RID: 11260
ThickBramble
}
// Token: 0x020001BF RID: 447
public enum BreakableEffectRequired
{
// Token: 0x04002BFE RID: 11262
Damage,
// Token: 0x04002BFF RID: 11263
Stuck,
// Token: 0x04002C00 RID: 11264
Cold,
// Token: 0x04002C01 RID: 11265
Fire
}
// Token: 0x020001C0 RID: 448
public enum BarrelLiquidTypes
{
// Token: 0x04002C03 RID: 11267
none,
// Token: 0x04002C04 RID: 11268
oil,
// Token: 0x04002C05 RID: 11269
sap,
// Token: 0x04002C06 RID: 11270
wine,
// Token: 0x04002C07 RID: 11271
lizard,
// Token: 0x04002C08 RID: 11272
spores
}
// Token: 0x020001C1 RID: 449
public enum ComponentTypes
{
// Token: 0x04002C0A RID: 11274
None,
// Token: 0x04002C0B RID: 11275
Acorn,
// Token: 0x04002C0C RID: 11276
Mushroom,
// Token: 0x04002C0D RID: 11277
Shell,
// Token: 0x04002C0E RID: 11278
Rock,
// Token: 0x04002C0F RID: 11279
Frog,
// Token: 0x04002C10 RID: 11280
Stick,
// Token: 0x04002C11 RID: 11281
HollowStick,
// Token: 0x04002C12 RID: 11282
Berry
}
}

View File

@@ -0,0 +1,920 @@
using System;
using System.Collections;
using System.Collections.Generic;
using DarkTonic.MasterAudio;
using Pathfinding;
using UnityEngine;
// Token: 0x0200001A RID: 26
public class BreakableActions : MonoBehaviour
{
// Token: 0x060002D9 RID: 729 RVA: 0x000391FC File Offset: 0x000373FC
private void Awake()
{
if (!this.fromSpell)
{
base.enabled = false;
}
base.gameObject.layer = 16;
this.saveName = base.gameObject.name;
this.mainCollider = base.gameObject.GetComponent<Collider>();
if (!this.mainCollider && base.transform.childCount > 0)
{
foreach (object obj in base.transform)
{
Collider component = ((Transform)obj).gameObject.GetComponent<Collider>();
if (component)
{
this.mainCollider = component;
}
}
}
this.pt = base.gameObject.transform.position;
}
// Token: 0x060002DA RID: 730 RVA: 0x000392D8 File Offset: 0x000374D8
private void OnEnable()
{
this.pt = base.gameObject.transform.position;
if (this.fromSpell)
{
this.destroyed = false;
if (this.renderers.Length == 0)
{
this.GetObjects();
}
this.mainCollider.enabled = true;
this.currentHealth = this.breakable.health;
this.UpdateAstar();
}
if (this.particles.Length != 0)
{
ParticleSystem[] array = this.particles;
for (int i = 0; i < array.Length; i++)
{
array[i].gameObject.SetActive(true);
}
}
if (this.breakable)
{
if (this.breakable.component != Breakable.ComponentTypes.None)
{
for (int j = 0; j < this.renderers.Length; j++)
{
this.renderers[j].enabled = true;
}
this.mainCollider.enabled = true;
}
if (this.breakable.enemy)
{
this.aiShouldBreakIt = true;
}
}
}
// Token: 0x060002DB RID: 731 RVA: 0x000393C3 File Offset: 0x000375C3
public void LoadGameSetup(int h)
{
this.currentHealth = h;
if (h <= 0 && this.resourceLocation == 0)
{
this.ClickToBreak(null, true, false);
}
}
// Token: 0x060002DC RID: 732 RVA: 0x000393E1 File Offset: 0x000375E1
public void NewGameSetup()
{
if (this.breakable.armor > 0)
{
this.currentHealth = this.breakable.health;
return;
}
this.currentHealth = 1;
}
// Token: 0x060002DD RID: 733 RVA: 0x0003940C File Offset: 0x0003760C
public void SetLayers(int x)
{
if (x == 6)
{
if (this.layers == null)
{
this.layers = new List<int>();
for (int i = 0; i < this.renderers.Length; i++)
{
if (this.renderers[i])
{
this.layers.Add(this.renderers[i].gameObject.layer);
if (this.renderers[i].gameObject.layer != 29)
{
this.renderers[i].gameObject.layer = 6;
}
}
else
{
this.layers.Add(0);
}
}
return;
}
}
else
{
for (int j = 0; j < this.renderers.Length; j++)
{
if (this.renderers[j])
{
this.renderers[j].gameObject.layer = this.layers[j];
}
}
}
}
// Token: 0x060002DE RID: 734 RVA: 0x000394F0 File Offset: 0x000376F0
public void Remove()
{
if (this.renderers.Length == 0)
{
this.GetObjects();
}
this.mainCollider.enabled = false;
Links.x.hudControl.AddRemoveInteraction(false, null, this, null, null, null, null, null);
base.enabled = true;
if (this.interactiveCharacterObject)
{
Object.Destroy(this.interactiveCharacterObject);
}
base.StartCoroutine(this.UpdatePath(true));
}
// Token: 0x060002DF RID: 735 RVA: 0x0003955C File Offset: 0x0003775C
public void GetNode()
{
if (!this.destroyed)
{
bool flag = this.fromSpell;
}
}
// Token: 0x060002E0 RID: 736 RVA: 0x00039570 File Offset: 0x00037770
public void GetObjects()
{
if (this.renderers.Length == 0)
{
this.renderers = base.gameObject.GetComponentsInChildren<Renderer>(false);
}
this.rigidbodies = base.gameObject.GetComponentsInChildren<Rigidbody>(true);
if (base.gameObject.transform.childCount > 0)
{
this.normal = base.gameObject.transform.GetChild(0).gameObject;
this.broken = base.gameObject.transform.GetChild(1).gameObject;
if (this.broken && (this.broken.gameObject.layer == 29 || this.broken.gameObject.name.Contains("Block")) && base.gameObject.transform.childCount > 2)
{
this.broken = base.gameObject.transform.GetChild(2).gameObject;
}
}
for (int i = 0; i < this.renderers.Length; i++)
{
if (this.renderers[i].gameObject.name.Contains("Blocker"))
{
this.renderers[i].gameObject.layer = 29;
}
}
this.pt = base.gameObject.transform.position;
}
// Token: 0x060002E1 RID: 737 RVA: 0x000396BF File Offset: 0x000378BF
public void GetDifferentRenderers(GameObject g)
{
this.renderers = g.GetComponentsInChildren<Renderer>(false);
}
// Token: 0x060002E2 RID: 738 RVA: 0x000396CE File Offset: 0x000378CE
public void OutOfRange()
{
if (this.inRangeFX)
{
Links.x.cellar.ReturnPooledGameObject(33, this.inRangeFX);
this.inRangeFX = null;
}
}
// Token: 0x060002E3 RID: 739 RVA: 0x000396FC File Offset: 0x000378FC
public void InRange()
{
if (!this.inRangeFX)
{
this.inRangeFX = Links.x.cellar.GetPooledGameObject(33);
this.inRangeFX.transform.position = base.transform.position + new Vector3(0f, 1f, 0f);
this.inRangeFX.SetActive(true);
}
}
// Token: 0x060002E4 RID: 740 RVA: 0x00039770 File Offset: 0x00037970
public void HoverIn(bool isMainHover)
{
if (this.renderers.Length == 0)
{
this.GetObjects();
}
if (!this.destroyed)
{
int num = 0;
if (this.mainCollider)
{
this.bounds = this.mainCollider.bounds;
}
else
{
this.bounds = default(Bounds);
if (this.renderers.Length != 0 && this.renderers[0])
{
this.bounds = this.renderers[0].bounds;
if (this.renderers.Length > 1)
{
int i = 1;
int num2 = this.renderers.Length;
while (i < num2)
{
if (this.renderers[i] && this.renderers[i].gameObject.layer != 29)
{
this.bounds.Encapsulate(this.renderers[i].bounds);
}
i++;
}
}
}
}
this.bounds.Expand(0.25f);
if (Records.x.pocketPause)
{
num = 2;
}
if (!this.bracket)
{
this.bracket = Links.x.cellar.GetBracket(num, this.bounds);
}
else
{
Links.x.cellar.SetBracketMaterial(num, this.bracket);
}
if (isMainHover)
{
Links.x.hoverObject = base.gameObject;
Shader.SetGlobalVector("_DoorLightPosition", this.bounds.center + Links.x.rtsCamera.gameObject.transform.forward * -2f);
Records.x.hoverLightColor = Color.white * 0.25f;
Shader.SetGlobalFloat("_DoorLightRange", 2f);
if (Records.x.pocketPause && !Links.x.gameplay.attackingCharacter.CanAttack())
{
bool rallyWheelOpen = Links.x.pocketWheel.rallyWheelOpen;
}
}
}
}
// Token: 0x060002E5 RID: 741 RVA: 0x00039964 File Offset: 0x00037B64
public void HoverOut()
{
if (Links.x.hoverObject == base.gameObject)
{
Links.x.hoverObject = null;
}
if (this.multiHover)
{
Links.x.combat.MultiHitCharacters(false);
Links.x.combat.MultiHitObjects(false, base.gameObject.transform.position, this, null, null);
this.multiHover = false;
Links.x.gameplay.CheckIfAnythingShouldRedoMultiTargetHover();
}
if (this.bracket)
{
Links.x.cellar.ReturnPooledGameObject(61, this.bracket);
this.bracket = null;
}
}
// Token: 0x060002E6 RID: 742 RVA: 0x00039A10 File Offset: 0x00037C10
public void CombatSheen(int num)
{
if (this.renderers.Length == 0)
{
this.GetObjects();
}
if (this.destroyed && num == 3)
{
return;
}
bool flag = false;
if (num == 3)
{
flag = true;
}
this.combatTargetID = num;
for (int i = 0; i < this.renderers.Length; i++)
{
if (this.renderers[i].gameObject.layer != 29)
{
this.mats = this.renderers[i].materials;
foreach (Material material in this.mats)
{
this.sheen = 0f;
if (flag)
{
this.sheen = 1f;
}
material.SetFloat("_InCombatBubble", this.sheen);
}
}
}
}
// Token: 0x060002E7 RID: 743 RVA: 0x00039AC8 File Offset: 0x00037CC8
public void Damage(Character party)
{
GameObject pooledGameObject = Links.x.cellar.GetPooledGameObject(60);
pooledGameObject.transform.position = base.gameObject.transform.position + new Vector3(0f, 1f, 0f);
pooledGameObject.SetActive(true);
}
// Token: 0x060002E8 RID: 744 RVA: 0x00039B20 File Offset: 0x00037D20
public void Bend()
{
if (this.currentHealth < this.breakable.health && !this.destroyed && this.currentHealth > 0)
{
if (this.timeSinceHeal == 0f)
{
this.timeSinceHeal = Links.x.gameplay.seconds;
}
if (Links.x.gameplay.seconds > this.timeSinceHeal + 100f || this.timeSinceHeal == 0f)
{
this.timeSinceHeal = Links.x.gameplay.seconds;
float num = (float)this.breakable.health / 5f;
this.currentHealth += Mathf.RoundToInt(num);
Vector3 position = this.mainCollider.gameObject.transform.position;
Vector3 vector = Links.x.worldCamera.WorldToScreenPoint(position);
vector.z = 0f;
vector.x = vector.x * (1920f / (float)Screen.width) - 960f;
vector.y = vector.y * (Links.x.canvasRT.sizeDelta.y / (float)Screen.height) - Links.x.canvasRT.sizeDelta.y / 2f;
Links.x.repairFX.localPosition = vector;
Links.x.repairFX.gameObject.SetActive(true);
Links.x.repairFX.gameObject.GetComponent<HannahAnimator>().Play("Idle");
string text = "Repair 1";
if (Random.Range(0, 2) == 0)
{
text = "Repair 2";
}
if (Random.Range(0, 3) == 0)
{
text = "Repair 3";
}
MasterAudio.PlaySound3DAtVector3AndForget("Interactives", base.gameObject.transform.position, Random.Range(0.7f, 0.9f), new float?(1f), 0f, text, null);
if (this.currentHealth == this.breakable.health)
{
this.timeSinceHeal = 0f;
}
}
}
}
// Token: 0x060002E9 RID: 745 RVA: 0x00039D44 File Offset: 0x00037F44
public void ClickToBreak(Character party, bool fromSave, bool fromKick)
{
this.kicked = fromKick;
if (!this.destroyed)
{
this.destroyed = true;
if (base.gameObject.activeSelf)
{
base.StartCoroutine(this.Breaking(party, fromSave, this.kicked));
}
if (!fromSave && this.breakable.puzzle)
{
this.breakable.puzzle.gameObject.GetComponent<PuzzleActions>().BreakablePuzzle(false);
}
}
}
// Token: 0x060002EA RID: 746 RVA: 0x00039DB9 File Offset: 0x00037FB9
private IEnumerator Breaking(Character party, bool fromSave, bool fromKick)
{
if (this.renderers.Length == 0)
{
this.GetObjects();
}
if (!fromSave)
{
while (Links.x.combat.rallyTarget)
{
yield return null;
}
}
if (!fromSave && party)
{
this.OutOfRange();
if (this.breakable.armor == 0 && !Records.x.pocketPause && fromKick)
{
while (party.moving)
{
yield return null;
}
party.TargetReached();
party.alwaysTurn = true;
party.SetRotation(Quaternion.LookRotation(base.gameObject.transform.position - party.tr.position), false, true);
if (this.resourceLocation == -1)
{
party.EndTurning(false);
party.PlayAnimation("Kick", 0f);
Links.x.sensory.LookAtObject(base.transform, 15f, false, party, 4f, 0.5f, null, 0);
}
else
{
party.EndTurning(false);
party.PlayAnimation("Use", 0f);
}
}
}
if (!fromSave)
{
this.HoverOut();
}
bool canBreak = true;
if (!fromSave && party && !canBreak)
{
this.destroyed = false;
}
if (!fromSave && this.breakable.armor == 0 && !Records.x.pocketPause && fromKick)
{
yield return new WaitForSeconds(0.25f);
party.inAction = false;
}
if (!fromSave)
{
Links.x.sensory.AddNoise(party.gameObject, party.node, "Break", party);
}
if (canBreak)
{
if (this.normal)
{
this.normal.gameObject.SetActive(false);
}
if (!fromSave)
{
if (this.broken)
{
this.broken.gameObject.SetActive(true);
}
if (this.resourceLocation >= 0)
{
Links.x.diorama.ReturnResource(this.resourceLocation, base.gameObject);
if (this.breakable.component == Breakable.ComponentTypes.Acorn || this.breakable.component == Breakable.ComponentTypes.Berry || this.breakable.component == Breakable.ComponentTypes.Frog || this.breakable.component == Breakable.ComponentTypes.Mushroom || this.breakable.component == Breakable.ComponentTypes.Rock)
{
this.itemA = this.breakable.itemA.ToString();
if (this.itemA != "" && this.itemA != "None")
{
Library.Inventory invRowFromName = Links.x.library.GetInvRowFromName(this.itemA);
if (invRowFromName != null)
{
Item item;
ItemEquipped itemEquipped;
Links.x.inventory.AddFromGround(null, null, 0, false, 0f, invRowFromName._ID, 1, Vector3.zero, Vector3.zero, new Vector4((float)invRowFromName._DurabilityMax, 0f, 0f, 0f), party, true, false, out item, out itemEquipped);
}
if (this.breakable.component == Breakable.ComponentTypes.Frog)
{
party.StartQuip("Got it!");
}
}
}
if (this.breakable.component == Breakable.ComponentTypes.Stick || this.breakable.component == Breakable.ComponentTypes.HollowStick)
{
this.itemA = this.breakable.itemA.ToString();
if (this.itemA != "" && this.itemA != "None")
{
Library.Inventory invRowFromName2 = Links.x.library.GetInvRowFromName(this.itemA);
if (invRowFromName2 != null && invRowFromName2 != null)
{
Item item2;
ItemEquipped itemEquipped2;
Links.x.inventory.AddFromGround(null, null, 0, false, 0f, invRowFromName2._ID, 1, Vector3.zero, Vector3.zero, new Vector4((float)invRowFromName2._DurabilityMax, 0f, 0f, 0f), party, true, false, out item2, out itemEquipped2);
}
if (this.breakable.component == Breakable.ComponentTypes.Stick)
{
GameObject pooledGameObject = Links.x.cellar.GetPooledGameObject(60);
pooledGameObject.transform.position = base.gameObject.transform.position;
pooledGameObject.SetActive(true);
}
}
}
Links.x.itemPickupFX.gameObject.SetActive(true);
Links.x.itemPickupFX.gameObject.GetComponent<HannahAnimator>().Play("Idle");
Vector3 position = base.gameObject.transform.position;
Vector3 vector = Links.x.worldCamera.WorldToScreenPoint(position);
vector.z = 0f;
vector.x = vector.x * (1920f / (float)Screen.width) - 960f;
vector.y = vector.y * (Links.x.canvasRT.sizeDelta.y / (float)Screen.height) - Links.x.canvasRT.sizeDelta.y / 2f;
Links.x.itemPickupFX.localPosition = vector;
MasterAudio.PlaySound3DAtVector3AndForget("Interactives", base.gameObject.transform.position, 0.5f, new float?(1f), 0f, "Collect Resource", null);
if (this.breakable.component == Breakable.ComponentTypes.Frog)
{
HannahAnimatorSimple component = base.gameObject.GetComponent<HannahAnimatorSimple>();
if (component)
{
component.enabled = true;
}
}
if (this.particles.Length != 0)
{
ParticleSystem[] array = this.particles;
for (int i = 0; i < array.Length; i++)
{
array[i].gameObject.SetActive(false);
}
}
for (int j = 0; j < this.renderers.Length; j++)
{
this.renderers[j].enabled = false;
}
}
else
{
for (int k = 0; k < this.rigidbodies.Length; k++)
{
this.rigidbodies[k].gameObject.layer = 20;
Transform transform = this.rigidbodies[k].gameObject.transform;
if (!this.rigidbodies[k].gameObject.GetComponent<BoxCollider>())
{
this.rigidbodies[k].gameObject.AddComponent<BoxCollider>();
}
foreach (object obj in transform)
{
((Transform)obj).gameObject.layer = 20;
}
if (!fromSave && party)
{
Quaternion quaternion = Quaternion.LookRotation(base.gameObject.transform.position - party.body.headBone.position);
this.rigidbodies[k].AddForce(quaternion * Vector3.forward * 3000f, ForceMode.Force);
}
else
{
Vector3 position2 = base.gameObject.transform.position;
Quaternion quaternion2 = Quaternion.LookRotation(position2 - new Vector3(position2.x + Random.Range(-1f, 1f), position2.y + 2f, position2.z + Random.Range(-1f, 1f)));
this.rigidbodies[k].AddForce(quaternion2 * Vector3.forward * 300f, ForceMode.Force);
}
}
MasterAudio.PlaySound3DAtVector3AndForget("Interactives", Links.x.main.tr.position, 1f, new float?(1f), 0f, "Chest Break", null);
Breakable.BarrelLiquidTypes barrelLiquid = this.breakable.barrelLiquid;
if (this.breakable.itemA != SceneItem.xmlNames.None)
{
this.itemA = this.breakable.itemA.ToString();
}
if (this.breakable.itemB != SceneItem.xmlNames.None)
{
this.itemB = this.breakable.itemB.ToString();
}
if (this.breakable.itemC != SceneItem.xmlNames.None)
{
this.itemC = this.breakable.itemC.ToString();
}
if (this.breakable.itemD != SceneItem.xmlNames.None)
{
this.itemD = this.breakable.itemD.ToString();
}
int num = -1;
if (this.node != null)
{
num = (int)this.node.Area;
}
if (this.itemA != "" && this.itemA != "None")
{
Library.Inventory inventory = Links.x.library.GetInvRowFromName(this.itemA);
if (inventory != null)
{
Item item3 = Links.x.inventory.groundBag.DropLoot(inventory._ID, this.breakable.itemStackA, Vector3.zero, Vector3.zero, new Vector4((float)inventory._DurabilityMax, 0f, 0f, 0f), null, base.gameObject.transform.position, false, false, num);
Links.x.diorama.AddItem(item3);
}
}
if (this.itemB != "" && this.itemB != "None")
{
Library.Inventory inventory = Links.x.library.GetInvRowFromName(this.itemB);
if (inventory != null)
{
Item item4 = Links.x.inventory.groundBag.DropLoot(inventory._ID, this.breakable.itemStackB, Vector3.zero, Vector3.zero, new Vector4((float)inventory._DurabilityMax, 0f, 0f, 0f), null, base.gameObject.transform.position, false, false, num);
Links.x.diorama.AddItem(item4);
}
}
if (this.itemC != "" && this.itemC != "None")
{
Library.Inventory inventory = Links.x.library.GetInvRowFromName(this.itemC);
if (inventory != null)
{
Item item5 = Links.x.inventory.groundBag.DropLoot(inventory._ID, this.breakable.itemStackC, Vector3.zero, Vector3.zero, new Vector4((float)inventory._DurabilityMax, 0f, 0f, 0f), null, base.gameObject.transform.position, false, false, num);
Links.x.diorama.AddItem(item5);
}
}
if (this.itemD != "" && this.itemD != "None")
{
Library.Inventory inventory = Links.x.library.GetInvRowFromName(this.itemD);
if (inventory != null)
{
Item item6 = Links.x.inventory.groundBag.DropLoot(inventory._ID, this.breakable.itemStackD, Vector3.zero, Vector3.zero, new Vector4((float)inventory._DurabilityMax, 0f, 0f, 0f), null, base.gameObject.transform.position, false, false, num);
Links.x.diorama.AddItem(item6);
}
}
if (this.breakable.barrelLiquid == Breakable.BarrelLiquidTypes.lizard)
{
Vector3 position3 = base.transform.position;
string text = "SmallLizards";
Quaternion quaternion3 = Quaternion.LookRotation(Links.x.main.tr.position - base.transform.position);
bool flag = false;
Character firstCharacter = Links.x.gaia.CreateCreature(position3, quaternion3, text, flag, 0f, 1).GetFirstCharacter();
firstCharacter.SetPosition(position3, null);
firstCharacter.SetRotation(quaternion3, false, false);
firstCharacter.hostility = 2;
firstCharacter.UpdateLKP(Links.x.main, Links.x.main.node, "Attack", true);
firstCharacter.jumpingPosition = false;
if (!Records.x.InCombat(false))
{
Links.x.combat.StartCombat(Links.x.main, firstCharacter, false, true);
}
Links.x.combat.AddParty(firstCharacter, false, null, true);
}
else if (this.breakable.barrelLiquid != Breakable.BarrelLiquidTypes.none)
{
string text2 = this.breakable.barrelLiquid.ToString();
if (text2 == "none")
{
text2 = "Wine";
}
base.StartCoroutine(this.FindNodes(text2, base.transform.position, party));
}
if (Records.x.pocketPause && party.mainSelected)
{
Links.x.gameplay.PocketPause(false);
}
}
}
this.currentHealth = 0;
Links.x.hudControl.AddRemoveInteraction(false, null, this, null, null, null, null, null);
Links.x.combat.AddRemoveInteraction(false, this, null, null, null);
if (this.mainCollider)
{
this.mainCollider.enabled = false;
}
if (this.resourceLocation == -1 || this.fromSpell)
{
this.UpdateAstar();
}
}
yield break;
}
// Token: 0x060002EB RID: 747 RVA: 0x00039DDD File Offset: 0x00037FDD
public void UpdateAstar()
{
if (!this.updatingPath || this.fromSpell)
{
this.updatingPath = true;
base.enabled = true;
base.StartCoroutine(this.UpdatePath(false));
}
}
// Token: 0x060002EC RID: 748 RVA: 0x00039E0B File Offset: 0x0003800B
private IEnumerator UpdatePath(bool destroying)
{
Vector3 vector = this.currTile;
yield return new WaitForSecondsRealtime(0.1f);
this.currTile = base.gameObject.transform.position;
while (!Links.x.gaia.pathfindingReady)
{
yield return null;
}
if (!Links.x.gaia.sceneLoaded)
{
yield return new WaitForSecondsRealtime(Random.Range(0.2f, 0.5f));
}
AstarPath.active.UpdateGraphs(new Bounds(this.currTile + new Vector3(0f, -1f, 0f), new Vector3(4f, 40f, 4f)));
this.updatingPath = false;
if (this.fromSpell && this.destroyed)
{
if (this.tileEffect)
{
this.tileEffect.RemoveTile(this.node, base.gameObject, this);
}
}
else
{
bool flag = this.fromSpell && destroying;
}
if (!this.fromSpell)
{
base.enabled = false;
}
if (Links.x.fogOfWar)
{
Links.x.fogOfWar.UpdateGrid(this.currTile, 6f);
}
if (Links.x.fogOfWarInterior)
{
Links.x.fogOfWarInterior.UpdateGrid(this.currTile, 6f);
}
yield break;
}
// Token: 0x060002ED RID: 749 RVA: 0x00039E21 File Offset: 0x00038021
private IEnumerator FindNodes(string abilityName, Vector3 startPosition, Character party)
{
if (abilityName == "oil")
{
abilityName = "Oil";
}
if (abilityName == "sap")
{
abilityName = "Sap";
}
if (abilityName == "wine")
{
abilityName = "Wine";
}
if (abilityName == "spores")
{
abilityName = "Spores";
}
Library.Effects effectRow = Links.x.library.GetEffectRow(abilityName);
this.pickedGroundNodes.Clear();
this.SetNodeConstraint(false, 0);
GraphNode targetNode = AstarPath.active.GetNearest(startPosition, this.nodeConstraint).node;
float num = (float)effectRow._TileRadius;
float max = (num * Records.x.nodeSize + 0.1f) * (num * Records.x.nodeSize + 0.1f);
if (Links.x.gaia.pathfindingReady)
{
ConstantPath constPath = null;
constPath = ConstantPath.ConstructFast(targetNode, Records.x.GetConstantPathRadius((int)num), null);
constPath.nnConstraint = this.nodeConstraint;
AstarPath.StartPath(constPath, false);
yield return base.StartCoroutine(constPath.WaitForPath());
int num2 = 0;
constPath.Claim(this);
this.allNodes = constPath.allNodes;
int count = this.allNodes.Count;
int num3 = 0;
for (int i = 0; i < count; i++)
{
if (((Vector3)this.allNodes[i].position - (Vector3)targetNode.position).sqrMagnitude < max)
{
this.pickedGroundNodes.Add(this.allNodes[i]);
num3++;
num2++;
}
}
constPath.Release(this, false);
int num4 = this.pickedGroundNodes.IndexOf(targetNode);
if (num4 > -1)
{
this.pickedGroundNodes.RemoveAt(num4);
}
this.pickedGroundNodes.Add(targetNode);
num2++;
if (this.pickedGroundNodes.Count > 0)
{
TileEffects tileEffects = Links.x.tileEffects.AddComponent<TileEffects>();
tileEffects.gameObject.SetActive(true);
tileEffects.Setup(null, effectRow, null, this, null, party);
}
this.pickedGroundNodes.Clear();
constPath = null;
}
yield break;
}
// Token: 0x060002EE RID: 750 RVA: 0x00039E48 File Offset: 0x00038048
public void SetNodeConstraint(bool constrainTags, int uniqueID)
{
this.nodeConstraint.constrainWalkability = true;
this.nodeConstraint.walkable = true;
this.nodeConstraint.constrainTags = constrainTags;
this.nodeConstraint.checkCircleID = 0;
this.nodeConstraint.passID = 0;
this.nodeConstraint.passID2 = 0;
this.nodeConstraint.checkConnections = 0;
this.nodeConstraint.constrainPenalty = 0;
this.nodeConstraint.constrainToArea = -1;
}
// Token: 0x040004FF RID: 1279
public Breakable breakable;
// Token: 0x04000500 RID: 1280
public bool aiShouldBreakIt;
// Token: 0x04000501 RID: 1281
public string saveName;
// Token: 0x04000502 RID: 1282
public int currentHealth;
// Token: 0x04000503 RID: 1283
private string itemA;
// Token: 0x04000504 RID: 1284
private string itemB;
// Token: 0x04000505 RID: 1285
private string itemC;
// Token: 0x04000506 RID: 1286
private string itemD;
// Token: 0x04000507 RID: 1287
public Renderer[] renderers = new Renderer[0];
// Token: 0x04000508 RID: 1288
public ParticleSystem[] particles = new ParticleSystem[0];
// Token: 0x04000509 RID: 1289
public GameObject normal;
// Token: 0x0400050A RID: 1290
public GameObject broken;
// Token: 0x0400050B RID: 1291
public Rigidbody[] rigidbodies = new Rigidbody[0];
// Token: 0x0400050C RID: 1292
public bool destroyed;
// Token: 0x0400050D RID: 1293
private bool updatingPath;
// Token: 0x0400050E RID: 1294
private Vector3 prevTile;
// Token: 0x0400050F RID: 1295
private Vector3 currTile;
// Token: 0x04000510 RID: 1296
public Collider mainCollider;
// Token: 0x04000511 RID: 1297
public GraphNode node;
// Token: 0x04000512 RID: 1298
public List<GraphNode> pickedGroundNodes = new List<GraphNode>();
// Token: 0x04000513 RID: 1299
private NNConstraint nodeConstraint = new NNConstraint();
// Token: 0x04000514 RID: 1300
private List<GraphNode> allNodes;
// Token: 0x04000515 RID: 1301
public bool fromSpell;
// Token: 0x04000516 RID: 1302
public TileEffects tileEffect;
// Token: 0x04000517 RID: 1303
public int effectID;
// Token: 0x04000518 RID: 1304
public int resourceLocation = -1;
// Token: 0x04000519 RID: 1305
public Character interactiveCharacterObject;
// Token: 0x0400051A RID: 1306
private GameObject inRangeFX;
// Token: 0x0400051B RID: 1307
private Material[] mats;
// Token: 0x0400051C RID: 1308
public Character caster;
// Token: 0x0400051D RID: 1309
public GameObject bracket;
// Token: 0x0400051E RID: 1310
private Bounds bounds;
// Token: 0x0400051F RID: 1311
private List<int> layers;
// Token: 0x04000520 RID: 1312
private bool multiHover;
// Token: 0x04000521 RID: 1313
public int combatTargetID;
// Token: 0x04000522 RID: 1314
public bool kicked;
// Token: 0x04000523 RID: 1315
public Vector3 pt;
// Token: 0x04000524 RID: 1316
public float sheen;
// Token: 0x04000525 RID: 1317
private float timeSinceHeal;
}

View File

@@ -0,0 +1,17 @@
using System;
using UnityEngine;
using UnityEngine.UI;
// Token: 0x02000098 RID: 152
public class BtnAlphaThreshold : MonoBehaviour
{
// Token: 0x06000E7A RID: 3706 RVA: 0x00115CE0 File Offset: 0x00113EE0
private void Awake()
{
base.gameObject.GetComponent<Image>().alphaHitTestMinimumThreshold = this.threshold;
base.enabled = false;
}
// Token: 0x0400170B RID: 5899
public float threshold = 0.5f;
}

View File

@@ -0,0 +1,144 @@
using System;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
// Token: 0x02000099 RID: 153
public class ButtonMultiTargets : Button
{
// Token: 0x06000E7C RID: 3708 RVA: 0x00115D14 File Offset: 0x00113F14
protected override void Start()
{
this.GetTargetGraphics();
base.Start();
Color color = base.colors.normalColor;
if (this.hasTargetGraphics)
{
Image[] array = this.targetImages;
for (int i = 0; i < array.Length; i++)
{
array[i].CrossFadeColor(color, 0f, true, true);
TextMeshProUGUI[] array2 = this.targetText;
for (int j = 0; j < array2.Length; j++)
{
array2[j].CrossFadeColor(color, 0f, true, true);
}
}
if (base.currentSelectionState == Selectable.SelectionState.Disabled)
{
color = base.colors.disabledColor;
array = this.targetImages;
for (int i = 0; i < array.Length; i++)
{
array[i].CrossFadeColor(color, 0f, true, true);
TextMeshProUGUI[] array2 = this.targetText;
for (int j = 0; j < array2.Length; j++)
{
array2[j].CrossFadeColor(color, 0f, true, true);
}
}
}
}
}
// Token: 0x06000E7D RID: 3709 RVA: 0x00115E04 File Offset: 0x00114004
private void GetTargetGraphics()
{
if (!this.targetGraphics)
{
this.targetGraphics = base.GetComponent<MultiTargetGraphics>();
this.hasTargetGraphics = true;
}
if (this.hasTargetGraphics)
{
this.targetImages = this.targetGraphics.targetImages;
this.targetText = this.targetGraphics.targetText;
}
}
// Token: 0x06000E7E RID: 3710 RVA: 0x00115E5C File Offset: 0x0011405C
protected override void DoStateTransition(Selectable.SelectionState state, bool instant)
{
if (!this.hasTargetGraphics)
{
this.GetTargetGraphics();
}
if (state == Selectable.SelectionState.Highlighted && Input.GetMouseButton(0))
{
return;
}
Color color = ((state == Selectable.SelectionState.Disabled) ? base.colors.disabledColor : ((state == Selectable.SelectionState.Highlighted) ? base.colors.highlightedColor : ((state == Selectable.SelectionState.Normal) ? base.colors.normalColor : ((state == Selectable.SelectionState.Pressed) ? base.colors.pressedColor : ((state == Selectable.SelectionState.Selected) ? base.colors.selectedColor : Color.white)))));
Image[] array = this.targetImages;
for (int i = 0; i < array.Length; i++)
{
array[i].CrossFadeColor(color, instant ? 0f : base.colors.fadeDuration, true, true);
}
TextMeshProUGUI[] array2 = this.targetText;
for (int i = 0; i < array2.Length; i++)
{
array2[i].CrossFadeColor(color, instant ? 0f : base.colors.fadeDuration, true, true);
}
}
// Token: 0x06000E7F RID: 3711 RVA: 0x00115F60 File Offset: 0x00114160
private bool CanReachSelectable(Selectable select)
{
return !select || (select.interactable && select.gameObject.activeInHierarchy);
}
// Token: 0x06000E80 RID: 3712 RVA: 0x00115F84 File Offset: 0x00114184
public override Selectable FindSelectableOnLeft()
{
Selectable selectable = base.FindSelectableOnLeft();
while (!this.CanReachSelectable(selectable))
{
selectable = selectable.FindSelectableOnLeft();
}
return selectable;
}
// Token: 0x06000E81 RID: 3713 RVA: 0x00115FAC File Offset: 0x001141AC
public override Selectable FindSelectableOnRight()
{
Selectable selectable = base.FindSelectableOnRight();
while (!this.CanReachSelectable(selectable))
{
selectable = selectable.FindSelectableOnRight();
}
return selectable;
}
// Token: 0x06000E82 RID: 3714 RVA: 0x00115FD4 File Offset: 0x001141D4
public override Selectable FindSelectableOnUp()
{
Selectable selectable = base.FindSelectableOnUp();
while (!this.CanReachSelectable(selectable))
{
selectable = selectable.FindSelectableOnUp();
}
return selectable;
}
// Token: 0x06000E83 RID: 3715 RVA: 0x00115FFC File Offset: 0x001141FC
public override Selectable FindSelectableOnDown()
{
Selectable selectable = base.FindSelectableOnDown();
while (!this.CanReachSelectable(selectable))
{
selectable = selectable.FindSelectableOnDown();
}
return selectable;
}
// Token: 0x0400170C RID: 5900
private Image[] targetImages;
// Token: 0x0400170D RID: 5901
private TextMeshProUGUI[] targetText;
// Token: 0x0400170E RID: 5902
private MultiTargetGraphics targetGraphics;
// Token: 0x0400170F RID: 5903
private bool hasTargetGraphics;
}

View File

@@ -0,0 +1,56 @@
using System;
using UnityEngine.UI;
// Token: 0x0200009A RID: 154
public class ButtonSmartNavigation : Button
{
// Token: 0x06000E85 RID: 3717 RVA: 0x0011602B File Offset: 0x0011422B
private bool CanReachSelectable(Selectable select)
{
return !select || (select.interactable && select.gameObject.activeInHierarchy);
}
// Token: 0x06000E86 RID: 3718 RVA: 0x0011604C File Offset: 0x0011424C
public override Selectable FindSelectableOnLeft()
{
Selectable selectable = base.FindSelectableOnLeft();
while (!this.CanReachSelectable(selectable))
{
selectable = selectable.FindSelectableOnLeft();
}
return selectable;
}
// Token: 0x06000E87 RID: 3719 RVA: 0x00116074 File Offset: 0x00114274
public override Selectable FindSelectableOnRight()
{
Selectable selectable = base.FindSelectableOnRight();
while (!this.CanReachSelectable(selectable))
{
selectable = selectable.FindSelectableOnRight();
}
return selectable;
}
// Token: 0x06000E88 RID: 3720 RVA: 0x0011609C File Offset: 0x0011429C
public override Selectable FindSelectableOnUp()
{
Selectable selectable = base.FindSelectableOnUp();
while (!this.CanReachSelectable(selectable))
{
selectable = selectable.FindSelectableOnUp();
}
return selectable;
}
// Token: 0x06000E89 RID: 3721 RVA: 0x001160C4 File Offset: 0x001142C4
public override Selectable FindSelectableOnDown()
{
Selectable selectable = base.FindSelectableOnDown();
while (!this.CanReachSelectable(selectable))
{
selectable = selectable.FindSelectableOnDown();
}
return selectable;
}
}

View File

@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using UnityEngine;
// Token: 0x02000082 RID: 130
[Serializable]
public class ByeProbuilder : MonoBehaviour
{
// Token: 0x0400146D RID: 5229
public Bounds bounds;
// Token: 0x0400146E RID: 5230
public List<Transform> parentList = new List<Transform>();
// Token: 0x0400146F RID: 5231
public List<Transform> childList = new List<Transform>();
// Token: 0x04001470 RID: 5232
public List<Light> lightList = new List<Light>();
// Token: 0x04001471 RID: 5233
public int settingMin;
// Token: 0x04001472 RID: 5234
public LayerMask everythingCullingMask = -1;
// Token: 0x04001473 RID: 5235
public List<GameObject> pointChildren = new List<GameObject>();
// Token: 0x04001474 RID: 5236
public List<Vector3> points = new List<Vector3>();
// Token: 0x04001475 RID: 5237
public List<Quaternion> rots = new List<Quaternion>();
// Token: 0x04001476 RID: 5238
public List<GameObject> spheres = new List<GameObject>();
// Token: 0x04001477 RID: 5239
private RaycastHit[] hits;
}

View File

@@ -0,0 +1,161 @@
using System;
using UnityEngine;
// Token: 0x02000002 RID: 2
public class CameraControls : MonoBehaviour
{
// Token: 0x04000001 RID: 1
[Header("Smoothing")]
public bool Smoothing;
// Token: 0x04000002 RID: 2
public float MoveDampening;
// Token: 0x04000003 RID: 3
public float ZoomDampening;
// Token: 0x04000004 RID: 4
public float RotationDampening;
// Token: 0x04000005 RID: 5
public float TiltDampening;
// Token: 0x04000006 RID: 6
[Header("Keys and Mouse")]
public bool AllowMove;
// Token: 0x04000007 RID: 7
public float MoveSpeed;
// Token: 0x04000008 RID: 8
public bool AllowFastMove;
// Token: 0x04000009 RID: 9
public float FastMoveSpeed;
// Token: 0x0400000A RID: 10
public KeyCode FastMoveKeyCode1;
// Token: 0x0400000B RID: 11
public KeyCode FastMoveKeyCode2;
// Token: 0x0400000C RID: 12
public bool AllowRotate;
// Token: 0x0400000D RID: 13
public float RotateSpeed;
// Token: 0x0400000E RID: 14
public bool AllowZoom;
// Token: 0x0400000F RID: 15
public float ZoomSpeed;
// Token: 0x04000010 RID: 16
public bool AllowTilt;
// Token: 0x04000011 RID: 17
public float TiltSpeed;
// Token: 0x04000012 RID: 18
public KeyCode ResetKey;
// Token: 0x04000013 RID: 19
public bool IncludePositionOnReset;
// Token: 0x04000014 RID: 20
public bool MovementBreaksFollow;
// Token: 0x04000015 RID: 21
public string HorizontalInputAxis = "Horizontal";
// Token: 0x04000016 RID: 22
public string VerticalInputAxis = "Vertical";
// Token: 0x04000017 RID: 23
public bool RotateUsesInputAxis;
// Token: 0x04000018 RID: 24
public string RotateInputAxis = "KbCameraRotate";
// Token: 0x04000019 RID: 25
public KeyCode RotateLeftKey = KeyCode.Q;
// Token: 0x0400001A RID: 26
public KeyCode RotateRightKey = KeyCode.E;
// Token: 0x0400001B RID: 27
public bool ZoomUsesInputAxis;
// Token: 0x0400001C RID: 28
public string ZoomInputAxis = "KbCameraZoom";
// Token: 0x0400001D RID: 29
public KeyCode ZoomOutKey = KeyCode.Z;
// Token: 0x0400001E RID: 30
public KeyCode ZoomInKey = KeyCode.X;
// Token: 0x0400001F RID: 31
public bool TiltUsesInputAxis;
// Token: 0x04000020 RID: 32
public string TiltInputAxis = "KbCameraTilt";
// Token: 0x04000021 RID: 33
public KeyCode TiltUpKey = KeyCode.R;
// Token: 0x04000022 RID: 34
public KeyCode TiltDownKey = KeyCode.F;
// Token: 0x04000023 RID: 35
public KeyCode MouseOrbitButton;
// Token: 0x04000024 RID: 36
public bool AllowScreenEdgeMove;
// Token: 0x04000025 RID: 37
public bool ScreenEdgeMoveBreaksFollow;
// Token: 0x04000026 RID: 38
public int ScreenEdgeBorderWidth;
// Token: 0x04000027 RID: 39
public bool AllowPan;
// Token: 0x04000028 RID: 40
public bool PanBreaksFollow;
// Token: 0x04000029 RID: 41
public float PanSpeed;
// Token: 0x0400002A RID: 42
public float RotateSpeedMouse;
// Token: 0x0400002B RID: 43
public float MoveSpeedMouse;
// Token: 0x0400002C RID: 44
public float TiltSpeedMouse;
// Token: 0x0400002D RID: 45
public float ZoomSpeedMouse;
// Token: 0x0400002E RID: 46
public float FollowSpeed;
// Token: 0x0400002F RID: 47
public string RotateInputAxisMouse = "Mouse X";
// Token: 0x04000030 RID: 48
public string TiltInputAxisMouse = "Mouse Y";
// Token: 0x04000031 RID: 49
public string ZoomInputAxisMouse = "Mouse ScrollWheel";
// Token: 0x04000032 RID: 50
public KeyCode PanKey1 = KeyCode.LeftShift;
// Token: 0x04000033 RID: 51
public KeyCode PanKey2 = KeyCode.RightShift;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,46 @@
using System;
using UnityEngine;
// Token: 0x0200005D RID: 93
public class CameraFogOfWar : MonoBehaviour
{
// Token: 0x06000B43 RID: 2883 RVA: 0x000DD4AF File Offset: 0x000DB6AF
private void Start()
{
}
// Token: 0x06000B44 RID: 2884 RVA: 0x000DD4B1 File Offset: 0x000DB6B1
private void OnEnable()
{
}
// Token: 0x06000B45 RID: 2885 RVA: 0x000DD4B3 File Offset: 0x000DB6B3
private void OnDisable()
{
}
// Token: 0x06000B46 RID: 2886 RVA: 0x000DD4B8 File Offset: 0x000DB6B8
private void OnRenderImage(RenderTexture src, RenderTexture dest)
{
if (!this.cam)
{
this.cam = Camera.main;
}
if (this.cam)
{
Matrix4x4 cameraToWorldMatrix = this.cam.cameraToWorldMatrix;
Shader.SetGlobalMatrix("_CamToWorld", this.cam.cameraToWorldMatrix);
if (!this.fogMaterial)
{
this.fogMaterial = new Material(Shader.Find("Hannah/FogOfWar"));
}
Graphics.Blit(src, dest, this.fogMaterial);
}
}
// Token: 0x04001046 RID: 4166
private Material fogMaterial;
// Token: 0x04001047 RID: 4167
private Camera cam;
}

View File

@@ -0,0 +1,136 @@
using System;
using UnityEngine;
using UnityEngine.Rendering;
// Token: 0x0200005E RID: 94
[ExecuteInEditMode]
public class CameraParams : MonoBehaviour
{
// Token: 0x06000B48 RID: 2888 RVA: 0x000DD544 File Offset: 0x000DB744
private void Start()
{
this.SetParams();
if (this.meshRenderer)
{
this.meshRenderer.shadowCastingMode = ShadowCastingMode.Off;
this.meshRenderer.receiveShadows = false;
if (this.meshRenderer && this.meshRenderer.sharedMaterial)
{
this.bakedShadows = this.meshRenderer.sharedMaterial.GetTexture("_ShadowsTex");
}
}
}
// Token: 0x06000B49 RID: 2889 RVA: 0x000DD5B6 File Offset: 0x000DB7B6
private void OnEnable()
{
this.SetParams();
}
// Token: 0x06000B4A RID: 2890 RVA: 0x000DD5BE File Offset: 0x000DB7BE
private void Update()
{
this.SetParams();
}
// Token: 0x06000B4B RID: 2891 RVA: 0x000DD5C8 File Offset: 0x000DB7C8
public void SetParams()
{
if (this.cam)
{
this.sceneMatrix = this.cam.cameraToWorldMatrix;
if (this.meshRenderer && this.meshRenderer.sharedMaterial)
{
this.meshRenderer.sharedMaterial.SetMatrix("_Scene_CamToWorld", this.sceneMatrix);
this.projMatrix = GL.GetGPUProjectionMatrix(this.cam.projectionMatrix, true) * this.cam.worldToCameraMatrix;
this.meshRenderer.sharedMaterial.SetMatrix("_Scene_CameraProjectionMatrix", this.projMatrix);
if (this.shadowParams)
{
this.meshRenderer.sharedMaterial.SetMatrix("_Scene_ShadowMatrix_", this.shadowParams.shadowMatrixMorning);
}
else
{
this.meshRenderer.sharedMaterial.SetMatrix("_Scene_ShadowMatrix_", this.shadowMatrixMorning);
}
float num = 1f;
this.projParams = new Vector4(num, this.cam.nearClipPlane, this.cam.farClipPlane, 1f / this.cam.farClipPlane);
this.meshRenderer.sharedMaterial.SetVector("_Scene_ProjectionParams", this.projParams);
}
}
}
// Token: 0x04001048 RID: 4168
[Header("CAMERA VARIABLES")]
public Matrix4x4 projMatrix;
// Token: 0x04001049 RID: 4169
public Matrix4x4 sceneMatrix;
// Token: 0x0400104A RID: 4170
public Vector4 projParams;
// Token: 0x0400104B RID: 4171
public Matrix4x4 shadowMatrixMorning;
// Token: 0x0400104C RID: 4172
public Matrix4x4 shadowMatrixAfternoon;
// Token: 0x0400104D RID: 4173
public Matrix4x4 shadowMatrixEvening;
// Token: 0x0400104E RID: 4174
public Matrix4x4 shadowMatrixNight;
// Token: 0x0400104F RID: 4175
public Matrix4x4 shadowMatrixIndoor;
// Token: 0x04001050 RID: 4176
public Texture2D shadowsMorning;
// Token: 0x04001051 RID: 4177
public Texture2D shadowsAfternoon;
// Token: 0x04001052 RID: 4178
public Texture2D shadowsEvening;
// Token: 0x04001053 RID: 4179
public Texture2D shadowsNight;
// Token: 0x04001054 RID: 4180
public Texture2D shadowsIndoors;
// Token: 0x04001055 RID: 4181
public Texture bakedShadows;
// Token: 0x04001056 RID: 4182
public Texture2D pointLightShadow1;
// Token: 0x04001057 RID: 4183
public Texture2D pointLightShadow2;
// Token: 0x04001058 RID: 4184
public Texture2D pointLightShadow3;
// Token: 0x04001059 RID: 4185
public Texture2D pointLightShadow4;
// Token: 0x0400105A RID: 4186
public Texture2D pointLightShadow5;
// Token: 0x0400105B RID: 4187
public Texture2D pointLightShadow6;
// Token: 0x0400105C RID: 4188
public Vector3 center;
// Token: 0x0400105D RID: 4189
[Header("RENDERER")]
public MeshRenderer meshRenderer;
// Token: 0x0400105E RID: 4190
[Header("CAMERA")]
public Camera cam;
// Token: 0x0400105F RID: 4191
public CameraParams shadowParams;
}

View File

@@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using UnityEngine;
// Token: 0x0200005F RID: 95
public class CaptureAreaInfo : MonoBehaviour
{
// Token: 0x06000B4D RID: 2893 RVA: 0x000DD71E File Offset: 0x000DB91E
private void Start()
{
}
// Token: 0x06000B4E RID: 2894 RVA: 0x000DD720 File Offset: 0x000DB920
public void TurnOnLights()
{
foreach (InteriorLights interiorLights in this.pointLights)
{
interiorLights.TurnOnLights();
}
}
// Token: 0x06000B4F RID: 2895 RVA: 0x000DD770 File Offset: 0x000DB970
public void TurnOffLights()
{
foreach (InteriorLights interiorLights in this.pointLights)
{
interiorLights.TurnOffLights();
}
}
// Token: 0x04001060 RID: 4192
public int index;
// Token: 0x04001061 RID: 4193
public string id;
// Token: 0x04001062 RID: 4194
public List<BoxCollider> boundingBoxes = new List<BoxCollider>();
// Token: 0x04001063 RID: 4195
public List<BoxCollider> interiorCameraBoxes = new List<BoxCollider>();
// Token: 0x04001064 RID: 4196
public Camera sceneCamera;
// Token: 0x04001065 RID: 4197
public Camera minimapCamera;
// Token: 0x04001066 RID: 4198
public BoxCollider cameraCollider;
// Token: 0x04001067 RID: 4199
public BoxCollider exteriorCameraBoundsCollider;
// Token: 0x04001068 RID: 4200
public GameObject terrainMap;
// Token: 0x04001069 RID: 4201
public List<InteriorLights> pointLights = new List<InteriorLights>();
// Token: 0x0400106A RID: 4202
public List<GameObject> quads = new List<GameObject>();
// Token: 0x0400106B RID: 4203
public bool perspectiveShot;
// Token: 0x0400106C RID: 4204
public bool isInterior;
// Token: 0x0400106D RID: 4205
[Header("Art")]
public GameObject backgroundArt;
// Token: 0x0400106E RID: 4206
public Texture2D sceneMap;
}

View File

@@ -0,0 +1,295 @@
using System;
using UnityEngine;
// Token: 0x02000073 RID: 115
[ExecuteInEditMode]
public class CaptureBackgrounds : MonoBehaviour
{
// Token: 0x06000B85 RID: 2949 RVA: 0x000DF670 File Offset: 0x000DD870
public void Setup()
{
if (this.normalsTexture)
{
this.normalsTexture.Release();
}
if (this.albedoTexture)
{
this.albedoTexture.Release();
}
if (this.smoothnessTexture)
{
this.smoothnessTexture.Release();
}
if (this.depthTexture)
{
this.depthTexture.Release();
}
if (this.pointLightTexture)
{
this.pointLightTexture.Release();
}
if (this.albedoTempTexture)
{
this.albedoTempTexture.Release();
}
if (this.directionalLightTexture)
{
this.directionalLightTexture.Release();
}
if (this.specularTexture)
{
this.specularTexture.Release();
}
if (this.specShadowsTexture)
{
this.specShadowsTexture.Release();
}
this.depthTexture = new RenderTexture(this.depthWidth, this.depthHeight, 24, RenderTextureFormat.ARGBFloat);
this.normalsTexture = new RenderTexture(this.normalWidth, this.normalHeight, 24, RenderTextureFormat.ARGBFloat);
this.albedoTexture = new RenderTexture(this.albedoWidth, this.albedoHeight, 24, RenderTextureFormat.ARGBFloat);
this.smoothnessTexture = new RenderTexture(this.albedoWidth, this.albedoHeight, 24, RenderTextureFormat.ARGBFloat);
this.pointLightTexture = new RenderTexture(this.depthWidth, this.depthHeight, 24, RenderTextureFormat.ARGBHalf);
this.directionalLightTexture = new RenderTexture(this.shadowWidth, this.shadowHeight, 24, RenderTextureFormat.ARGBFloat);
this.albedoTempTexture = new RenderTexture(this.albedoWidth, this.albedoHeight, 24, RenderTextureFormat.ARGBFloat);
this.specularTexture = new RenderTexture(this.shadowWidth, this.shadowHeight, 24, RenderTextureFormat.ARGBFloat);
this.specShadowsTexture = new RenderTexture(this.shadowWidth, this.shadowHeight, 24, RenderTextureFormat.ARGBFloat);
}
// Token: 0x06000B86 RID: 2950 RVA: 0x000DF848 File Offset: 0x000DDA48
private void OnDisable()
{
if (this.normalsTexture)
{
this.normalsTexture.Release();
}
if (this.albedoTexture)
{
this.albedoTexture.Release();
}
if (this.smoothnessTexture)
{
this.smoothnessTexture.Release();
}
if (this.depthTexture)
{
this.depthTexture.Release();
}
if (this.pointLightTexture)
{
this.pointLightTexture.Release();
}
if (this.albedoTempTexture)
{
this.albedoTempTexture.Release();
}
if (this.directionalLightTexture)
{
this.directionalLightTexture.Release();
}
if (this.specularTexture)
{
this.specularTexture.Release();
}
if (this.specShadowsTexture)
{
this.specShadowsTexture.Release();
}
}
// Token: 0x06000B87 RID: 2951 RVA: 0x000DF930 File Offset: 0x000DDB30
private void Update()
{
if (!this.cam)
{
this.cam = base.gameObject.GetComponent<Camera>();
}
if (!this.normalsTexture)
{
this.Setup();
}
if (!this.cam)
{
return;
}
if (this.albedo || this.directionalShadows)
{
this.cam.enabled = true;
}
else
{
this.cam.enabled = false;
}
if (this.normalsTexture.width != this.normalWidth || this.normalsTexture.height != this.normalHeight || this.albedoTexture.width != this.albedoWidth || this.albedoTexture.height != this.albedoHeight || this.depthTexture.height != this.depthHeight || this.pointLightTexture.height != this.depthHeight || this.directionalLightTexture.height != this.shadowHeight)
{
this.Setup();
}
if (this.directionalShadows)
{
if (!this.directionalLightShader)
{
this.directionalLightShader = Shader.Find("Hidden/ViewDirectionalShadows");
}
Shader.SetGlobalFloat("passNumber", 1f);
this.cam.targetTexture = this.directionalLightTexture;
this.cam.RenderWithShader(this.directionalLightShader, "RenderType");
this.cam.targetTexture = null;
Shader.SetGlobalFloat("passNumber", 0f);
this.cam.targetTexture = this.specularTexture;
this.cam.RenderWithShader(this.directionalLightShader, "RenderType");
this.cam.targetTexture = null;
}
if (this.normalsTexture && this.normals)
{
if (!this.normalsShader)
{
this.normalsShader = Shader.Find("Hidden/ViewNormals");
}
this.cam.targetTexture = this.normalsTexture;
this.cam.RenderWithShader(this.normalsShader, "RenderType");
this.cam.targetTexture = null;
Shader.SetGlobalTexture("_GlobalNormalsTex", this.normalsTexture);
}
if (this.depthTexture && this.depth)
{
if (!this.depthShader)
{
this.depthShader = Shader.Find("Hidden/ViewDepthOrtho");
}
this.cam.targetTexture = this.depthTexture;
this.cam.RenderWithShader(this.depthShader, "RenderType");
this.cam.targetTexture = null;
Shader.SetGlobalTexture("_GlobalDepthTex", this.depthTexture);
}
if (this.smoothnessTexture && this.albedo)
{
if (!this.smoothnessShader)
{
this.smoothnessShader = Shader.Find("Hidden/ViewSmoothness");
}
this.cam.targetTexture = this.smoothnessTexture;
this.cam.RenderWithShader(this.smoothnessShader, "RenderType");
this.cam.targetTexture = null;
this.doAlbedo = true;
this.cam.targetTexture = this.albedoTempTexture;
this.cam.Render();
this.cam.targetTexture = null;
this.doAlbedo = false;
}
}
// Token: 0x06000B88 RID: 2952 RVA: 0x000DFC68 File Offset: 0x000DDE68
private void OnRenderImage(RenderTexture src, RenderTexture dest)
{
if (this.albedoTexture && this.doAlbedo)
{
if (!this.albedoMaterial)
{
this.albedoMaterial = new Material(Shader.Find("Hidden/CombineCaptures"));
}
this.albedoMaterial.SetTexture("_SmoothnessTex", this.smoothnessTexture);
this.albedoMaterial.SetTexture("_AlbedoTex", this.albedoTempTexture);
Graphics.Blit(src, this.albedoTexture, this.albedoMaterial, 0);
}
if (this.specularTexture && this.directionalShadows)
{
if (!this.albedoMaterial)
{
this.albedoMaterial = new Material(Shader.Find("Hidden/CombineCaptures"));
}
this.albedoMaterial.SetTexture("_SpecTex", this.specularTexture);
this.albedoMaterial.SetTexture("_LightTex", this.directionalLightTexture);
Graphics.Blit(src, this.specShadowsTexture, this.albedoMaterial, 1);
}
Graphics.Blit(src, dest);
}
// Token: 0x0400117F RID: 4479
public bool normals;
// Token: 0x04001180 RID: 4480
public bool albedo = true;
// Token: 0x04001181 RID: 4481
public bool depth;
// Token: 0x04001182 RID: 4482
public bool directionalShadows;
// Token: 0x04001183 RID: 4483
private Camera cam;
// Token: 0x04001184 RID: 4484
public RenderTexture normalsTexture;
// Token: 0x04001185 RID: 4485
public RenderTexture albedoTexture;
// Token: 0x04001186 RID: 4486
public RenderTexture smoothnessTexture;
// Token: 0x04001187 RID: 4487
public RenderTexture pointLightTexture;
// Token: 0x04001188 RID: 4488
public RenderTexture directionalLightTexture;
// Token: 0x04001189 RID: 4489
public RenderTexture specularTexture;
// Token: 0x0400118A RID: 4490
public RenderTexture albedoTempTexture;
// Token: 0x0400118B RID: 4491
public RenderTexture depthTexture;
// Token: 0x0400118C RID: 4492
public RenderTexture specShadowsTexture;
// Token: 0x0400118D RID: 4493
public Shader normalsShader;
// Token: 0x0400118E RID: 4494
public Shader smoothnessShader;
// Token: 0x0400118F RID: 4495
public Shader depthShader;
// Token: 0x04001190 RID: 4496
public Shader pointBakeShader;
// Token: 0x04001191 RID: 4497
public Shader directionalLightShader;
// Token: 0x04001192 RID: 4498
private Material albedoMaterial;
// Token: 0x04001193 RID: 4499
public int depthWidth = 2048;
// Token: 0x04001194 RID: 4500
public int depthHeight = 2048;
// Token: 0x04001195 RID: 4501
public int albedoWidth = 2048;
// Token: 0x04001196 RID: 4502
public int albedoHeight = 2048;
// Token: 0x04001197 RID: 4503
public int normalWidth = 2048;
// Token: 0x04001198 RID: 4504
public int normalHeight = 2048;
// Token: 0x04001199 RID: 4505
public int shadowWidth = 2048;
// Token: 0x0400119A RID: 4506
public int shadowHeight = 2048;
// Token: 0x0400119B RID: 4507
private bool doAlbedo;
// Token: 0x0400119C RID: 4508
public Transform lightTransform;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,822 @@
using System;
using System.Collections.Generic;
using PixelCrushers.DialogueSystem;
using UnityEngine;
// Token: 0x0200001C RID: 28
public class CharacterQuips : MonoBehaviour
{
// Token: 0x06000460 RID: 1120 RVA: 0x00063B1C File Offset: 0x00061D1C
private void Awake()
{
this.AddQuip("Party");
this.AddQuip("BloodlessHunter");
this.AddQuip("Yeti");
this.AddQuip("Empty");
this.AddQuip("FarmerRozafir");
this.AddQuip("FarmerRozafirChora");
this.AddQuip("Pedlar");
this.AddQuip("Stonesmith");
this.AddQuip("Menestral");
this.AddQuip("Barkeep");
this.AddQuip("BarkeepRozafir");
this.AddQuip("Shipwrith");
this.AddQuip("BarPatron");
this.AddQuip("Herder");
this.AddQuip("Meadmaid");
this.AddQuip("Monger");
this.AddQuip("Chanter");
this.AddQuip("Dolki");
this.AddQuip("Cook");
this.AddQuip("CookApprentice");
this.AddQuip("FarmerLazure");
this.AddQuip("RozafirUnderkeep");
this.AddQuip("HerderRozafir");
this.AddQuip("GuardLazure");
this.AddQuip("GuardRozafir");
this.AddQuip("RozafirStorekeep");
this.AddQuip("RozafirNewStorekeep");
this.AddQuip("Resting");
this.AddQuip("BanquetFriend");
this.AddQuip("BanquetSpawn");
this.AddQuip("GuardMainC5Caravan");
this.AddQuip("GuardC5Caravan");
this.AddQuip("C5Camper");
this.AddQuip("LittleFairyC5_A");
this.AddQuip("LittleFairyC5_B");
this.AddQuip("LittleFairyC5_C");
this.AddQuip("LittleFairyC6_A");
this.AddQuip("LittleFairyC6_B");
this.AddQuip("LittleFairyC6_C");
this.AddQuip("LittleFairyE6_A");
this.AddQuip("LittleFairyE6_B");
this.AddQuip("LittleFairyE6_C");
this.AddQuip("GuardD5");
this.AddQuip("RobberD5");
this.AddQuip("Minstrel");
}
// Token: 0x06000461 RID: 1121 RVA: 0x00063D18 File Offset: 0x00061F18
private void AddQuip(string n)
{
QuipSet.Quips quips = new QuipSet.Quips();
if (n == "Party")
{
quips.type = n;
quips.foundItem = new List<string>();
this.l = quips.foundItem;
this.l.Add("I could use this");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("We should keep moving");
this.l.Add("Come on");
quips.equipJewelry = new List<string>();
this.l = quips.equipJewelry;
this.l.Add("This suits me");
this.l.Add("A fine piece");
this.l.Add("This befits my rank");
this.l.Add("I'm moving up in the world");
quips.equipJewelry = new List<string>();
this.l = quips.equipJewelry;
this.l.Add("I'll put this to good use");
this.l.Add("I can work with this");
this.l.Add("I'll give this a try");
this.l.Add("I could use this");
}
if (n == "BloodlessHunter")
{
quips.type = n;
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Something lingers");
this.l.Add("This air smells of death");
this.l.Add("Death clings to this land");
quips.taunt = new List<string>();
this.l = quips.taunt;
this.l.Add("Come and get me!");
}
if (n == "Yeti")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("Huh?");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("Huh?");
}
if (n == "Empty")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
}
if (n == "Pedlar")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Got used goods?");
this.l.Add("I'll buy anything...");
this.l.Add("Your trash is my treasure");
}
if (n == "Stonesmith")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("So dull...");
this.l.Add("Where are those hammers hiding...?");
this.l.Add("Riddled with holes...");
}
if (n == "Menestral")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("La-la-la di-dilly-day");
this.l.Add("Hmm-hmm-hmmmmmm");
this.l.Add("Do-a-di-a-tra-la-do");
}
if (n == "Barkeep")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Baked apples, mushroom curry...");
this.l.Add("Where has Florina run off to?");
this.l.Add("Etherflora, silaflora, musswort...");
}
if (n == "BarkeepRozafir")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Good music today...");
this.l.Add("Reve has all the farmers working 'round the clock");
this.l.Add("Have you tried the mulled mead?");
this.l.Add("Imported rice beer, all the way from the Taratian hills...");
this.l.Add("Best to unwind with a spiced gin...");
}
if (n == "BarPatron")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Another round?");
this.l.Add("A decent inn, not what I expected");
this.l.Add("A pot of mushroom stew for me, please you");
this.l.Add("How now, Florina?");
this.l.Add("Did you hear about the spy? Reporting to the Renazin he was...");
this.l.Add("Good mead, this");
this.l.Add("Two barrels of peppura, I hear...");
this.l.Add("Just one more");
this.l.Add("What news, my good Nelu?");
}
if (n == "RozafirUnderkeep")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Another round?");
this.l.Add("Does this rice beer taste stale to you?");
this.l.Add("More bread pudding, please you");
this.l.Add("I feel safer down here");
this.l.Add("Have you visited the new shopkeep?");
this.l.Add("Good gin, this");
this.l.Add("Not long 'til harvest");
this.l.Add("Just one more");
this.l.Add("What news, good Vali?");
}
if (n == "Shipwrith")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Faster, faster");
this.l.Add("Not a boat in the harbor");
this.l.Add("Where is that shipment from Porta Dun?");
this.l.Add("No ships on the horizon");
}
if (n == "Shipwrith")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Where have I placed that netting?");
this.l.Add("Not one boat left behind...");
this.l.Add("I hope they're keeping watch on the horizon...");
this.l.Add("Not a ship to be seen...");
}
if (n == "Herder")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("You'll stay here with me");
this.l.Add("Your friends will return soon");
this.l.Add("So far from home...");
this.l.Add("None to tend them...");
}
if (n == "HerderRozafir")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Coats are looking good");
this.l.Add("No fleas");
this.l.Add("Too bright...");
this.l.Add("Not long 'til harvest...");
}
if (n == "Meadmaid")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
}
if (n == "Monger")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("One emerald, two emeralds, three...");
this.l.Add("Five-and-twenty emeralds, six-and-twenty...");
this.l.Add("Fresh wares!");
this.l.Add("Highest quality!");
}
if (n == "Chanter")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Respiv sima soara vivrii");
this.l.Add("Impez sima acru sil");
this.l.Add("Para sima pivi asade");
this.l.Add("Qie sima resivi se");
}
if (n == "Dolki")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Hisssss...");
this.l.Add("Hisss...");
this.l.Add("Hisssssssth...");
}
if (n == "Cook")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Five potatoes...dimi-bushel mushrooms...");
this.l.Add("Forget not the dilwere...");
this.l.Add("Boil, dry, then soak anew....");
}
if (n == "CookApprentice")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Spit duty yesternight");
this.l.Add("Spit duty morrownight");
this.l.Add("Spit duty everlasting");
}
if (n == "FarmerLazure")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Not yet ripe");
this.l.Add("These are ready for harvest");
this.l.Add("Shroomsect eggs...we'll need a potion");
this.l.Add("Blisters all over my hands...");
}
if (n == "FarmerRozafir")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("This plant needs more dew");
this.l.Add("My back aches so...");
this.l.Add("Sela fair blazes today");
this.l.Add("These leaves show signs of shroombites");
this.l.Add("Is that a small footprint?");
this.l.Add("Harvest is not so far away");
this.l.Add("What burrows here?");
}
if (n == "FarmerRozafirChora")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Mmmm-tra-la-la-lo...");
this.l.Add("Do-dora-dae...");
this.l.Add("Lo-La-Li-Lo-La-Li-Le...");
this.l.Add("Chora please bless us...Chora protect us...La-la-li la-la-li loooo...");
this.l.Add("Hmmm hmmmm hm hm hum hmmmmm");
}
if (n == "GuardLazure")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Stay sharp");
this.l.Add("No ships on the horizon yet");
this.l.Add("I should visit the stonesmith");
this.l.Add("Not long 'til harvest");
this.l.Add("No news yet from the Pavura");
this.l.Add("The Renazin would be fools to attack here");
this.l.Add("Was that a bakka howl?");
this.l.Add("The forten's on edge");
this.l.Add("Too soon for news from the army");
this.l.Add("Stay vigilant");
}
if (n == "GuardRozafir")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Stay sharp");
this.l.Add("Step wide around the Dolki");
this.l.Add("This will be the best harvest yet");
this.l.Add("No news yet from Forten Lazure");
this.l.Add("The Renazin would be fools to attack us");
this.l.Add("Wish there was fresh news from Forten Lazure");
}
if (n == "RozafirStorekeep")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Fresh wares all the way from Porta Dun");
this.l.Add("A better deal you'll not find");
this.l.Add("Don't bother traveling to Din Sera, this is premium stock");
}
if (n == "RozafirNewStorekeep")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("How now, my good guard?");
}
if (n == "Resting")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("I am not myself...");
this.l.Add("So tired...");
this.l.Add("I've not the strength to rise....");
}
if (n == "BanquetFriend")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("I never though to see such madness...");
this.l.Add("Where is the Lady of Spring?");
this.l.Add("Spawn of the Bloodless, every one of them...");
this.l.Add("Where are the gods now?");
}
if (n == "BanquetSpawn")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("I will obey...");
this.l.Add("Master...my will is yours...");
this.l.Add("All will fall to him...");
}
if (n == "GuardMainC5Caravan")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Stay sharp");
this.l.Add("Keep the incense burning");
this.l.Add("Another raid would be disastrous");
this.l.Add("Did you hear somewhat?");
this.l.Add("We should not linger here");
}
if (n == "GuardC5Caravan")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Did you hear that?");
this.l.Add("I'll not drop my guard");
this.l.Add("These woods are not safe");
this.l.Add("We should stay near the camp");
this.l.Add("I do not like the look of this place");
}
if (n == "C5Camper")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("This is a dismal beach");
this.l.Add("I fear to leave this fire");
this.l.Add("I long for my bed");
this.l.Add("Our supplies run low soon");
this.l.Add("This island is cursed");
}
if (n == "LittleFairyC5_A")
{
quips.type = n;
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("lis");
}
if (n == "LittleFairyC5_B")
{
quips.type = n;
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("fal");
}
if (n == "LittleFairyC5_C")
{
quips.type = n;
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("ero");
}
if (n == "LittleFairyC6_A")
{
quips.type = n;
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("ila");
}
if (n == "LittleFairyC6_B")
{
quips.type = n;
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("por");
}
if (n == "LittleFairyC6_C")
{
quips.type = n;
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("vex");
}
if (n == "LittleFairyE6_A")
{
quips.type = n;
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("sea");
}
if (n == "LittleFairyE6_B")
{
quips.type = n;
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("mar");
}
if (n == "LittleFairyE6_C")
{
quips.type = n;
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("fin");
}
if (n == "GuardD5")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("To arms!");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Wits sharp, blades sharper");
this.l.Add("House Dura will not falter!");
this.l.Add("What fresh predator stalks our borders?");
this.l.Add("Did you hear somewhat?");
this.l.Add("My skin fair crawls to sleep here");
}
if (n == "RobberD5")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("Intruder!");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("Did you hear that?");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("The cowards will regret their hasty attack!");
this.l.Add("We'll cut them down like the Grave Keeper!");
this.l.Add("We've not had fresh provisions for days...");
this.l.Add("Did you hear somewhat?");
this.l.Add("Rozafir's caverns are well-stocked, and poorly defended...");
}
if (n == "Minstrel")
{
quips.type = n;
quips.seen = new List<string>();
this.l = quips.seen;
this.l.Add("");
quips.heard = new List<string>();
this.l = quips.heard;
this.l.Add("");
quips.idle = new List<string>();
this.l = quips.idle;
this.l.Add("Mmmm-tra-la-la-lo...");
this.l.Add("Do-dora-dae...");
this.l.Add("Lo-La-Li-Lo-La-Li-Le...");
}
this.quips.Add(quips);
}
// Token: 0x06000462 RID: 1122 RVA: 0x00065A74 File Offset: 0x00063C74
public string GetQuip(string type, int quipID)
{
this.list = null;
if (quipID == -1)
{
return "";
}
if (type == "Seen")
{
this.list = this.quips[quipID].seen;
}
if (type == "Heard")
{
this.list = this.quips[quipID].heard;
}
if (type == "Taunt")
{
this.list = this.quips[quipID].taunt;
}
if (type == "Idle")
{
if (quipID == 4)
{
if (QuestLog.GetQuestState("D6_Chora") == QuestState.Complete)
{
this.list = this.quips[5].idle;
}
else
{
this.list = this.quips[quipID].idle;
}
}
else
{
this.list = this.quips[quipID].idle;
}
}
if (type == "End Search")
{
this.list = this.quips[quipID].endSearch;
}
if (type == "Scared")
{
this.list = this.quips[quipID].scared;
}
if (type == "Combat Win")
{
this.list = this.quips[quipID].combatWin;
}
if (type == "Found Item")
{
this.list = this.quips[quipID].foundItem;
}
if (type == "Equip Item")
{
this.list = this.quips[quipID].equipItem;
}
if (type == "Equip Jewelry")
{
this.list = this.quips[quipID].equipJewelry;
}
if (this.list != null && this.list.Count > 0)
{
return this.list[Random.Range(0, this.list.Count)];
}
return "";
}
// Token: 0x06000463 RID: 1123 RVA: 0x00065C7C File Offset: 0x00063E7C
public int GetQuipIndex(string quipLine)
{
for (int i = 0; i < this.quips.Count; i++)
{
if (quipLine == this.quips[i].type)
{
return i;
}
}
return -1;
}
// Token: 0x06000464 RID: 1124 RVA: 0x00065CBC File Offset: 0x00063EBC
public bool HasIdleQuip(int quipID)
{
this.list = null;
if (quipID == -1)
{
return false;
}
this.list = this.quips[quipID].idle;
return this.list != null && this.list.Count > 0;
}
// Token: 0x0400071C RID: 1820
private List<QuipSet.Quips> quips = new List<QuipSet.Quips>();
// Token: 0x0400071D RID: 1821
private List<string> list;
// Token: 0x0400071E RID: 1822
private List<string> l;
}

View File

@@ -0,0 +1,108 @@
using System;
using UnityEngine;
// Token: 0x02000060 RID: 96
public class Chest : MonoBehaviour
{
// Token: 0x0400106F RID: 4207
[Header("IF LOCKABLE")]
public bool lockable;
// Token: 0x04001070 RID: 4208
public bool locked;
// Token: 0x04001071 RID: 4209
public int lockDifficulty;
// Token: 0x04001072 RID: 4210
public int health;
// Token: 0x04001073 RID: 4211
public int armor;
// Token: 0x04001074 RID: 4212
public SceneItem.xmlNames keyItem = SceneItem.xmlNames.None;
// Token: 0x04001075 RID: 4213
public Creatures owner;
// Token: 0x04001076 RID: 4214
[Header("ALWAYS")]
public SceneItem.xmlNames item1 = SceneItem.xmlNames.None;
// Token: 0x04001077 RID: 4215
public int itemStack1 = 1;
// Token: 0x04001078 RID: 4216
public SceneItem.xmlNames item2 = SceneItem.xmlNames.None;
// Token: 0x04001079 RID: 4217
public int itemStack2 = 1;
// Token: 0x0400107A RID: 4218
public SceneItem.xmlNames item3 = SceneItem.xmlNames.None;
// Token: 0x0400107B RID: 4219
public int itemStack3 = 1;
// Token: 0x0400107C RID: 4220
public SceneItem.xmlNames item4 = SceneItem.xmlNames.None;
// Token: 0x0400107D RID: 4221
public int itemStack4 = 1;
// Token: 0x0400107E RID: 4222
public SceneItem.xmlNames item5 = SceneItem.xmlNames.None;
// Token: 0x0400107F RID: 4223
public int itemStack5 = 1;
// Token: 0x04001080 RID: 4224
public SceneItem.xmlNames item6 = SceneItem.xmlNames.None;
// Token: 0x04001081 RID: 4225
public int itemStack6 = 1;
// Token: 0x04001082 RID: 4226
public SceneItem.xmlNames item7 = SceneItem.xmlNames.None;
// Token: 0x04001083 RID: 4227
public int itemStack7 = 1;
// Token: 0x04001084 RID: 4228
public SceneItem.xmlNames item8 = SceneItem.xmlNames.None;
// Token: 0x04001085 RID: 4229
public int itemStack8 = 1;
// Token: 0x04001086 RID: 4230
public SceneItem.xmlNames item9 = SceneItem.xmlNames.None;
// Token: 0x04001087 RID: 4231
public int itemStack9 = 1;
// Token: 0x04001088 RID: 4232
public SceneItem.xmlNames item10 = SceneItem.xmlNames.None;
// Token: 0x04001089 RID: 4233
public int itemStack10 = 1;
// Token: 0x0400108A RID: 4234
[Header("EFFECT ON OPENING")]
public Chest.EffectTypes effect;
// Token: 0x0400108B RID: 4235
[Header("HOW TO BREAK IT")]
public Breakable.BreakableEffectRequired effectRequired;
// Token: 0x020001C2 RID: 450
public enum EffectTypes
{
// Token: 0x04002C14 RID: 11284
none,
// Token: 0x04002C15 RID: 11285
oil,
// Token: 0x04002C16 RID: 11286
sap
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,87 @@
using System;
using UnityEngine;
// Token: 0x02000004 RID: 4
[ExecuteInEditMode]
public class ClayShaderVariables : MonoBehaviour
{
// Token: 0x0600003B RID: 59 RVA: 0x000067E2 File Offset: 0x000049E2
private void Start()
{
}
// Token: 0x0600003C RID: 60 RVA: 0x000067E4 File Offset: 0x000049E4
private void Update()
{
Shader.SetGlobalFloat("_xEnviro_tcp2RampThreshold", this.enviroRampThreshold);
Shader.SetGlobalFloat("_xEnviro_tcp2RampSmoothness", this.enviroRampSmoothness);
Shader.SetGlobalVector("_xEnviro_tcp2HighlightColor", this.enviroHighlightColor);
Shader.SetGlobalVector("_xEnviro_tcp2ShadowColor", this.enviroShadowColor);
Shader.SetGlobalVector("_xEnviro_rimParams", new Vector3(this.enviroRimMin, this.enviroRimMax, this.enviroRimStrength));
Shader.SetGlobalVector("_xEnviro_rimColor", this.enviroRimColor);
Shader.SetGlobalVector("_xEnviro_tcp2DirShadowColor", this.enviroDirectionalShadow);
Shader.SetGlobalFloat("_xCharacter_tcp2RampThreshold", this.characterRampThreshold);
Shader.SetGlobalFloat("_xCharacter_tcp2RampSmoothness", this.characterRampSmoothness);
Shader.SetGlobalVector("_xCharacter_tcp2HighlightColor", this.characterHighlightColor);
Shader.SetGlobalVector("_xCharactertcp2ShadowColor", this.characterShadowColor);
Shader.SetGlobalVector("_xCharacter_rimParams", new Vector3(this.characterRimMin, this.characterRimMax, this.characterRimStrength));
Shader.SetGlobalVector("_xCharacter_rimColor", this.characterRimColor);
Shader.SetGlobalVector("_xCharactertcp2DirShadowColor", this.characterDirectionalShadow);
}
// Token: 0x04000114 RID: 276
[Header("CHARACTER LIGHTING")]
public float characterRampThreshold = 0.5f;
// Token: 0x04000115 RID: 277
public float characterRampSmoothness = 0.1f;
// Token: 0x04000116 RID: 278
public float characterRimMin = 0.8f;
// Token: 0x04000117 RID: 279
public float characterRimMax = 0.85f;
// Token: 0x04000118 RID: 280
public float characterRimStrength = 0.5f;
// Token: 0x04000119 RID: 281
public Color characterRimColor = Color.white;
// Token: 0x0400011A RID: 282
public Color characterHighlightColor = Color.white;
// Token: 0x0400011B RID: 283
public Color characterShadowColor = Color.gray;
// Token: 0x0400011C RID: 284
public Color characterDirectionalShadow = Color.black;
// Token: 0x0400011D RID: 285
[Header("ENVIRONMENT LIGHTING")]
public float enviroRampThreshold = 0.5f;
// Token: 0x0400011E RID: 286
public float enviroRampSmoothness = 0.1f;
// Token: 0x0400011F RID: 287
public float enviroRimMin = 0.8f;
// Token: 0x04000120 RID: 288
public float enviroRimMax = 0.85f;
// Token: 0x04000121 RID: 289
public float enviroRimStrength = 0.5f;
// Token: 0x04000122 RID: 290
public Color enviroRimColor = Color.white;
// Token: 0x04000123 RID: 291
public Color enviroHighlightColor = Color.white;
// Token: 0x04000124 RID: 292
public Color enviroShadowColor = Color.gray;
// Token: 0x04000125 RID: 293
public Color enviroDirectionalShadow = Color.black;
}

View File

@@ -0,0 +1,190 @@
using System;
using UnityEngine;
// Token: 0x0200001E RID: 30
[RequireComponent(typeof(Animator))]
public class CleanIK : MonoBehaviour
{
// Token: 0x06000479 RID: 1145 RVA: 0x00066E5D File Offset: 0x0006505D
private void Start()
{
this.animator = base.GetComponent<Animator>();
this.layerMask = 4194433;
}
// Token: 0x0600047A RID: 1146 RVA: 0x00066E76 File Offset: 0x00065076
private void Update()
{
this.handleColliderOffset();
}
// Token: 0x0600047B RID: 1147 RVA: 0x00066E80 File Offset: 0x00065080
private void OnAnimatorIK()
{
if (this.animator && this.ikActive)
{
if (this.LeftFoot != null)
{
this.solveIK(this.LeftFoot, true);
}
if (this.RightFoot != null)
{
this.solveIK(this.RightFoot, false);
}
}
}
// Token: 0x0600047C RID: 1148 RVA: 0x00066ED8 File Offset: 0x000650D8
private void solveIK(Transform foot, bool left)
{
string name = foot.name;
RaycastHit raycastHit = default(RaycastHit);
Vector3 vector = default(Vector3);
Quaternion quaternion = Quaternion.identity;
if (Physics.Linecast(this.checkOrigin(foot.position), this.checkTarget(foot.position), out raycastHit, this.layerMask))
{
vector = this.footPosition(raycastHit);
quaternion = this.footRotation(foot, raycastHit);
if (left)
{
this.animator.SetIKPositionWeight(AvatarIKGoal.LeftFoot, 1f);
this.animator.SetIKPosition(AvatarIKGoal.LeftFoot, vector);
this.LeftFootY = vector.y;
if (this.rotation)
{
this.animator.SetIKRotationWeight(AvatarIKGoal.LeftFoot, 1f);
this.animator.SetIKRotation(AvatarIKGoal.LeftFoot, quaternion);
}
}
if (!left)
{
this.animator.SetIKPositionWeight(AvatarIKGoal.RightFoot, 1f);
this.animator.SetIKPosition(AvatarIKGoal.RightFoot, vector);
this.RightFootY = vector.y;
if (this.rotation)
{
this.animator.SetIKRotationWeight(AvatarIKGoal.RightFoot, 1f);
this.animator.SetIKRotation(AvatarIKGoal.RightFoot, quaternion);
}
}
}
}
// Token: 0x0600047D RID: 1149 RVA: 0x00066FE4 File Offset: 0x000651E4
private void handleColliderOffset()
{
this.stateBasedLegDistance();
if (!this.controller)
{
this.controller = base.gameObject.transform.parent.GetComponent<CharacterController>();
if (this.controller)
{
this.colliderHeight = this.controller.height;
this.controllerBoundsBottom = this.controller.bounds.extents.y;
}
}
if (this.controller)
{
if (this.planeSpeed(ref this.controller) < 0.1f)
{
float num = Mathf.Abs(this.LeftFootY - this.RightFootY);
this.controller.height = this.colliderHeight - num * this.deltaAmplifier;
return;
}
this.controller.height = this.colliderHeight;
}
}
// Token: 0x0600047E RID: 1150 RVA: 0x000670BA File Offset: 0x000652BA
private void stateBasedLegDistance()
{
if (this.controller)
{
this.legDistance = 1f / (this.planeSpeed(ref this.controller) + 0.8f);
}
}
// Token: 0x0600047F RID: 1151 RVA: 0x000670E8 File Offset: 0x000652E8
private float planeSpeed(ref CharacterController characterController)
{
Vector3 vector = new Vector3(characterController.velocity.x, 0f, characterController.velocity.z);
return vector.magnitude;
}
// Token: 0x06000480 RID: 1152 RVA: 0x00067120 File Offset: 0x00065320
private Quaternion footRotation(Transform foot, RaycastHit hit)
{
return Quaternion.LookRotation(Vector3.ProjectOnPlane(base.transform.forward, hit.normal), hit.normal);
}
// Token: 0x06000481 RID: 1153 RVA: 0x00067148 File Offset: 0x00065348
private Vector3 footPosition(RaycastHit hit)
{
Vector3 point = hit.point;
point.y += this.footOffset;
return point;
}
// Token: 0x06000482 RID: 1154 RVA: 0x0006716F File Offset: 0x0006536F
private Vector3 checkOrigin(Vector3 footPosition)
{
return footPosition + (this.legDistance + 0.25f) * Vector3.up;
}
// Token: 0x06000483 RID: 1155 RVA: 0x0006718D File Offset: 0x0006538D
private Vector3 checkTarget(Vector3 footPosition)
{
return footPosition - this.legDistance / 2f * Vector3.up;
}
// Token: 0x0400073E RID: 1854
protected Animator animator;
// Token: 0x0400073F RID: 1855
public bool ikActive;
// Token: 0x04000740 RID: 1856
public bool rotation = true;
// Token: 0x04000741 RID: 1857
public bool showMarkers;
// Token: 0x04000742 RID: 1858
public Transform LeftFoot;
// Token: 0x04000743 RID: 1859
public Transform RightFoot;
// Token: 0x04000744 RID: 1860
public float footOffset;
// Token: 0x04000745 RID: 1861
private float legDistance;
// Token: 0x04000746 RID: 1862
private int layerMask = 256;
// Token: 0x04000747 RID: 1863
private CharacterController controller;
// Token: 0x04000748 RID: 1864
private float colliderHeight;
// Token: 0x04000749 RID: 1865
private float controllerBoundsBottom;
// Token: 0x0400074A RID: 1866
private float LeftFootY;
// Token: 0x0400074B RID: 1867
private float RightFootY;
// Token: 0x0400074C RID: 1868
public float smooth = 10f;
// Token: 0x0400074D RID: 1869
public float deltaAmplifier = 1f;
// Token: 0x0400074E RID: 1870
private Rigidbody rbody;
}

View File

@@ -0,0 +1,140 @@
using System;
using System.Collections.Generic;
using UnityEngine;
// Token: 0x0200001F RID: 31
public class CollectCharacters : MonoBehaviour
{
// Token: 0x06000485 RID: 1157 RVA: 0x000671DB File Offset: 0x000653DB
private void Start()
{
Links.x.characterCollector = this;
this.tr = base.transform;
base.gameObject.SetActive(false);
}
// Token: 0x06000486 RID: 1158 RVA: 0x00067200 File Offset: 0x00065400
public void SetSpherePosition(Vector3 pos)
{
this.tr.position = pos;
}
// Token: 0x06000487 RID: 1159 RVA: 0x00067210 File Offset: 0x00065410
private void OnTriggerEnter(Collider other)
{
GameObject gameObject = other.gameObject;
this.AddCharacter(gameObject);
}
// Token: 0x06000488 RID: 1160 RVA: 0x0006722B File Offset: 0x0006542B
public void AddCharacter(GameObject go)
{
if (this.charactersGo.IndexOf(go) == -1)
{
this.toAdd.Add(go);
this.changingCharacters = true;
}
}
// Token: 0x06000489 RID: 1161 RVA: 0x0006724F File Offset: 0x0006544F
public void SwitchBlock()
{
this.charactersGo.Clear();
this.characters.Clear();
}
// Token: 0x0600048A RID: 1162 RVA: 0x00067268 File Offset: 0x00065468
public void LateAddCharacter()
{
foreach (GameObject gameObject in this.toAdd)
{
if (gameObject)
{
this.charactersGo.Add(gameObject);
this.characters.Add(gameObject.GetComponent<Character>());
}
}
this.toAdd.Clear();
this.UpdateCharacterNumbers();
}
// Token: 0x0600048B RID: 1163 RVA: 0x000672EC File Offset: 0x000654EC
public void LateRemoveCharacter()
{
int count = this.characters.Count;
for (int i = 0; i < count; i++)
{
if (!this.characters[i])
{
this.toRemove.Add(null);
}
else if (this.characters[i].inactive)
{
this.toRemove.Add(this.charactersGo[i]);
}
}
foreach (GameObject gameObject in this.toRemove)
{
int num = this.charactersGo.IndexOf(gameObject);
if (num > -1)
{
this.charactersGo.RemoveAt(num);
if (this.characters[num])
{
this.characters[num].body.SetMask(false);
}
this.characters.RemoveAt(num);
}
}
this.toRemove.Clear();
this.UpdateCharacterNumbers();
}
// Token: 0x0600048C RID: 1164 RVA: 0x00067408 File Offset: 0x00065608
public void RemoveCharacter(GameObject go)
{
if (this.charactersGo.IndexOf(go) > -1)
{
this.toRemove.Add(go);
this.changingCharacters = true;
}
}
// Token: 0x0600048D RID: 1165 RVA: 0x0006742C File Offset: 0x0006562C
public void UpdateCharacterNumbers()
{
int count = this.characters.Count;
for (int i = 0; i < count; i++)
{
if (this.characters[i] && this.characters[i].body)
{
this.characters[i].body.SetMaskNumber(((float)i + 2f) * 1f);
}
}
}
// Token: 0x0600048E RID: 1166 RVA: 0x000674A0 File Offset: 0x000656A0
private void OnTriggerExit(Collider other)
{
GameObject gameObject = other.gameObject;
this.RemoveCharacter(gameObject);
}
// Token: 0x0400074F RID: 1871
public List<Character> characters = new List<Character>();
// Token: 0x04000750 RID: 1872
public List<GameObject> charactersGo = new List<GameObject>();
// Token: 0x04000751 RID: 1873
private List<GameObject> toRemove = new List<GameObject>();
// Token: 0x04000752 RID: 1874
private List<GameObject> toAdd = new List<GameObject>();
// Token: 0x04000753 RID: 1875
public Transform tr;
// Token: 0x04000754 RID: 1876
public bool changingCharacters;
}

View File

@@ -0,0 +1,251 @@
using System;
using System.Collections;
using DarkTonic.MasterAudio;
using Pathfinding;
using UnityEngine;
// Token: 0x02000020 RID: 32
public class CollisionListener : MonoBehaviour
{
// Token: 0x06000490 RID: 1168 RVA: 0x000674F0 File Offset: 0x000656F0
public void StartLisening(string t)
{
if (this.turnOff != null)
{
this.EndNow();
base.StopCoroutine(this.turnOff);
this.turnOff = null;
}
this.type = t;
base.transform.rotation = Quaternion.identity;
this.rbody.isKinematic = false;
this.timeSinceCollision = 0f;
this.bounced = 0;
this.listen = true;
this.tr = base.transform;
this.dynamicCollide = false;
this.underground = false;
if (this.c)
{
this.safePosition = this.c.tr.position;
this.startPoint = this.c.tr.position;
}
}
// Token: 0x06000491 RID: 1169 RVA: 0x000675B0 File Offset: 0x000657B0
private void Update()
{
RaycastHit raycastHit;
if (this.listen && !this.rbody.isKinematic && !this.dynamicCollide && this.c && Physics.Raycast(this.tr.position + new Vector3(0f, 30f, 0f), Vector3.up * -1f, out raycastHit, 200f, 4194305))
{
if (this.tr.position.y < raycastHit.point.y)
{
this.safePosition = raycastHit.point;
this.underground = true;
return;
}
if (!this.dynamicCollide)
{
Vector3 position = this.tr.position;
bool flag = Physics.Linecast(position + new Vector3(0f, 20f, 0f), raycastHit.point, 144);
bool flag2 = false;
if (!flag)
{
flag2 = Physics.Raycast(position + new Vector3(0f, 400f, 0f), Vector3.up * -1f, 1000f, 768);
}
RaycastHit raycastHit2;
if ((flag || flag2) && !this.dynamicCollide && Physics.SphereCast(this.c.tr.position + new Vector3(0f, 20f, 0f), 1.25f, Vector3.up * -1f, out raycastHit2, 200f, 4194305))
{
if (this.c.node != null)
{
this.c.setArea = (int)this.c.node.Area;
}
GraphNode graphNode = this.c.NearNode(raycastHit2.point, false, 0, -1, 0);
if (graphNode != null)
{
this.safePosition = (Vector3)graphNode.position;
this.c.ClaimNode(graphNode, this.safePosition, false);
}
else if (this.c.node != null)
{
this.safePosition = (Vector3)graphNode.position;
}
else
{
this.safePosition = this.startPoint;
}
this.dynamicCollide = true;
}
}
}
}
// Token: 0x06000492 RID: 1170 RVA: 0x000677F4 File Offset: 0x000659F4
private void FixedUpdate()
{
if (this.listen && !this.rbody.isKinematic)
{
if (this.body)
{
this.body.tr.position = this.tr.position - new Vector3(0f, 0.2f, 0f);
}
if (this.c)
{
if (!this.c.jumpingPosition && !this.c.jumpingAreas)
{
if (this.underground)
{
if (Mathf.Abs(this.tr.position.y - this.safePosition.y) > 0.5f)
{
Vector3 vector = Vector3.Lerp(this.c.tr.position, this.safePosition, Time.fixedDeltaTime * 5f);
this.c.SetPosition(vector, null);
return;
}
}
else
{
if (this.dynamicCollide)
{
Vector3 vector2 = Vector3.Lerp(this.c.tr.position, this.safePosition, Time.fixedDeltaTime * 7f);
this.c.SetPosition(vector2, null);
return;
}
this.c.SetPosition(this.tr.position - new Vector3(0f, 0.4f, 0f), null);
return;
}
}
else
{
this.End();
}
}
}
}
// Token: 0x06000493 RID: 1171 RVA: 0x0006796C File Offset: 0x00065B6C
private void OnCollisionEnter(Collision collision)
{
if ((collision.gameObject.layer == 0 || collision.gameObject.layer == 22) && this.type == "Hit" && (Time.timeSinceLevelLoad > this.timeSinceCollision + 0.1f || this.timeSinceCollision == 0f))
{
if (this.bounced < 2)
{
this.HitFX();
}
this.timeSinceCollision = Time.timeSinceLevelLoad;
this.bounced++;
if (this.bounced >= this.bounceMax)
{
this.rbody.isKinematic = true;
}
}
}
// Token: 0x06000494 RID: 1172 RVA: 0x00067A0C File Offset: 0x00065C0C
private void HitFX()
{
MasterAudio.PlaySound3DAtVector3AndForget("Body Fall", base.gameObject.transform.position, Random.Range(0.5f, 0.6f), new float?(Random.Range(0.95f, 1f)), 0f, "", null);
if (this.c && !this.c.dead)
{
GameObject pooledGameObject = Links.x.cellar.GetPooledGameObject(129);
RaycastHit raycastHit;
if (Physics.Raycast(this.c.tr.position + new Vector3(0f, 3f, 0f), Vector3.up * -1f, out raycastHit, 10f, 4194305))
{
pooledGameObject.transform.rotation = Quaternion.Euler(Quaternion.FromToRotation(Vector3.up, raycastHit.normal).eulerAngles);
}
pooledGameObject.transform.position = this.c.tr.position + new Vector3(0f, 0.1f, 0f);
pooledGameObject.SetActive(true);
}
}
// Token: 0x06000495 RID: 1173 RVA: 0x00067B4E File Offset: 0x00065D4E
public void End()
{
this.listen = false;
this.turnOff = this.Ending();
if (!base.gameObject.activeSelf)
{
base.gameObject.SetActive(true);
}
base.StartCoroutine(this.turnOff);
}
// Token: 0x06000496 RID: 1174 RVA: 0x00067B89 File Offset: 0x00065D89
public void TurnOff()
{
this.HitFX();
base.gameObject.SetActive(false);
}
// Token: 0x06000497 RID: 1175 RVA: 0x00067B9D File Offset: 0x00065D9D
public void EndNow()
{
this.ReturnObjs();
}
// Token: 0x06000498 RID: 1176 RVA: 0x00067BA5 File Offset: 0x00065DA5
private IEnumerator Ending()
{
this.rbody.isKinematic = true;
yield return new WaitForSeconds(1f);
this.ReturnObjs();
base.gameObject.SetActive(false);
yield break;
}
// Token: 0x06000499 RID: 1177 RVA: 0x00067BB4 File Offset: 0x00065DB4
private void ReturnObjs()
{
if (this.pooledObject)
{
Links.x.cellar.ReturnPooledGameObject(this.pooledNumber, this.pooledObject);
}
}
// Token: 0x04000755 RID: 1877
public string type;
// Token: 0x04000756 RID: 1878
private IEnumerator turnOff;
// Token: 0x04000757 RID: 1879
private GameObject pooledObject;
// Token: 0x04000758 RID: 1880
private int pooledNumber;
// Token: 0x04000759 RID: 1881
public Rigidbody rbody;
// Token: 0x0400075A RID: 1882
private float timeSinceCollision;
// Token: 0x0400075B RID: 1883
public Character c;
// Token: 0x0400075C RID: 1884
public int bounceMax = 3;
// Token: 0x0400075D RID: 1885
private int bounced;
// Token: 0x0400075E RID: 1886
public bool listen;
// Token: 0x0400075F RID: 1887
private Transform tr;
// Token: 0x04000760 RID: 1888
public Body body;
// Token: 0x04000761 RID: 1889
private Vector3 safePosition;
// Token: 0x04000762 RID: 1890
private bool dynamicCollide;
// Token: 0x04000763 RID: 1891
private bool underground;
// Token: 0x04000764 RID: 1892
private Vector3 startPoint;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,140 @@
using System;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
// Token: 0x0200009B RID: 155
public class CompanionDrop : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler, IPointerDownHandler, IPointerUpHandler
{
// Token: 0x06000E8B RID: 3723 RVA: 0x001160F3 File Offset: 0x001142F3
private void OnEnable()
{
}
// Token: 0x06000E8C RID: 3724 RVA: 0x001160F5 File Offset: 0x001142F5
private void Start()
{
this.EndDrag();
}
// Token: 0x06000E8D RID: 3725 RVA: 0x001160FD File Offset: 0x001142FD
public void StartDrag()
{
this.SetButton(true);
}
// Token: 0x06000E8E RID: 3726 RVA: 0x00116106 File Offset: 0x00114306
public void EndDrag()
{
this.SetButton(false);
}
// Token: 0x06000E8F RID: 3727 RVA: 0x00116110 File Offset: 0x00114310
public void SetButton(bool state)
{
new Color(0.6039216f, 0.4745098f, 0.4745098f, 0f);
this.btn.interactable = state;
this.img.raycastTarget = state;
if (state)
{
Color color = this.highlight;
ColorBlock colors = this.btn.colors;
colors.normalColor = color;
colors.selectedColor = color * 1.5f;
colors.highlightedColor = color * 1.5f;
if (!Links.x.formation.dragging)
{
Links.x.formation.ToggleHighlight(this.label1, true);
Links.x.formation.ToggleHighlight(this.label2, true);
return;
}
}
else
{
ColorBlock colors2 = this.btn.colors;
colors2.normalColor = this.normal;
colors2.highlightedColor = this.normal;
colors2.selectedColor = this.normal;
if (Links.x.formation.hoverBox != this)
{
Links.x.formation.ToggleHighlight(this.label1, false);
Links.x.formation.ToggleHighlight(this.label2, false);
}
}
}
// Token: 0x06000E90 RID: 3728 RVA: 0x0011624B File Offset: 0x0011444B
public void ToggleHighlight(bool state)
{
Links.x.formation.ToggleHighlight(this.label1, state);
Links.x.formation.ToggleHighlight(this.label2, state);
}
// Token: 0x06000E91 RID: 3729 RVA: 0x0011627C File Offset: 0x0011447C
public void OnPointerEnter(PointerEventData eventData)
{
if (Links.x.formation)
{
Links.x.formation.canDrop = true;
Links.x.formation.hoverBox = this;
if (Links.x.formation.dragging)
{
Links.x.formation.GetDescription(null, this);
}
}
this.ToggleHighlight(true);
}
// Token: 0x06000E92 RID: 3730 RVA: 0x001162E4 File Offset: 0x001144E4
public void OnPointerExit(PointerEventData eventData)
{
if (Links.x.formation)
{
Links.x.formation.canDrop = false;
Links.x.formation.hoverBox = null;
if (!Links.x.joy)
{
if (!Links.x.formation.selectedCharacter)
{
Links.x.formation.formationDescription = Links.x.formation.defaultText;
}
else
{
Links.x.formation.GetDescription(null, null);
}
}
}
this.ToggleHighlight(false);
}
// Token: 0x06000E93 RID: 3731 RVA: 0x0011637C File Offset: 0x0011457C
public void OnPointerUp(PointerEventData eventData)
{
}
// Token: 0x06000E94 RID: 3732 RVA: 0x0011637E File Offset: 0x0011457E
public void OnPointerDown(PointerEventData eventData)
{
}
// Token: 0x04001710 RID: 5904
public Button btn;
// Token: 0x04001711 RID: 5905
public int dropNum;
// Token: 0x04001712 RID: 5906
public Image img;
// Token: 0x04001713 RID: 5907
public Color highlight;
// Token: 0x04001714 RID: 5908
public Color normal;
// Token: 0x04001715 RID: 5909
public string label1;
// Token: 0x04001716 RID: 5910
public string label2;
}

View File

@@ -0,0 +1,651 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
// Token: 0x0200009C RID: 156
public class CompanionIcon : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler, IPointerDownHandler, IPointerUpHandler
{
// Token: 0x06000E96 RID: 3734 RVA: 0x00116388 File Offset: 0x00114588
private void Awake()
{
this.normal = this.btn.colors.normalColor;
this.useItemTr = this.useItemsRT.gameObject.transform;
this.autoCastTr = this.autoCastRT.gameObject.transform;
this.leaderTr = this.leaderRT.gameObject.transform;
this.useItemOffset = this.rt.anchoredPosition3D - this.useItemsRT.anchoredPosition3D;
this.autoCastOffset = this.rt.anchoredPosition3D - this.autoCastRT.anchoredPosition3D;
this.leaderOffset = this.rt.anchoredPosition3D - this.leaderRT.anchoredPosition3D;
this.useItems.gameObject.SetActive(false);
this.autoCast.gameObject.SetActive(false);
this.leader.gameObject.SetActive(false);
this.useItemsJoy.gameObject.SetActive(false);
this.autoCastJoy.gameObject.SetActive(false);
this.leaderJoy.gameObject.SetActive(false);
if (this.selected)
{
this.selected.enabled = false;
}
}
// Token: 0x06000E97 RID: 3735 RVA: 0x001164D4 File Offset: 0x001146D4
private void Start()
{
if (this.selected)
{
this.selected.enabled = false;
}
if (!this.tr)
{
this.tr = base.transform;
}
this.allCompanionIcons = Links.x.formation.companionIcons;
}
// Token: 0x06000E98 RID: 3736 RVA: 0x00116528 File Offset: 0x00114728
public void TurnOff()
{
this.character = null;
this.leader.gameObject.SetActive(false);
this.leaderJoy.isOn = false;
this.leaderJoy.gameObject.SetActive(false);
}
// Token: 0x06000E99 RID: 3737 RVA: 0x00116560 File Offset: 0x00114760
public void Setup(Character newCharacter)
{
if (this.selected)
{
this.selected.enabled = false;
}
this.character = newCharacter;
this.dragging = false;
Links.x.renderPortraits.AddCharacter(this.character, this.character.stats.xmlName, null, true, null, null, null, this);
this.updateTime = Time.realtimeSinceStartup;
this.useItems.isOn = false;
this.autoCast.isOn = false;
this.useItems.interactable = true;
this.autoCast.interactable = true;
this.useItems.targetGraphic.raycastTarget = true;
this.autoCast.targetGraphic.raycastTarget = true;
this.useItems.graphic.raycastTarget = true;
this.autoCast.graphic.raycastTarget = true;
this.useItemsJoy.isOn = this.useItems.isOn;
this.autoCastJoy.isOn = this.autoCast.isOn;
this.leaderJoy.isOn = this.leader.isOn;
if (!this.leader.isOn)
{
this.leaderJoy.interactable = false;
}
this.CheckLeader();
if (Links.x.mk)
{
this.useItems.gameObject.SetActive(false);
this.autoCast.gameObject.SetActive(true);
this.leader.gameObject.SetActive(true);
this.useItemsJoy.gameObject.SetActive(false);
this.autoCastJoy.gameObject.SetActive(false);
this.leaderJoy.gameObject.SetActive(false);
return;
}
this.useItems.gameObject.SetActive(false);
this.autoCast.gameObject.SetActive(false);
this.leader.gameObject.SetActive(false);
}
// Token: 0x06000E9A RID: 3738 RVA: 0x00116748 File Offset: 0x00114948
public void CheckLeader()
{
if (this.character)
{
if (Links.x.formation.SharingFormationGroup(this.character))
{
if (this.character.stats.isLeader)
{
this.leader.interactable = true;
this.leader.targetGraphic.raycastTarget = true;
this.leader.graphic.raycastTarget = true;
this.leader.isOn = true;
this.leader.gameObject.SetActive(true);
}
else if (this.character.stats.defendMainInCombat)
{
this.leader.gameObject.SetActive(true);
this.leader.interactable = true;
this.leader.targetGraphic.raycastTarget = true;
this.leader.graphic.raycastTarget = true;
this.leader.isOn = false;
}
else
{
this.leader.isOn = false;
this.leader.gameObject.SetActive(false);
}
}
else
{
this.leader.gameObject.SetActive(false);
this.leaderJoy.gameObject.SetActive(false);
}
if (Links.x.joy)
{
this.leaderJoy.isOn = this.leader.isOn;
this.leaderJoy.interactable = this.leader.interactable;
this.leader.interactable = false;
if (base.gameObject == Links.x.gameplay.currentEventObject && this.character.stats.defendMainInCombat)
{
this.leaderJoy.gameObject.SetActive(true);
}
}
}
}
// Token: 0x06000E9B RID: 3739 RVA: 0x00116904 File Offset: 0x00114B04
private void Update()
{
if (Links.x.joy)
{
if (base.gameObject == Links.x.gameplay.currentEventObject)
{
if (!this.hovering)
{
this.OnPointerEnter(null);
}
}
else if (this.hovering && !this.dragging)
{
this.OnPointerExit(null);
}
}
if (Time.realtimeSinceStartup > this.updateTime + 0.15f)
{
this.updateTime = Time.realtimeSinceStartup;
this.companionPortrait.texture = this.texturesIdle;
}
if (Links.x.mk && (this.hovering || this.dragging))
{
if (Input.GetMouseButtonDown(0))
{
this.OnPointerDown(null);
}
if (Input.GetMouseButtonUp(0))
{
this.OnPointerUp(null);
}
}
if (this.dragging)
{
if (Links.x.mk)
{
this.tr.position = Links.x.menuCamera.ScreenToWorldPoint(Input.mousePosition) + this.offset;
}
else
{
EventSystem.current.SetSelectedGameObject(base.gameObject);
float num = Links.x.fellowship.move.magnitude / 2f;
Vector3 vector = new Vector3(Links.x.fellowship.move.x, Links.x.fellowship.move.y, 0f) * num;
bool flag = true;
Vector3 vector2 = this.tr.position + vector;
if (vector2.x >= Links.x.formation.bottomRight.transform.position.x)
{
flag = false;
}
if (vector2.x <= Links.x.formation.bottomLeft.transform.position.x)
{
flag = false;
}
if (vector2.y >= Links.x.formation.topRight.transform.position.y)
{
flag = false;
}
if (vector2.y <= Links.x.formation.bottomRight.transform.position.y)
{
flag = false;
}
if (flag)
{
this.tr.position += vector;
}
CompanionDrop closestBox = Links.x.formation.GetClosestBox(this.tr.position);
this.prevBox = Links.x.formation.hoverBox;
if (closestBox != this.prevBox)
{
if (this.prevBox)
{
this.prevBox.OnPointerExit(null);
this.prevBox.img.material = Links.x.sceneMap.normalMaterial;
}
if (closestBox)
{
closestBox.OnPointerEnter(null);
closestBox.img.material = Links.x.sceneMap.hoverMaterial;
}
}
Links.x.formation.hoverBox = closestBox;
}
Links.x.formation.dragMessage.text = Links.x.formation.formationDescription;
}
}
// Token: 0x06000E9C RID: 3740 RVA: 0x00116C14 File Offset: 0x00114E14
private void LateUpdate()
{
this.SetIcons();
if (this.waitForDrag && Links.x.mk)
{
if (Input.GetMouseButton(0) && (Time.realtimeSinceStartup > this.waitForDragTime + 0.3f || Vector3.Distance(this.waitForDragPos, Input.mousePosition) > Links.x.formation.dragThreshold))
{
this.Drag();
return;
}
if (Time.realtimeSinceStartup > this.waitForDragTime + 0.3f)
{
this.waitForDrag = false;
}
}
}
// Token: 0x06000E9D RID: 3741 RVA: 0x00116C98 File Offset: 0x00114E98
private void Drag()
{
this.dragging = true;
for (int i = 0; i < this.allCompanionIcons.Count; i++)
{
if (this.allCompanionIcons[i].character && (Links.x.mk || (Links.x.joy && this.allCompanionIcons[i] != this)))
{
this.allCompanionIcons[i].border.raycastTarget = false;
this.allCompanionIcons[i].btn.interactable = false;
}
}
Links.x.formationTooltip.EndHoverText(base.gameObject, false);
this.savedPos = this.tr.position;
CompanionDrop component = this.tr.parent.gameObject.GetComponent<CompanionDrop>();
this.tr.SetParent(Links.x.formation.dragHolder, true);
Links.x.formation.dragging = true;
this.useItems.interactable = false;
this.autoCast.interactable = false;
this.useItems.targetGraphic.raycastTarget = false;
this.autoCast.targetGraphic.raycastTarget = false;
this.useItems.graphic.raycastTarget = false;
this.autoCast.graphic.raycastTarget = false;
this.leader.interactable = false;
this.leader.interactable = false;
this.leader.isOn = false;
this.character.stats.isLeader = false;
this.leaderJoy.isOn = this.leader.isOn;
this.leaderJoy.interactable = this.leader.interactable;
if (Links.x.joy)
{
this.leaderJoy.gameObject.SetActive(this.leader.interactable);
}
this.leader.targetGraphic.raycastTarget = false;
this.leader.graphic.raycastTarget = false;
Links.x.formation.group1box.StartDrag();
Links.x.formation.group2box.StartDrag();
Links.x.formation.group3box.StartDrag();
Links.x.formation.group4box.StartDrag();
Links.x.formation.group5box.StartDrag();
Links.x.formation.group6box.StartDrag();
Links.x.formation.group7box.StartDrag();
Links.x.formation.group8box.StartDrag();
Links.x.formation.group9box.StartDrag();
this.offset = this.tr.position - Links.x.menuCamera.ScreenToWorldPoint(Input.mousePosition);
Links.x.formation.StartDrag(this, component);
this.SetIcons();
this.SetButton(true);
this.SetControllerIcons(false);
this.waitForDrag = false;
if (Links.x.joy)
{
Links.x.hudControl.JoyBox(false);
}
}
// Token: 0x06000E9E RID: 3742 RVA: 0x00116FCC File Offset: 0x001151CC
private void SetIcons()
{
this.useItemsRT.anchoredPosition3D = this.rt.anchoredPosition3D - this.useItemOffset;
this.autoCastRT.anchoredPosition3D = this.rt.anchoredPosition3D - this.autoCastOffset;
this.leaderRT.anchoredPosition3D = this.rt.anchoredPosition3D - this.leaderOffset;
if (this.useItemTr.parent != this.tr.parent)
{
this.useItemTr.SetParent(this.tr.parent);
this.autoCastTr.SetParent(this.tr.parent);
this.leaderTr.SetParent(this.tr.parent);
this.autoCastTr.SetAsLastSibling();
this.useItemTr.SetAsLastSibling();
this.leaderTr.SetAsLastSibling();
this.useItemTr.localScale = Vector3.one;
this.autoCastTr.localScale = Vector3.one;
}
}
// Token: 0x06000E9F RID: 3743 RVA: 0x001170DF File Offset: 0x001152DF
public void PointerUpFromTrigger()
{
if (this.dragging)
{
this.OnPointerUp(null);
return;
}
this.OnPointerDown(null);
}
// Token: 0x06000EA0 RID: 3744 RVA: 0x001170F8 File Offset: 0x001152F8
public void OnPointerDown(PointerEventData eventData)
{
if (Links.x.formation.selectedCharacter)
{
CompanionIcon selectedIcon = Links.x.formation.GetSelectedIcon();
if (selectedIcon)
{
selectedIcon.selected.enabled = false;
}
}
Links.x.formation.UpdateSelectedCharacter(this.character);
this.selected.enabled = true;
if (!this.dragging)
{
if (Links.x.joy)
{
this.Drag();
return;
}
if (!this.waitForDrag)
{
this.waitForDrag = true;
this.waitForDragTime = Time.realtimeSinceStartup;
this.waitForDragPos = Input.mousePosition;
}
}
}
// Token: 0x06000EA1 RID: 3745 RVA: 0x001171A0 File Offset: 0x001153A0
public void SetButton(bool state)
{
if (state)
{
this.normal * 1.5f;
Button button = this.btn;
ColorBlock colors = button.colors;
colors.disabledColor = colors.highlightedColor;
button.colors = colors;
return;
}
Button button2 = this.btn;
ColorBlock colors2 = button2.colors;
colors2.disabledColor = this.normal;
button2.colors = colors2;
}
// Token: 0x06000EA2 RID: 3746 RVA: 0x00117203 File Offset: 0x00115403
public void OnPointerUp(PointerEventData eventData)
{
if (this.dragging)
{
this.EndDrag();
}
this.waitToEndDrag = true;
if (Links.x.joy)
{
this.dragging = false;
this.waitToEndDrag = false;
}
}
// Token: 0x06000EA3 RID: 3747 RVA: 0x00117234 File Offset: 0x00115434
public void EndDrag()
{
this.SetButton(false);
this.dragging = false;
this.useItems.interactable = true;
this.autoCast.interactable = true;
this.useItems.targetGraphic.raycastTarget = true;
this.autoCast.targetGraphic.raycastTarget = true;
this.useItems.graphic.raycastTarget = true;
this.autoCast.graphic.raycastTarget = true;
if (Links.x.formation.hoverBox != null)
{
this.character.stats.formationGroup = Links.x.formation.hoverBox.dropNum;
Links.x.formation.SetPortraitParent(this.index, true);
Links.x.formation.group1box.EndDrag();
Links.x.formation.group2box.EndDrag();
Links.x.formation.group3box.EndDrag();
Links.x.formation.group4box.EndDrag();
Links.x.formation.group5box.EndDrag();
Links.x.formation.group6box.EndDrag();
Links.x.formation.group7box.EndDrag();
Links.x.formation.group8box.EndDrag();
Links.x.formation.group9box.EndDrag();
}
else
{
this.tr.position = this.savedPos;
Links.x.formation.SetPortraitParent(this.index, true);
Links.x.formation.group1box.EndDrag();
Links.x.formation.group2box.EndDrag();
Links.x.formation.group3box.EndDrag();
Links.x.formation.group4box.EndDrag();
Links.x.formation.group5box.EndDrag();
Links.x.formation.group6box.EndDrag();
Links.x.formation.group7box.EndDrag();
Links.x.formation.group8box.EndDrag();
Links.x.formation.group9box.EndDrag();
}
for (int i = 0; i < this.allCompanionIcons.Count; i++)
{
if (this.allCompanionIcons[i].character)
{
this.allCompanionIcons[i].border.raycastTarget = true;
this.allCompanionIcons[i].btn.interactable = true;
}
}
if (this.prevBox)
{
this.prevBox.OnPointerExit(null);
this.prevBox.img.material = Links.x.sceneMap.normalMaterial;
}
CompanionDrop component = this.tr.parent.gameObject.GetComponent<CompanionDrop>();
Links.x.SetFormationParty();
Links.x.formation.EndDrag(component);
this.SetIcons();
this.SetControllerIcons(true);
if (Links.x.joy)
{
EventSystem.current.SetSelectedGameObject(base.gameObject);
this.OnPointerEnter(null);
Links.x.hudControl.SetJoyBox(base.gameObject.GetComponent<UITriggerButton>());
}
}
// Token: 0x06000EA4 RID: 3748 RVA: 0x001175A4 File Offset: 0x001157A4
public void OnPointerEnter(PointerEventData eventData)
{
this.hovering = true;
if (!this.character)
{
return;
}
if (!Input.GetMouseButton(0))
{
bool flag = this.dragging;
}
bool joy = Links.x.joy;
CompanionDrop component = this.tr.parent.gameObject.GetComponent<CompanionDrop>();
if (component)
{
component.SetButton(true);
}
if (Links.x.formation && component)
{
Links.x.formation.GetDescription(this, component);
Links.x.formation.UpdateSliderValues(this.character);
}
if (this.waitToEndDrag)
{
this.dragging = false;
this.waitToEndDrag = false;
}
}
// Token: 0x06000EA5 RID: 3749 RVA: 0x0011765A File Offset: 0x0011585A
public CompanionDrop GetDrop()
{
return this.tr.parent.gameObject.GetComponent<CompanionDrop>();
}
// Token: 0x06000EA6 RID: 3750 RVA: 0x00117674 File Offset: 0x00115874
public void OnPointerExit(PointerEventData eventData)
{
CompanionDrop component = this.tr.parent.gameObject.GetComponent<CompanionDrop>();
if (component)
{
component.SetButton(false);
}
this.hovering = false;
if (!Links.x.formation.selectedCharacter)
{
Links.x.formation.formationDescription = Links.x.formation.defaultText;
Links.x.formation.EmptySliders();
}
else if (Links.x.mk)
{
Links.x.formation.GetDescription(null, null);
Links.x.formation.UpdateSliderValues(Links.x.formation.selectedCharacter);
}
this.waitForDragTime = 0f;
this.waitForDrag = false;
}
// Token: 0x06000EA7 RID: 3751 RVA: 0x00117740 File Offset: 0x00115940
public void SetControllerIcons(bool state)
{
if (this.dragging)
{
state = false;
}
if (!this.character)
{
state = false;
this.leaderJoy.gameObject.SetActive(false);
this.autoCastJoy.gameObject.SetActive(false);
return;
}
this.autoCastJoy.gameObject.SetActive(false);
if (this.character.stats.defendMainInCombat && Links.x.joy)
{
this.leaderJoy.gameObject.SetActive(state);
return;
}
this.leaderJoy.gameObject.SetActive(false);
}
// Token: 0x04001717 RID: 5911
public int index;
// Token: 0x04001718 RID: 5912
public Character character;
// Token: 0x04001719 RID: 5913
public bool dragging;
// Token: 0x0400171A RID: 5914
public RawImage companionPortrait;
// Token: 0x0400171B RID: 5915
public Image border;
// Token: 0x0400171C RID: 5916
public Button btn;
// Token: 0x0400171D RID: 5917
public RenderTexture texturesIdle;
// Token: 0x0400171E RID: 5918
public bool hovering;
// Token: 0x0400171F RID: 5919
private Transform tr;
// Token: 0x04001720 RID: 5920
private Vector3 offset;
// Token: 0x04001721 RID: 5921
private List<CompanionIcon> allCompanionIcons;
// Token: 0x04001722 RID: 5922
private Vector3 savedPos;
// Token: 0x04001723 RID: 5923
private float updateTime;
// Token: 0x04001724 RID: 5924
private bool waitToEndDrag;
// Token: 0x04001725 RID: 5925
private CompanionDrop prevBox;
// Token: 0x04001726 RID: 5926
public RectTransform rt;
// Token: 0x04001727 RID: 5927
private Color normal;
// Token: 0x04001728 RID: 5928
public Toggle useItems;
// Token: 0x04001729 RID: 5929
public Toggle autoCast;
// Token: 0x0400172A RID: 5930
public Toggle leader;
// Token: 0x0400172B RID: 5931
public Toggle useItemsJoy;
// Token: 0x0400172C RID: 5932
public Toggle autoCastJoy;
// Token: 0x0400172D RID: 5933
public Toggle leaderJoy;
// Token: 0x0400172E RID: 5934
private Vector3 useItemOffset;
// Token: 0x0400172F RID: 5935
private Vector3 autoCastOffset;
// Token: 0x04001730 RID: 5936
private Vector3 leaderOffset;
// Token: 0x04001731 RID: 5937
public RectTransform useItemsRT;
// Token: 0x04001732 RID: 5938
public RectTransform autoCastRT;
// Token: 0x04001733 RID: 5939
public RectTransform leaderRT;
// Token: 0x04001734 RID: 5940
public Transform useItemTr;
// Token: 0x04001735 RID: 5941
public Transform autoCastTr;
// Token: 0x04001736 RID: 5942
public Transform leaderTr;
// Token: 0x04001737 RID: 5943
public bool waitForDrag;
// Token: 0x04001738 RID: 5944
public float waitForDragTime;
// Token: 0x04001739 RID: 5945
public Vector3 waitForDragPos;
// Token: 0x0400173A RID: 5946
public Image selected;
}

View File

@@ -0,0 +1,33 @@
using System;
using UnityEngine;
using UnityEngine.UI;
// Token: 0x0200009D RID: 157
public class ContentSizeFitterEx : ContentSizeFitter
{
// Token: 0x06000EA9 RID: 3753 RVA: 0x001177E8 File Offset: 0x001159E8
public override void SetLayoutHorizontal()
{
base.SetLayoutHorizontal();
RectTransform rectTransform = base.transform as RectTransform;
Vector2 sizeDelta = rectTransform.sizeDelta;
sizeDelta.x = Mathf.Clamp(sizeDelta.x, this.sizeMin.x, this.sizeMax.x);
rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, sizeDelta.x);
}
// Token: 0x06000EAA RID: 3754 RVA: 0x00117844 File Offset: 0x00115A44
public override void SetLayoutVertical()
{
base.SetLayoutVertical();
RectTransform rectTransform = base.transform as RectTransform;
Vector2 sizeDelta = rectTransform.sizeDelta;
sizeDelta.y = Mathf.Clamp(sizeDelta.y, this.sizeMin.y, this.sizeMax.y);
rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, sizeDelta.y);
}
// Token: 0x0400173B RID: 5947
public Vector2 sizeMin = new Vector2(0f, 0f);
// Token: 0x0400173C RID: 5948
public Vector2 sizeMax = new Vector2(350f, 1080f);
}

View File

@@ -0,0 +1,52 @@
using System;
using UnityEngine;
// Token: 0x02000061 RID: 97
public class CoolAudioSource : MonoBehaviour
{
// Token: 0x06000B52 RID: 2898 RVA: 0x000DD8A8 File Offset: 0x000DBAA8
private void Awake()
{
this.audioSource = base.gameObject.GetComponent<AudioSource>();
this.audioSource.loop = this.loopIt;
if (this.is2D)
{
this.audioSource.spatialBlend = 0f;
}
else
{
this.audioSource.spatialBlend = 1f;
}
if (this.playOnAwake)
{
this.audioSource.playOnAwake = true;
}
else
{
this.audioSource.playOnAwake = false;
}
this.audioSource.volume = 0f;
this.audioSource.priority = 1;
base.enabled = false;
}
// Token: 0x0400108C RID: 4236
[Header("FOR JOSEPH")]
public bool playOnAwake;
// Token: 0x0400108D RID: 4237
public bool loopIt;
// Token: 0x0400108E RID: 4238
public bool is2D;
// Token: 0x0400108F RID: 4239
public bool playOnceThenWaitForCharacterToReturn;
// Token: 0x04001090 RID: 4240
public bool playEveryTimePlayerIsNear;
// Token: 0x04001091 RID: 4241
[Header("FOR HANNAH")]
public AudioSource audioSource;
}

View File

@@ -0,0 +1,109 @@
using System;
using UnityEngine;
using UnityEngine.Rendering;
// Token: 0x02000074 RID: 116
[ExecuteInEditMode]
[RequireComponent(typeof(Light))]
public class CopyShadows : MonoBehaviour
{
// Token: 0x06000B8A RID: 2954 RVA: 0x000DFDDA File Offset: 0x000DDFDA
private void OnEnable()
{
this.lightComponent = base.GetComponent<Light>();
this.SetupCommandBuffer();
}
// Token: 0x06000B8B RID: 2955 RVA: 0x000DFDEE File Offset: 0x000DDFEE
private void OnDisable()
{
this.lightComponent.RemoveCommandBuffer(LightEvent.AfterShadowMap, this.commandBuffer);
this.lightComponent.RemoveCommandBuffer(LightEvent.AfterScreenspaceMask, this.commandBuffer2);
this.ReleaseCommandBuffer();
}
// Token: 0x06000B8C RID: 2956 RVA: 0x000DFE1C File Offset: 0x000DE01C
private void Update()
{
if (this.tex == null || this.w != (float)Screen.width || this.h != (float)Screen.height)
{
if (this.tex != null)
{
this.tex.Release();
}
this.w = (float)Screen.width;
this.h = (float)Screen.height;
this.tex = new RenderTexture(Screen.width, Screen.height, 24, RenderTextureFormat.ARGB32);
this.reset = true;
}
if (this.reset)
{
this.OnDisable();
this.OnEnable();
this.reset = false;
}
float num = 0f;
if (Links.x && Links.x.diorama && Links.x.cameraEffects.indoors)
{
num = 1f;
}
Shader.SetGlobalFloat("_UsePointLight", num);
}
// Token: 0x06000B8D RID: 2957 RVA: 0x000DFF04 File Offset: 0x000DE104
private void SetupCommandBuffer()
{
this.commandBuffer = new CommandBuffer();
RenderTargetIdentifier renderTargetIdentifier = BuiltinRenderTextureType.CurrentActive;
this.commandBuffer.SetGlobalTexture(this.textureSemanticName, renderTargetIdentifier);
this.lightComponent.AddCommandBuffer(LightEvent.AfterShadowMap, this.commandBuffer);
this.commandBuffer2 = new CommandBuffer();
RenderTargetIdentifier renderTargetIdentifier2 = BuiltinRenderTextureType.CurrentActive;
this.commandBuffer2.Blit(renderTargetIdentifier2, this.tex, this.material);
this.commandBuffer2.SetGlobalTexture(this.textureSemanticName2, this.tex);
this.lightComponent.AddCommandBuffer(LightEvent.AfterScreenspaceMask, this.commandBuffer2);
}
// Token: 0x06000B8E RID: 2958 RVA: 0x000DFFA4 File Offset: 0x000DE1A4
private void ReleaseCommandBuffer()
{
this.commandBuffer2.Clear();
this.commandBuffer.Clear();
}
// Token: 0x0400119D RID: 4509
public string textureSemanticName = "_EnvironmentShadows";
// Token: 0x0400119E RID: 4510
public string textureSemanticName2 = "_EnvironmentShadowsScreenSpace";
// Token: 0x0400119F RID: 4511
public bool reset;
// Token: 0x040011A0 RID: 4512
private CommandBuffer commandBuffer;
// Token: 0x040011A1 RID: 4513
private CommandBuffer commandBuffer2;
// Token: 0x040011A2 RID: 4514
private Light lightComponent;
// Token: 0x040011A3 RID: 4515
public RenderTexture tex;
// Token: 0x040011A4 RID: 4516
public RenderTexture pointLightTexture;
// Token: 0x040011A5 RID: 4517
public Material material;
// Token: 0x040011A6 RID: 4518
private float w;
// Token: 0x040011A7 RID: 4519
private float h;
// Token: 0x040011A8 RID: 4520
public Transform pointLight;
}

View File

@@ -0,0 +1,96 @@
using System;
using UnityEngine;
using UnityEngine.Rendering;
// Token: 0x02000075 RID: 117
[ExecuteInEditMode]
[RequireComponent(typeof(Light))]
public class CopyShadowsBaker : MonoBehaviour
{
// Token: 0x06000B90 RID: 2960 RVA: 0x000DFFDA File Offset: 0x000DE1DA
private void OnEnable()
{
this.lightComponent = base.GetComponent<Light>();
this.SetupCommandBuffer();
}
// Token: 0x06000B91 RID: 2961 RVA: 0x000DFFEE File Offset: 0x000DE1EE
private void OnDisable()
{
this.lightComponent.RemoveCommandBuffer(LightEvent.AfterScreenspaceMask, this.commandBuffer2);
this.ReleaseCommandBuffer();
}
// Token: 0x06000B92 RID: 2962 RVA: 0x000E0008 File Offset: 0x000DE208
private void Update()
{
if (this.reset)
{
this.OnDisable();
this.OnEnable();
this.reset = false;
}
if (this.tex == null || this.w != (float)Screen.width || this.h != (float)Screen.height)
{
if (this.tex != null)
{
this.tex.Release();
}
this.w = (float)Screen.width;
this.h = (float)Screen.height;
this.tex = new RenderTexture(Screen.width, Screen.height, 24, RenderTextureFormat.ARGB32);
}
}
// Token: 0x06000B93 RID: 2963 RVA: 0x000E00A4 File Offset: 0x000DE2A4
private void SetupCommandBuffer()
{
this.commandBuffer2 = new CommandBuffer();
RenderTargetIdentifier renderTargetIdentifier = BuiltinRenderTextureType.CurrentActive;
this.commandBuffer2.Blit(renderTargetIdentifier, this.tex, this.material);
this.commandBuffer2.SetGlobalTexture(this.textureSemanticName2, this.tex);
this.lightComponent.AddCommandBuffer(LightEvent.AfterScreenspaceMask, this.commandBuffer2);
}
// Token: 0x06000B94 RID: 2964 RVA: 0x000E010E File Offset: 0x000DE30E
private void ReleaseCommandBuffer()
{
this.commandBuffer2.Clear();
}
// Token: 0x040011A9 RID: 4521
public string textureSemanticName = "_EnvironmentShadows";
// Token: 0x040011AA RID: 4522
public string textureSemanticName2 = "_EnvironmentShadowsScreenSpace";
// Token: 0x040011AB RID: 4523
public bool reset;
// Token: 0x040011AC RID: 4524
private CommandBuffer commandBuffer;
// Token: 0x040011AD RID: 4525
private CommandBuffer commandBuffer2;
// Token: 0x040011AE RID: 4526
private Light lightComponent;
// Token: 0x040011AF RID: 4527
public RenderTexture tex;
// Token: 0x040011B0 RID: 4528
public RenderTexture pointLightTexture;
// Token: 0x040011B1 RID: 4529
public Material material;
// Token: 0x040011B2 RID: 4530
private float w;
// Token: 0x040011B3 RID: 4531
private float h;
// Token: 0x040011B4 RID: 4532
public Transform pointLight;
}

View File

@@ -0,0 +1,44 @@
using System;
using UnityEngine;
// Token: 0x0200009E RID: 158
public class CreateCircle : MonoBehaviour
{
// Token: 0x06000EAC RID: 3756 RVA: 0x001178D0 File Offset: 0x00115AD0
public GameObject CreateSphere(Vector3 position, float size)
{
GameObject gameObject = GameObject.CreatePrimitive(PrimitiveType.Capsule);
gameObject.transform.parent = Links.x.gameplay.transform;
gameObject.transform.position = position;
gameObject.transform.localScale = new Vector3(size, size, size);
Object.Destroy(gameObject.GetComponent<SphereCollider>());
gameObject.layer = 2;
return gameObject;
}
// Token: 0x06000EAD RID: 3757 RVA: 0x00117930 File Offset: 0x00115B30
private void Start()
{
for (int i = 0; i < this.numberOfObjects; i++)
{
float num = (float)i * 3.1415927f * 2f / (float)this.numberOfObjects;
Vector3 vector = base.gameObject.transform.position + new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)) * this.radius;
if (Physics.Raycast(vector + new Vector3(0f, 10f, 0f), Vector3.up * -1f, out this.hit, 20f, 8))
{
vector = this.hit.point;
GameObject gameObject = this.CreateSphere(vector, 0.5f);
gameObject.transform.rotation = Quaternion.LookRotation(vector - base.gameObject.transform.position);
gameObject.transform.Rotate(new Vector3(0f, 0f, 90f));
}
}
}
// Token: 0x0400173D RID: 5949
public int numberOfObjects = 30;
// Token: 0x0400173E RID: 5950
public float radius = 6f;
// Token: 0x0400173F RID: 5951
private RaycastHit hit;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,26 @@
using System;
using UnityEngine;
// Token: 0x02000062 RID: 98
public class CreatureBoat : MonoBehaviour
{
// Token: 0x04001092 RID: 4242
[Header("Joseph fills this")]
public CreatureBoat.boatNames boat;
// Token: 0x04001093 RID: 4243
[Header("Hannah fills this")]
public Boat creatureBoat;
// Token: 0x04001094 RID: 4244
public Creatures leadCreature;
// Token: 0x020001C3 RID: 451
public enum boatNames
{
// Token: 0x04002C18 RID: 11288
TePuke,
// Token: 0x04002C19 RID: 11289
CropGoblinBoat
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,282 @@
using System;
using System.Collections.Generic;
using DarkTonic.MasterAudio;
using Pathfinding;
using UnityEngine;
// Token: 0x02000023 RID: 35
public class CritterActions : MonoBehaviour
{
// Token: 0x06000581 RID: 1409 RVA: 0x000795C9 File Offset: 0x000777C9
private void Start()
{
this.GetVariables();
}
// Token: 0x06000582 RID: 1410 RVA: 0x000795D4 File Offset: 0x000777D4
private void GetVariables()
{
this.tr = base.transform.parent.gameObject.transform;
this.anim = base.gameObject.GetComponent<Animator>();
this.seeker = base.gameObject.GetComponent<Seeker>();
this.seeker.pathCallback = new OnPathDelegate(this.PathFinished);
}
// Token: 0x06000583 RID: 1411 RVA: 0x00079638 File Offset: 0x00077838
public void MakeRandomPath(GraphNode startNode)
{
if (this.dead)
{
return;
}
if (!this.tr)
{
this.GetVariables();
}
this.nodeConstraint.constrainWalkability = true;
this.nodeConstraint.walkable = true;
this.nodeConstraint.constrainPenalty = 0;
this.nodeConstraint.constrainTags = true;
this.nodeConstraint.passID = 0;
this.nodeConstraint.passID2 = 0;
this.nodeConstraint.checkConnections = 0;
this.nodeConstraint.constrainToEnvironment = 1;
this.nodeConstraint.constrainToArea = -1;
if (startNode == null)
{
if (this.resourceLocation == -1)
{
if (this.isResource)
{
startNode = AstarPath.active.GetNearest(this.resourcePoint, this.nodeConstraint).node;
}
else
{
startNode = Links.x.critters.GetRandomNode();
}
}
else
{
this.isResource = true;
startNode = AstarPath.active.GetNearest(this.resourcePoint, this.nodeConstraint).node;
}
}
if (startNode != null && Links.x.gaia.sceneLoaded && Links.x.gaia.changingMapsComplete)
{
this.pathmaking = true;
if ((this.tr.position - (Vector3)startNode.position).sqrMagnitude > 25f)
{
this.tr.position = (Vector3)startNode.position;
this.Stop();
}
this.seeker.pathConstraint = this.nodeConstraint;
if (Links.x.hasMain)
{
Vector3 position = Links.x.main.tr.position;
this.seeker.StartRandomPath(startNode, 40000, new OnPathDelegate(this.PathFinished), 0.2f, 30000, position);
return;
}
this.seeker.StartRandomPath(startNode, 40000, new OnPathDelegate(this.PathFinished), 0.2f, 30000, base.gameObject.transform.position);
}
}
// Token: 0x06000584 RID: 1412 RVA: 0x00079846 File Offset: 0x00077A46
public void Stop()
{
this.nodes.Clear();
this.targetPosition = Vector3.zero;
}
// Token: 0x06000585 RID: 1413 RVA: 0x00079860 File Offset: 0x00077A60
public void PathFinished(Path p)
{
p.Claim(this);
if (!p.error && !this.dead)
{
this.nodes.Clear();
this.pathVectors = p.vectorPath;
this.pathNodes = p.path;
for (int i = 0; i < this.pathVectors.Count; i++)
{
this.nodes.Add(this.pathVectors[i]);
}
this.lastNode = this.pathNodes[this.pathNodes.Count - 1];
this.currentIndex = 0;
this.t = 0f;
this.startPosition = this.tr.position;
if (this.currentIndex < this.nodes.Count && this.currentIndex > -1)
{
this.targetPosition = this.nodes[this.currentIndex];
this.anim.Play("Move");
this.anim.speed = 1.25f;
}
else
{
this.targetPosition = this.tr.position;
this.Stop();
}
}
else
{
this.tr.position = new Vector3(1000f, 0f, 0f);
this.targetPosition = Vector3.zero;
}
this.pathmaking = false;
p.Release(this, false);
}
// Token: 0x06000586 RID: 1414 RVA: 0x000799C4 File Offset: 0x00077BC4
public void Squish(Character character)
{
if (this.dead)
{
return;
}
if (Time.timeSinceLevelLoad > this.spawnTime + 2f || !this.isResource)
{
this.targetPosition = Vector3.zero;
this.currentIndex = 0;
MasterAudio.PlaySound3DAtVector3AndForget("Squish", this.tr.position, 1f, new float?(1f), 0f, "", null);
GameObject pooledGameObject = Links.x.cellar.GetPooledGameObject(21);
pooledGameObject.gameObject.SetActive(true);
pooledGameObject.transform.position = this.tr.position + new Vector3(0f, 0.1f, 0f);
if (this.resourceLocation >= 0)
{
Library.Inventory invRowFromName = Links.x.library.GetInvRowFromName("Shell");
if (invRowFromName != null)
{
int num = -1;
if (character.node != null)
{
num = (int)character.node.Area;
}
Item item = Links.x.inventory.groundBag.DropLoot(invRowFromName._ID, 1, Vector3.zero, Vector3.zero, new Vector4((float)invRowFromName._DurabilityMax, 0f, 0f, 0f), null, base.gameObject.transform.position, false, false, num);
Links.x.diorama.AddItem(item);
}
this.dead = true;
Links.x.diorama.ReturnResource(this.resourceLocation, this.tr.parent.gameObject);
base.gameObject.SetActive(false);
return;
}
if (this.isResource)
{
GameObject pooledGameObject2 = Links.x.cellar.GetPooledGameObject(20);
pooledGameObject2.gameObject.SetActive(true);
pooledGameObject2.transform.position = this.tr.position;
pooledGameObject2.transform.rotation = this.tr.rotation;
Links.x.critters.AddSquished(pooledGameObject2, false);
base.gameObject.SetActive(false);
return;
}
GameObject pooledGameObject3 = Links.x.cellar.GetPooledGameObject(20);
pooledGameObject3.gameObject.SetActive(true);
pooledGameObject3.transform.position = this.tr.position;
pooledGameObject3.transform.rotation = this.tr.rotation;
Links.x.critters.AddSquished(pooledGameObject3, true);
if (character)
{
character.stats.AddSpiritFromKill(1f);
}
}
}
// Token: 0x06000587 RID: 1415 RVA: 0x00079C54 File Offset: 0x00077E54
private void OnAnimatorMove()
{
if (this.dead)
{
return;
}
if (this.targetPosition != Vector3.zero && !this.pathmaking)
{
if ((this.tr.position - this.targetPosition).sqrMagnitude < 0.09f)
{
if (this.resourceLocation >= 0)
{
this.lastNode = this.pathNodes[this.currentIndex];
}
if (this.currentIndex + 1 < this.nodes.Count && this.nodes.Count > 0)
{
this.currentIndex++;
this.targetPosition = this.nodes[this.currentIndex];
this.t = 0f;
this.startPosition = this.tr.position;
return;
}
this.targetPosition = Vector3.zero;
this.MakeRandomPath(this.lastNode);
return;
}
else
{
if (!this.isResource)
{
this.tr.rotation = Quaternion.LookRotation(this.targetPosition - this.tr.position);
Vector3 rootPosition = this.anim.rootPosition;
rootPosition.y = Mathf.Lerp(this.tr.position.y, this.targetPosition.y, Time.deltaTime * 5f);
this.tr.position = rootPosition;
return;
}
this.t += Time.deltaTime;
this.tr.position = Vector3.Lerp(this.startPosition, this.targetPosition, this.t * 2f);
}
}
}
// Token: 0x0400087D RID: 2173
public Transform tr;
// Token: 0x0400087E RID: 2174
public bool dead;
// Token: 0x0400087F RID: 2175
private Animator anim;
// Token: 0x04000880 RID: 2176
private Vector3 moveFollow;
// Token: 0x04000881 RID: 2177
private Seeker seeker;
// Token: 0x04000882 RID: 2178
private NNConstraint nodeConstraint = new NNConstraint();
// Token: 0x04000883 RID: 2179
public List<Vector3> nodes = new List<Vector3>();
// Token: 0x04000884 RID: 2180
private List<Vector3> pathVectors;
// Token: 0x04000885 RID: 2181
private List<GraphNode> pathNodes;
// Token: 0x04000886 RID: 2182
private GraphNode lastNode;
// Token: 0x04000887 RID: 2183
private Vector3 targetPosition;
// Token: 0x04000888 RID: 2184
private Vector3 startPosition;
// Token: 0x04000889 RID: 2185
private float t;
// Token: 0x0400088A RID: 2186
private int currentIndex;
// Token: 0x0400088B RID: 2187
private bool pathmaking;
// Token: 0x0400088C RID: 2188
public int resourceLocation = -1;
// Token: 0x0400088D RID: 2189
public Vector3 resourcePoint;
// Token: 0x0400088E RID: 2190
public bool isResource;
// Token: 0x0400088F RID: 2191
public float spawnTime;
}

View File

@@ -0,0 +1,234 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Pathfinding;
using UnityEngine;
// Token: 0x02000024 RID: 36
public class Critters : MonoBehaviour
{
// Token: 0x06000589 RID: 1417 RVA: 0x00079E28 File Offset: 0x00078028
private void Start()
{
this.count = 7;
for (int i = 0; i < this.count; i++)
{
GameObject gameObject = Object.Instantiate<GameObject>(this.critterTypes[Random.Range(0, this.critterTypes.Count)], new Vector3(10000f, 0f, 0f), Quaternion.identity, base.gameObject.transform);
CritterActions critterActions = gameObject.transform.GetChild(0).gameObject.AddComponent<CritterActions>();
this.activeCritters.Add(critterActions);
gameObject.transform.SetParent(Links.x.gameplay.transform);
}
this.party = Links.x.party;
}
// Token: 0x0600058A RID: 1418 RVA: 0x00079EE4 File Offset: 0x000780E4
private void Update()
{
if (Links.x.gaia.changingMapsComplete && Links.x.gaia.sceneLoaded && Links.x.main)
{
if ((this.prevPosition - Links.x.main.tr.position).sqrMagnitude > 100f && Links.x.main.desiredGraph == 0 && !Records.x.partySailing)
{
if (Links.x.main.node != null)
{
this.StartNewCritterPaths();
}
this.prevPosition = Links.x.main.tr.position;
}
Vector3 vector = Vector3.zero;
int num = this.activeCritters.Count;
for (int i = 0; i < num; i++)
{
if (!this.activeCritters[i].dead && this.activeCritters[i].tr)
{
vector = this.activeCritters[i].tr.position;
for (int j = 0; j < this.party.Count; j++)
{
Character character = this.party[j];
if (character && character.moving && character.stats.Floating() == 0)
{
vector.y = character.tr.position.y;
if ((character.tr.position - vector).sqrMagnitude < 0.36f)
{
this.activeCritters[i].Squish(character);
if (this.activeCritters[i].isResource)
{
break;
}
if (this.outsideNodes.Count > 0)
{
this.activeCritters[i].MakeRandomPath(this.outsideNodes[Random.Range(0, this.outsideNodes.Count)]);
break;
}
this.activeCritters[i].tr.position = Vector3.zero;
break;
}
}
}
}
}
}
}
// Token: 0x0600058B RID: 1419 RVA: 0x0007A12F File Offset: 0x0007832F
public void StartNewCritterPaths()
{
if (!this.lookingForPaths)
{
base.StartCoroutine(this.CritterPaths());
}
}
// Token: 0x0600058C RID: 1420 RVA: 0x0007A146 File Offset: 0x00078346
private IEnumerator CritterPaths()
{
this.outsideNodes.Clear();
if (Links.x.gaia.changingMapsComplete && Links.x.gaia.sceneLoaded && Links.x.gaia.pathfindingReady)
{
GraphNode node = Links.x.main.node;
Vector3 startPosition = (Vector3)node.position;
ConstantPath constPath = null;
constPath = ConstantPath.ConstructFast(node, Records.x.GetConstantPathRadius(12), null);
this.nodeConstraint.constrainWalkability = false;
this.nodeConstraint.walkable = true;
this.nodeConstraint.constrainTags = false;
this.nodeConstraint.checkCircleID = 0;
this.nodeConstraint.passID = 0;
this.nodeConstraint.passID2 = 0;
this.nodeConstraint.checkConnections = 0;
this.nodeConstraint.constrainPenalty = 0;
this.nodeConstraint.constrainToArea = -1;
this.nodeConstraint.constrainToEnvironment = 1;
constPath.nnConstraint = this.nodeConstraint;
AstarPath.StartPath(constPath, false);
yield return base.StartCoroutine(constPath.WaitForPath());
int num = 0;
constPath.Claim(this);
this.allNodes = constPath.allNodes;
int num2 = this.allNodes.Count;
float max = 900f;
for (int j = 0; j < num2; j++)
{
if (((Vector3)this.allNodes[j].position - startPosition).sqrMagnitude > max && this.allNodes[j].Walkable)
{
this.outsideNodes.Add(this.allNodes[j]);
num++;
}
}
constPath.Release(this, false);
max = 900f;
int num3;
for (int i = 0; i < this.count; i = num3 + 1)
{
if (!this.activeCritters[i].dead && (Links.x.follow.position - this.activeCritters[i].tr.position).sqrMagnitude > max)
{
if (this.outsideNodes.Count > 0)
{
GraphNode graphNode = this.outsideNodes[Random.Range(0, this.outsideNodes.Count)];
this.activeCritters[i].MakeRandomPath(graphNode);
}
yield return new WaitForSeconds(0.1f);
}
num3 = i;
}
this.CheckSquished(startPosition);
startPosition = default(Vector3);
constPath = null;
}
yield break;
}
// Token: 0x0600058D RID: 1421 RVA: 0x0007A155 File Offset: 0x00078355
public void AddActiveCritter(CritterActions c)
{
this.activeCritters.Add(c);
}
// Token: 0x0600058E RID: 1422 RVA: 0x0007A163 File Offset: 0x00078363
public void RemoveActiveCritter(CritterActions c)
{
}
// Token: 0x0600058F RID: 1423 RVA: 0x0007A165 File Offset: 0x00078365
public void AddSquished(GameObject go, bool respawn)
{
this.squished.Add(go);
}
// Token: 0x06000590 RID: 1424 RVA: 0x0007A173 File Offset: 0x00078373
public GraphNode GetRandomNode()
{
return this.outsideNodes[Random.Range(0, this.outsideNodes.Count)];
}
// Token: 0x06000591 RID: 1425 RVA: 0x0007A194 File Offset: 0x00078394
public void CheckSquished(Vector3 fromDistance)
{
bool flag = false;
for (int i = 0; i < this.squished.Count; i++)
{
if ((this.squished[i].transform.position - fromDistance).sqrMagnitude > 1225f)
{
Links.x.cellar.ReturnPooledGameObject(20, this.squished[i]);
this.squished[i] = null;
flag = true;
}
}
if (flag)
{
this.squished.RemoveAll((GameObject item) => item == null);
}
}
// Token: 0x06000592 RID: 1426 RVA: 0x0007A240 File Offset: 0x00078440
public void RemoveScene()
{
foreach (GameObject gameObject in this.squished)
{
Links.x.cellar.ReturnPooledGameObject(20, gameObject);
}
this.outsideNodes.Clear();
for (int i = 0; i < this.activeCritters.Count; i++)
{
if (i < this.activeCritters.Count && this.activeCritters[i])
{
this.activeCritters[i].Stop();
this.activeCritters[i].dead = false;
this.activeCritters[i].gameObject.transform.position = new Vector3(10000f, 10000f, 10000f);
}
}
this.prevPosition = new Vector3(100000f, 100000f, 100000f);
}
// Token: 0x04000890 RID: 2192
public List<GameObject> critterTypes = new List<GameObject>();
// Token: 0x04000891 RID: 2193
public List<CritterActions> activeCritters = new List<CritterActions>();
// Token: 0x04000892 RID: 2194
public bool lookingForPaths;
// Token: 0x04000893 RID: 2195
private Vector3 prevPosition;
// Token: 0x04000894 RID: 2196
private List<GraphNode> outsideNodes = new List<GraphNode>();
// Token: 0x04000895 RID: 2197
private NNConstraint nodeConstraint = new NNConstraint();
// Token: 0x04000896 RID: 2198
private List<GraphNode> allNodes;
// Token: 0x04000897 RID: 2199
private int count;
// Token: 0x04000898 RID: 2200
private List<Character> party;
// Token: 0x04000899 RID: 2201
private List<GameObject> squished = new List<GameObject>();
// Token: 0x0400089A RID: 2202
public GameObject crab;
}

View File

@@ -0,0 +1,402 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
// Token: 0x02000084 RID: 132
public class Culling : MonoBehaviour
{
// Token: 0x06000CD7 RID: 3287 RVA: 0x000F90F0 File Offset: 0x000F72F0
public void Setup(SceneCamera sceneCam)
{
this.sceneCamera = sceneCam;
if (this.centerSphere)
{
this.centerSphere.SetActive(false);
}
int count = this.grass.Count;
if (!this.sceneCamera.perspectiveShot && this.sceneCamera.index == 0)
{
this.art.gameObject.transform.localScale = new Vector3(22.6001f, 22.6001f, 1f);
}
if (!this.sceneCamera.perspectiveShot && this.sceneCamera.index == 1)
{
if (this.art.gameObject.transform.localScale.x > 20f)
{
this.art.gameObject.transform.localScale = new Vector3(22.6001f, 22.6001f, 1f);
}
else
{
this.art.gameObject.transform.localScale = new Vector3(11.3002f, 11.3002f, 1f);
}
}
if (!this.first)
{
if (this.art)
{
this.art.gameObject.layer = 2;
if (this.art.sharedMaterial && !this.art.sharedMaterial.shader.name.Contains("Lit"))
{
this.art.sharedMaterial.shader = Links.x.quadShader;
}
}
this.first = true;
}
if (Links.x)
{
Links.x.AddQuad(this);
}
if (this.art)
{
this.min = this.art.bounds.min;
this.max = this.art.bounds.max;
}
this.culling = this;
if (Links.x)
{
this.ChangeState(false, false);
}
base.enabled = false;
}
// Token: 0x06000CD8 RID: 3288 RVA: 0x000F92F4 File Offset: 0x000F74F4
public void ChangeState(bool on, bool quadForceOff)
{
int num = this.lights.Count;
for (int i = 0; i < num; i++)
{
if (this.lights[i])
{
this.lights[i].enabled = on;
if (on)
{
this.lights[i].EnableRevealer();
}
}
}
num = this.losBlockers.Count;
for (int j = 0; j < num; j++)
{
this.losBlockers[j].enabled = on;
}
num = this.grass.Count;
for (int k = 0; k < num; k++)
{
this.grass[k].enabled = on;
}
num = this.audioSources.Count;
for (int l = 0; l < num; l++)
{
this.audioSources[l].enabled = on;
if (on)
{
this.audioSources[l].audioSource.volume = Links.x.options.soundVolume;
}
}
num = this.hannahAnimators.Count;
for (int m = 0; m < num; m++)
{
this.hannahAnimators[m].enabled = on;
if (on && this.hannahAnimators[m])
{
this.hannahAnimators[m].enabled = on;
}
}
this.camParams.enabled = on;
this.art.enabled = on;
if (quadForceOff)
{
this.art.enabled = false;
this.camParams.enabled = false;
}
this.isOn = on;
}
// Token: 0x06000CD9 RID: 3289 RVA: 0x000F9494 File Offset: 0x000F7694
public void SetVolume()
{
int count = this.audioSources.Count;
for (int i = 0; i < count; i++)
{
this.audioSources[i].audioSource.volume = Links.x.options.soundVolume;
}
}
// Token: 0x06000CDA RID: 3290 RVA: 0x000F94DE File Offset: 0x000F76DE
public void ArtOn()
{
this.camParams.enabled = true;
this.art.enabled = true;
}
// Token: 0x06000CDB RID: 3291 RVA: 0x000F94F8 File Offset: 0x000F76F8
public void MultiCameraChange(bool on)
{
}
// Token: 0x06000CDC RID: 3292 RVA: 0x000F94FC File Offset: 0x000F76FC
public void CreateWallRenderers()
{
for (int i = 0; i < this.losBlockers.Count; i++)
{
if (this.losBlockers[i])
{
Object.DestroyImmediate(this.losBlockers[i].gameObject);
}
}
this.losBlockers.Clear();
int count = this.colliders.Count;
for (int j = 0; j < count; j++)
{
if (this.colliders[j].gameObject.layer == 9)
{
this.CreateMeshRenderer(this.colliders[j]);
}
}
}
// Token: 0x06000CDD RID: 3293 RVA: 0x000F9598 File Offset: 0x000F7798
public void CreateFloorRenderer(Collider collider)
{
GameObject gameObject = collider.gameObject;
if (gameObject.GetComponent<MeshCollider>())
{
GameObject gameObject2 = new GameObject("Line of Sight Blocker Mesh " + gameObject.name);
Transform transform = gameObject.transform;
gameObject2.transform.position = transform.position - this.ySubtract;
gameObject2.transform.rotation = transform.rotation;
gameObject2.AddComponent<MeshFilter>().mesh = gameObject.GetComponent<MeshFilter>().sharedMesh;
gameObject2.AddComponent<MeshRenderer>().sharedMaterial = Links.x.lineOfSightBlockerMaterial;
gameObject2.layer = 29;
gameObject2.transform.parent = transform;
gameObject2.transform.localScale = Vector3.one;
return;
}
BoxCollider component = gameObject.GetComponent<BoxCollider>();
if (component)
{
GameObject gameObject3 = new GameObject("Line of Sight Blocker");
Transform transform2 = gameObject.transform;
gameObject3.transform.position = transform2.TransformPoint(component.center);
gameObject3.transform.rotation = transform2.rotation;
gameObject3.transform.localScale = new Vector3(component.size.x * transform2.localScale.x, component.size.y * transform2.localScale.y, component.size.z * transform2.localScale.z);
gameObject3.AddComponent<MeshFilter>().mesh = Links.x.cubeMesh;
gameObject3.AddComponent<MeshRenderer>().sharedMaterial = Links.x.lineOfSightBlockerMaterial;
gameObject3.layer = 29;
gameObject3.transform.parent = transform2;
return;
}
SphereCollider component2 = gameObject.GetComponent<SphereCollider>();
if (component2)
{
GameObject gameObject4 = new GameObject("Line of Sight Blocker Sphere");
Transform transform3 = gameObject.transform;
gameObject4.transform.position = transform3.TransformPoint(component2.center);
gameObject4.transform.rotation = transform3.rotation;
gameObject4.transform.localScale = new Vector3(component2.radius * transform3.localScale.x * 2f, component2.radius * transform3.localScale.x * 2f, component2.radius * transform3.localScale.z * 2f);
gameObject4.AddComponent<MeshFilter>().mesh = Links.x.sphereMesh;
gameObject4.AddComponent<MeshRenderer>().sharedMaterial = Links.x.lineOfSightBlockerMaterial;
gameObject4.layer = 29;
gameObject4.transform.parent = transform3;
return;
}
CapsuleCollider component3 = gameObject.GetComponent<CapsuleCollider>();
if (component3)
{
GameObject gameObject5 = new GameObject("Line of Sight Blocker Capsule");
Transform transform4 = gameObject.transform;
gameObject5.transform.position = transform4.TransformPoint(component3.center);
gameObject5.transform.rotation = transform4.rotation;
gameObject5.transform.localScale = new Vector3(component3.radius * transform4.localScale.x * 2f, component3.height * transform4.localScale.y / 2f, component3.radius * transform4.localScale.z * 2f);
gameObject5.AddComponent<MeshFilter>().mesh = Links.x.capsuleMesh;
gameObject5.AddComponent<MeshRenderer>().sharedMaterial = Links.x.lineOfSightBlockerMaterial;
gameObject5.layer = 29;
gameObject5.transform.parent = transform4;
}
}
// Token: 0x06000CDE RID: 3294 RVA: 0x000F990C File Offset: 0x000F7B0C
public void CreateMeshRenderer(Collider collider)
{
GameObject gameObject = collider.gameObject;
BoxCollider component = gameObject.GetComponent<BoxCollider>();
if (component)
{
GameObject gameObject2 = new GameObject("Line of Sight Blocker");
Transform transform = gameObject.transform;
gameObject2.transform.position = transform.TransformPoint(component.center);
gameObject2.transform.rotation = transform.rotation;
gameObject2.transform.localScale = new Vector3(component.size.x * transform.localScale.x, component.size.y * transform.localScale.y, component.size.z * transform.localScale.z);
gameObject2.AddComponent<MeshFilter>().mesh = Resources.GetBuiltinResource<Mesh>("Cube.fbx");
MeshRenderer meshRenderer = gameObject2.AddComponent<MeshRenderer>();
meshRenderer.sharedMaterial = Resources.Load<Material>("Crawl/LineOfSightBlockers");
gameObject2.layer = 29;
gameObject2.transform.parent = transform;
this.losBlockers.Add(meshRenderer);
meshRenderer.enabled = false;
return;
}
CapsuleCollider component2 = gameObject.GetComponent<CapsuleCollider>();
if (component2)
{
GameObject gameObject3 = new GameObject("Line of Sight Blocker Capsule");
Transform transform2 = gameObject.transform;
gameObject3.transform.position = transform2.TransformPoint(component2.center);
gameObject3.transform.rotation = transform2.rotation;
gameObject3.transform.localScale = new Vector3(component2.radius * transform2.localScale.x * 2f, component2.height * transform2.localScale.y / 2f, component2.radius * transform2.localScale.z * 2f);
gameObject3.AddComponent<MeshFilter>().mesh = Resources.GetBuiltinResource<Mesh>("Capsule.fbx");
MeshRenderer meshRenderer2 = gameObject3.AddComponent<MeshRenderer>();
meshRenderer2.sharedMaterial = Resources.Load<Material>("Crawl/LineOfSightBlockers");
gameObject3.layer = 29;
gameObject3.transform.parent = transform2;
this.losBlockers.Add(meshRenderer2);
meshRenderer2.enabled = false;
return;
}
SphereCollider component3 = gameObject.GetComponent<SphereCollider>();
if (component3)
{
GameObject gameObject4 = new GameObject("Line of Sight Blocker Sphere");
Transform transform3 = gameObject.transform;
gameObject4.transform.position = transform3.TransformPoint(component3.center);
gameObject4.transform.rotation = transform3.rotation;
gameObject4.transform.localScale = new Vector3(component3.radius * transform3.localScale.x * 2f, component3.radius * transform3.localScale.x * 2f, component3.radius * transform3.localScale.z * 2f);
gameObject4.AddComponent<MeshFilter>().mesh = Resources.GetBuiltinResource<Mesh>("Sphere.fbx");
MeshRenderer meshRenderer3 = gameObject4.AddComponent<MeshRenderer>();
meshRenderer3.sharedMaterial = Resources.Load<Material>("Crawl/LineOfSightBlockers");
gameObject4.layer = 29;
gameObject4.transform.parent = transform3;
this.losBlockers.Add(meshRenderer3);
meshRenderer3.enabled = false;
return;
}
}
// Token: 0x06000CDF RID: 3295 RVA: 0x000F9C21 File Offset: 0x000F7E21
public void ClearColliders()
{
this.colliders.Clear();
}
// Token: 0x06000CE0 RID: 3296 RVA: 0x000F9C2E File Offset: 0x000F7E2E
public void AddCollider(Collider coll)
{
if (coll.gameObject.name.Contains("amera"))
{
return;
}
this.colliders.Add(coll);
}
// Token: 0x06000CE1 RID: 3297 RVA: 0x000F9C54 File Offset: 0x000F7E54
public void ClearGrass()
{
this.grass.Clear();
}
// Token: 0x06000CE2 RID: 3298 RVA: 0x000F9C61 File Offset: 0x000F7E61
public void ClearAudio()
{
this.audioSources.Clear();
}
// Token: 0x06000CE3 RID: 3299 RVA: 0x000F9C6E File Offset: 0x000F7E6E
public void AddGrass(MeshRenderer renderer)
{
if (renderer.shadowCastingMode == ShadowCastingMode.ShadowsOnly)
{
return;
}
this.grass.Add(renderer);
}
// Token: 0x06000CE4 RID: 3300 RVA: 0x000F9C86 File Offset: 0x000F7E86
public void ClearLights()
{
this.lights.Clear();
}
// Token: 0x06000CE5 RID: 3301 RVA: 0x000F9C93 File Offset: 0x000F7E93
public void ClearHannahAnimators()
{
this.hannahAnimators.Clear();
}
// Token: 0x06000CE6 RID: 3302 RVA: 0x000F9CA0 File Offset: 0x000F7EA0
public void AddSource(CoolAudioSource source)
{
this.audioSources.Add(source);
}
// Token: 0x06000CE7 RID: 3303 RVA: 0x000F9CAE File Offset: 0x000F7EAE
public void AddLight(Moonlight light)
{
this.lights.Add(light);
}
// Token: 0x06000CE8 RID: 3304 RVA: 0x000F9CBC File Offset: 0x000F7EBC
public void AddHannahAnimator(HannahAnimatorSimple anim)
{
this.hannahAnimators.Add(anim);
}
// Token: 0x0400147E RID: 5246
public bool isOn;
// Token: 0x0400147F RID: 5247
public MeshRenderer art;
// Token: 0x04001480 RID: 5248
public List<Moonlight> lights = new List<Moonlight>();
// Token: 0x04001481 RID: 5249
public List<Collider> colliders = new List<Collider>();
// Token: 0x04001482 RID: 5250
public List<MeshRenderer> grass = new List<MeshRenderer>();
// Token: 0x04001483 RID: 5251
public List<RandomAnimationStart> animatorsRandom = new List<RandomAnimationStart>();
// Token: 0x04001484 RID: 5252
public List<HannahAnimatorSimple> hannahAnimators = new List<HannahAnimatorSimple>();
// Token: 0x04001485 RID: 5253
public List<MeshRenderer> losBlockers = new List<MeshRenderer>();
// Token: 0x04001486 RID: 5254
public List<Item> items = new List<Item>();
// Token: 0x04001487 RID: 5255
public Vector3 center;
// Token: 0x04001488 RID: 5256
public Vector3 min;
// Token: 0x04001489 RID: 5257
public Vector3 max;
// Token: 0x0400148A RID: 5258
public CameraParams camParams;
// Token: 0x0400148B RID: 5259
private Culling culling;
// Token: 0x0400148C RID: 5260
private Material[] mat;
// Token: 0x0400148D RID: 5261
private Vector3 ySubtract = new Vector3(0f, 0.1f, 0f);
// Token: 0x0400148E RID: 5262
public GameObject centerSphere;
// Token: 0x0400148F RID: 5263
public SceneCamera sceneCamera;
// Token: 0x04001490 RID: 5264
public List<CoolAudioSource> audioSources = new List<CoolAudioSource>();
// Token: 0x04001491 RID: 5265
private bool first;
}

View File

@@ -0,0 +1,12 @@
using System;
using UnityEngine;
// Token: 0x020000A1 RID: 161
public class Data : MonoBehaviour
{
// Token: 0x040018FC RID: 6396
public int x;
// Token: 0x040018FD RID: 6397
public int y;
}

View File

@@ -0,0 +1,378 @@
using System;
using System.Collections;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using UnityEngine.Video;
// Token: 0x020000A2 RID: 162
public class DeathScreen : MonoBehaviour
{
// Token: 0x06000F36 RID: 3894 RVA: 0x001281FC File Offset: 0x001263FC
public void Setup()
{
if (Links.x.sensory)
{
Records.x.SetTypingState(true);
Links.x.gameplay.TogglePause(true);
Records.x.RemoveControls(true);
}
this.startVideo.enabled = false;
if (this.rt != null)
{
this.rt.Release();
}
RenderTextureFormat renderTextureFormat = RenderTextureFormat.Default;
this.rt = new RenderTexture(1920, 1080, 24, renderTextureFormat);
this.startVideo.targetTexture = this.rt;
this.videoImg.texture = this.rt;
this.done = false;
this.skipText.enabled = false;
RenderTexture active = RenderTexture.active;
RenderTexture.active = this.rt;
GL.Clear(true, true, Color.black);
RenderTexture.active = active;
if (!this.forDemo)
{
this.animator.Play("DeathScreenVideo");
}
Time.timeScale = 1f;
if (this.forDemo)
{
this.WatchTrailer();
return;
}
this.coroutineStart = this.VideoStart();
base.StartCoroutine(this.coroutineStart);
}
// Token: 0x06000F37 RID: 3895 RVA: 0x0012831F File Offset: 0x0012651F
private IEnumerator VideoStart()
{
Links.x.gaia.PlayFade("Out", "Unscaled");
yield return new WaitForSecondsRealtime(0.5f);
RenderTexture active = RenderTexture.active;
RenderTexture.active = this.startVideo.targetTexture;
GL.Clear(true, true, Color.black);
RenderTexture.active = active;
Links.x.gaia.PlayFade("In", "Unscaled");
if (Records.x.linux)
{
this.startVideo.clip = this.mmVideoStartLinux;
}
else if (!Records.x.linux && (Records.x.windows7 || Records.x.alwaysPlayTranscodedVideo))
{
this.startVideo.clip = this.mmVideoStartWindows7;
}
else
{
this.startVideo.clip = this.mmVideoStart;
}
if (this.forDemo)
{
this.startVideo.isLooping = true;
}
this.startVideo.targetTexture = this.rt;
this.videoImg.texture = this.rt;
this.startVideo.SetDirectAudioVolume(0, Links.x.options.musicVolume);
RenderTexture active2 = RenderTexture.active;
RenderTexture.active = this.startVideo.targetTexture;
GL.Clear(true, true, Color.black);
RenderTexture.active = active2;
this.startVideo.enabled = true;
this.startVideo.started += this.VideoStarted;
this.startVideo.loopPointReached += this.EndReached;
this.videoImg.enabled = true;
yield break;
}
// Token: 0x06000F38 RID: 3896 RVA: 0x00128330 File Offset: 0x00126530
private void Update()
{
float num = this.rectTransformBlack.sizeDelta.x;
float num2 = this.rectTransformBlack.sizeDelta.y;
float num3 = (float)Screen.width / (float)Screen.height;
float num4 = 1.7777778f;
if (num3 != num4)
{
if (num3 > num4)
{
num = num2 * num4;
}
else
{
num2 = num / num4;
}
}
this.rectTransform.sizeDelta = new Vector2(num, num2);
}
// Token: 0x06000F39 RID: 3897 RVA: 0x00128397 File Offset: 0x00126597
public void VideoStarted(VideoPlayer vp)
{
base.StartCoroutine(this.VideoStarting());
}
// Token: 0x06000F3A RID: 3898 RVA: 0x001283A6 File Offset: 0x001265A6
private IEnumerator VideoStarting()
{
if (Time.timeScale > 0.5f)
{
Time.timeScale = 1f;
}
this.skipText.enabled = false;
this.skipText.spriteAsset = Links.x.GetSpriteSheetAsset(Links.x.gameplay.currentSpriteSheetAsset);
this.str.Clear();
this.str.Append("Skip ");
this.str.Append(" <voffset=.4em><size=50><sprite=");
if (Links.x.mk)
{
int keyIconIndex = Links.x.keyControl.GetKeyIconIndex("LMB");
this.str.Append(keyIconIndex);
this.str.Append("></size></voffset>");
}
else
{
int controllerSprite = Links.x.gameplay.GetControllerSprite("Cancel", Links.x.gameplay.controllerName);
this.str.Append(controllerSprite);
this.str.Append("></size></voffset>");
}
this.skipText.text = this.str.ToString();
float timeToLerp = 1f;
float percentage = 0f;
float startTime = Time.time;
while (percentage < 1f)
{
if (Time.timeScale > 0.5f)
{
Time.timeScale = 1f;
}
percentage = (Time.time - startTime) / timeToLerp;
yield return null;
}
this.skipText.enabled = true;
timeToLerp = 6f;
percentage = 0f;
startTime = Time.time;
while (percentage < 1f && !this.Clicked())
{
if (Time.timeScale > 0.5f)
{
Time.timeScale = 1f;
}
percentage = (Time.time - startTime) / timeToLerp;
yield return null;
}
if (!this.done && !this.forDemo)
{
this.animator.Play("DeathScreenIn");
this.SetFirstObject();
}
yield break;
}
// Token: 0x06000F3B RID: 3899 RVA: 0x001283B5 File Offset: 0x001265B5
public void SetFirstObject()
{
this.skipText.enabled = false;
if (Links.x.joy)
{
base.StartCoroutine(this.WaitToSetFirstObject());
}
}
// Token: 0x06000F3C RID: 3900 RVA: 0x001283DC File Offset: 0x001265DC
private void OnDestroy()
{
if (this.rt != null)
{
this.rt.Release();
}
}
// Token: 0x06000F3D RID: 3901 RVA: 0x001283F7 File Offset: 0x001265F7
private IEnumerator WaitToSetFirstObject()
{
yield return new WaitForSeconds(0.1f);
while (!this.loadBtn.activeSelf || !this.loadBtn.activeInHierarchy)
{
yield return null;
}
EventSystem.current.SetSelectedGameObject(this.loadBtn);
this.loadBtn.GetComponent<UITriggerButton>().SetSelected(true);
yield break;
}
// Token: 0x06000F3E RID: 3902 RVA: 0x00128406 File Offset: 0x00126606
public void EndReached(VideoPlayer vp)
{
if (!this.forDemo)
{
vp.enabled = false;
this.videoImg.enabled = false;
}
this.done = true;
}
// Token: 0x06000F3F RID: 3903 RVA: 0x0012842A File Offset: 0x0012662A
public void DeathScreenOut()
{
Links.x.hudControl.JoyBox(false);
this.startVideo.enabled = false;
this.videoImg.enabled = false;
this.animator.Play("DeathScreenOut");
}
// Token: 0x06000F40 RID: 3904 RVA: 0x00128464 File Offset: 0x00126664
public void DeathScreenOut2()
{
Links.x.hudControl.JoyBox(false);
this.startVideo.enabled = false;
this.videoImg.enabled = false;
this.animator.Play("DeathScreenOut2");
}
// Token: 0x06000F41 RID: 3905 RVA: 0x0012849E File Offset: 0x0012669E
public void TurnOffScreen()
{
base.gameObject.SetActive(false);
if (this.rt != null)
{
this.rt.Release();
}
}
// Token: 0x06000F42 RID: 3906 RVA: 0x001284C8 File Offset: 0x001266C8
private bool Clicked()
{
if (Links.x.joy)
{
if (Links.x.gameplay.cancelStart || Links.x.gameplay.actionStart || Links.x.gameplay.interactStart)
{
return true;
}
}
else if (Input.GetMouseButtonUp(0) || Input.GetMouseButtonUp(1) || Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.Return))
{
return true;
}
return false;
}
// Token: 0x06000F43 RID: 3907 RVA: 0x0012853B File Offset: 0x0012673B
public void ReturnToGame()
{
Records.x.RemoveControls(false);
Links.x.gameplay.TogglePause(false);
Records.x.SetTypingState(false);
base.gameObject.SetActive(false);
}
// Token: 0x06000F44 RID: 3908 RVA: 0x0012856F File Offset: 0x0012676F
public void BuyGame()
{
if (Links.x.main)
{
EventSystem.current.SetSelectedGameObject(null);
}
Application.OpenURL("https://banquetforfools.com/");
}
// Token: 0x06000F45 RID: 3909 RVA: 0x00128597 File Offset: 0x00126797
public void WatchTrailer()
{
this.animator.Play("DemoScreenTrailer");
if (Links.x.mk)
{
EventSystem.current.SetSelectedGameObject(null);
}
base.StartCoroutine(this.TrailerStart());
}
// Token: 0x06000F46 RID: 3910 RVA: 0x001285CD File Offset: 0x001267CD
private IEnumerator TrailerStart()
{
RenderTextureFormat renderTextureFormat = RenderTextureFormat.ARGB32;
this.rt = new RenderTexture(1920, 1080, 24, renderTextureFormat);
this.startVideo.targetTexture = this.rt;
this.videoImg.texture = this.rt;
this.startVideo.isLooping = false;
this.startVideo.SetDirectAudioVolume(0, Links.x.options.musicVolume);
yield return new WaitForSecondsRealtime(0.25f);
this.startVideo.enabled = true;
this.startVideo.loopPointReached += this.TrailerEndReached;
this.videoImg.enabled = true;
yield break;
}
// Token: 0x06000F47 RID: 3911 RVA: 0x001285DC File Offset: 0x001267DC
public void TrailerEndReached(VideoPlayer vp)
{
this.coroutineStart = this.VideoStart();
base.StartCoroutine(this.coroutineStart);
this.animator.Play("DemoScreenIn", 0, 0f);
this.startVideo.loopPointReached -= this.TrailerEndReached;
this.startVideo.isLooping = true;
}
// Token: 0x040018FE RID: 6398
public VideoPlayer startVideo;
// Token: 0x040018FF RID: 6399
public VideoPlayer loopVideo;
// Token: 0x04001900 RID: 6400
public VideoClip mmVideoStart;
// Token: 0x04001901 RID: 6401
public VideoClip mmVideoStartLinux;
// Token: 0x04001902 RID: 6402
public VideoClip mmVideoStartWindows7;
// Token: 0x04001903 RID: 6403
public VideoClip trailerVideo;
// Token: 0x04001904 RID: 6404
public VideoClip trailerVideoLinux;
// Token: 0x04001905 RID: 6405
public RawImage videoImg;
// Token: 0x04001906 RID: 6406
private RenderTexture rt;
// Token: 0x04001907 RID: 6407
private IEnumerator coroutineStart;
// Token: 0x04001908 RID: 6408
public Animator animator;
// Token: 0x04001909 RID: 6409
private int clickCount;
// Token: 0x0400190A RID: 6410
private float clickTime;
// Token: 0x0400190B RID: 6411
private bool done;
// Token: 0x0400190C RID: 6412
public bool forDemo;
// Token: 0x0400190D RID: 6413
public RectTransform rectTransform;
// Token: 0x0400190E RID: 6414
public RectTransform rectTransformBlack;
// Token: 0x0400190F RID: 6415
public GameObject loadBtn;
// Token: 0x04001910 RID: 6416
public TextMeshProUGUI skipText;
// Token: 0x04001911 RID: 6417
private StringFast str = new StringFast(32);
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
// Token: 0x02000026 RID: 38
public class DialogueSounds : MonoBehaviour
{
// Token: 0x06000669 RID: 1641 RVA: 0x0008620B File Offset: 0x0008440B
private void Start()
{
}
// Token: 0x0600066A RID: 1642 RVA: 0x00086210 File Offset: 0x00084410
public void PlaySound()
{
string parsedText = this.textComponent.GetParsedText();
int maxVisibleCharacters = this.textComponent.maxVisibleCharacters;
int num = 0;
int num2 = 0;
foreach (char c in parsedText)
{
if (num2 == maxVisibleCharacters)
{
num = (int)(char.ToUpper(c) - 'A');
if (num < 0)
{
num = 26;
}
}
num2++;
}
this.audioPlayer.clip = this.audioArray[num];
this.audioPlayer.volume = Links.x.options.soundVolume * 0.3f;
this.audioPlayer.Play();
}
// Token: 0x04000924 RID: 2340
public TextMeshProUGUI textComponent;
// Token: 0x04000925 RID: 2341
public AudioSource audioPlayer;
// Token: 0x04000926 RID: 2342
public List<AudioClip> audioArray = new List<AudioClip>();
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,101 @@
using System;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
// Token: 0x02000027 RID: 39
public class DockFriend : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerDownHandler, IPointerUpHandler, IPointerExitHandler
{
// Token: 0x0600066C RID: 1644 RVA: 0x000862C8 File Offset: 0x000844C8
public void Setup(Character c, Character boundToCharacter)
{
this.character = c;
this.boundCharacterName = boundToCharacter.stats.GetName();
Links.x.renderPortraits.AddCharacter(null, this.character.stats.xmlName, null, false, null, this.raw, null, null);
this.UpdateHealth();
this.dock = boundToCharacter.portrait.skillBag;
base.transform.SetParent(boundToCharacter.portrait.skillBag.weaponTransform);
this.dock.AddButton(this.btn);
base.gameObject.transform.localPosition = new Vector3(0f, 0f, 0f);
base.gameObject.SetActive(true);
}
// Token: 0x0600066D RID: 1645 RVA: 0x0008638B File Offset: 0x0008458B
public void UpdateHealth()
{
this.healthBar.fillAmount = 1f - (float)this.character.stats.HealthCurrent() / (float)this.character.stats.HealthMax();
}
// Token: 0x0600066E RID: 1646 RVA: 0x000863C1 File Offset: 0x000845C1
public void RemovePortrait()
{
Links.x.renderPortraits.RemoveCharacter(null, this.character.stats.xmlName, this.raw.texture);
}
// Token: 0x0600066F RID: 1647 RVA: 0x000863F0 File Offset: 0x000845F0
public void AddPortrait()
{
Links.x.renderPortraits.AddCharacter(null, this.character.stats.xmlName, null, false, null, this.raw, null, null);
}
// Token: 0x06000670 RID: 1648 RVA: 0x00086428 File Offset: 0x00084628
public void Remove()
{
Links.x.renderPortraits.RemoveCharacter(null, this.character.stats.xmlName, this.raw.texture);
base.transform.SetParent(Links.x.hudControl.miscFolderQuipsTransform);
if (this.dock)
{
this.dock.RemoveButton(this.btn);
}
Links.x.cellar.ReturnPooledGameObject(121, base.gameObject);
}
// Token: 0x06000671 RID: 1649 RVA: 0x000864B0 File Offset: 0x000846B0
public void OnPointerEnter(PointerEventData eventData)
{
this.str.Clear();
this.str.Append(this.character.stats.GetName());
this.str.Append(" ");
this.str.Append(this.character.stats.HealthCurrent());
this.str.Append("/");
this.str.Append(this.character.stats.HealthMax());
this.dock.TooltipOn(null, base.gameObject, this.str.ToString(), true);
}
// Token: 0x06000672 RID: 1650 RVA: 0x0008655D File Offset: 0x0008475D
public void OnPointerExit(PointerEventData eventData)
{
this.dock.TooltipOff();
}
// Token: 0x06000673 RID: 1651 RVA: 0x0008656A File Offset: 0x0008476A
public void OnPointerDown(PointerEventData eventData)
{
}
// Token: 0x06000674 RID: 1652 RVA: 0x0008656C File Offset: 0x0008476C
public void OnPointerUp(PointerEventData eventData)
{
}
// Token: 0x04000927 RID: 2343
public Character character;
// Token: 0x04000928 RID: 2344
public string boundCharacterName;
// Token: 0x04000929 RID: 2345
public RawImage raw;
// Token: 0x0400092A RID: 2346
public Image healthBar;
// Token: 0x0400092B RID: 2347
private SkillBag dock;
// Token: 0x0400092C RID: 2348
public Button btn;
// Token: 0x0400092D RID: 2349
private StringFast str = new StringFast(32);
}

View File

@@ -0,0 +1,43 @@
using System;
using UnityEngine;
// Token: 0x02000064 RID: 100
public class Door : MonoBehaviour
{
// Token: 0x040010B5 RID: 4277
[Header("IF LOCKABLE")]
public bool lockable;
// Token: 0x040010B6 RID: 4278
public bool locked;
// Token: 0x040010B7 RID: 4279
public int lockDifficulty;
// Token: 0x040010B8 RID: 4280
public int health;
// Token: 0x040010B9 RID: 4281
public int armor;
// Token: 0x040010BA RID: 4282
public SceneItem.xmlNames keyItem = SceneItem.xmlNames.None;
// Token: 0x040010BB RID: 4283
public Creatures owner;
// Token: 0x040010BC RID: 4284
[Header("QUESTS")]
public bool triggersQuest;
// Token: 0x040010BD RID: 4285
public string questName;
// Token: 0x040010BE RID: 4286
[Header("CONNECTIONS")]
public MapExit connectedExit;
// Token: 0x040010BF RID: 4287
[Header("HOW TO BREAK IT")]
public Breakable.BreakableEffectRequired effectRequired;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
using System;
using UnityEngine;
// Token: 0x020000A3 RID: 163
[Serializable]
public class DrawBounds : MonoBehaviour
{
// Token: 0x04001912 RID: 6418
public bool alwaysOn;
}

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using Pathfinding;
using UnityEngine;
using UnityStandardAssets.ImageEffects;
// Token: 0x02000005 RID: 5
public class DrawMesh : MonoBehaviour
{
// Token: 0x04000126 RID: 294
private List<GraphNode> groupTiles;
// Token: 0x04000127 RID: 295
private List<int> groupID;
// Token: 0x04000128 RID: 296
private Camera cam;
// Token: 0x04000129 RID: 297
private Matrix4x4 sphereMatrix;
// Token: 0x0400012A RID: 298
private Matrix4x4 sphereMatrixLarger;
// Token: 0x0400012B RID: 299
public Mesh m;
// Token: 0x0400012C RID: 300
public Material[] groupMaterial;
// Token: 0x0400012D RID: 301
public Material[] groupMask;
// Token: 0x0400012E RID: 302
public BlurOptimized blur;
// Token: 0x0400012F RID: 303
public float scale = 6f;
}

View File

@@ -0,0 +1,71 @@
using System;
using UnityEngine;
using UnityEngine.UI;
// Token: 0x020000EB RID: 235
public class DrawSettingController : MonoBehaviour
{
// Token: 0x06001520 RID: 5408 RVA: 0x00197A0C File Offset: 0x00195C0C
private void Start()
{
this.lineWidthSlider.value = (float)this.drawViewController.GetDrawLineWidth();
this.lineWidthSlider.onValueChanged.AddListener(delegate
{
this.LineWidthChanged();
});
this.transparencySlider.value = this.drawViewController.GetDrawTransparency();
this.transparencySlider.onValueChanged.AddListener(delegate
{
this.TransparencyChanged();
});
this.drawColorInputField.text = "#" + ColorUtility.ToHtmlStringRGB(this.drawViewController.GetDrawColor());
this.drawColorInputField.onEndEdit.AddListener(delegate
{
this.DrawColorChanged();
});
}
// Token: 0x06001521 RID: 5409 RVA: 0x00197AC0 File Offset: 0x00195CC0
private void LineWidthChanged()
{
this.lineWidthText.text = this.lineWidthSlider.value.ToString();
this.drawViewController.SetDrawLineWidth((int)this.lineWidthSlider.value);
}
// Token: 0x06001522 RID: 5410 RVA: 0x00197B04 File Offset: 0x00195D04
private void TransparencyChanged()
{
this.transparencyText.text = this.transparencySlider.value.ToString();
this.drawViewController.SetDrawTransparency(this.transparencySlider.value);
}
// Token: 0x06001523 RID: 5411 RVA: 0x00197B48 File Offset: 0x00195D48
private void DrawColorChanged()
{
Color color;
if (ColorUtility.TryParseHtmlString(this.drawColorInputField.text, out color))
{
this.drawViewController.SetDrawColor(color);
return;
}
Debug.Log("invalid color input");
}
// Token: 0x04002506 RID: 9478
public Slider lineWidthSlider;
// Token: 0x04002507 RID: 9479
public Text lineWidthText;
// Token: 0x04002508 RID: 9480
public Slider transparencySlider;
// Token: 0x04002509 RID: 9481
public Text transparencyText;
// Token: 0x0400250A RID: 9482
public InputField drawColorInputField;
// Token: 0x0400250B RID: 9483
public DrawViewController drawViewController;
}

View File

@@ -0,0 +1,84 @@
using System;
using System.Collections.Generic;
using UnityEngine;
// Token: 0x020000EC RID: 236
public class DrawSettings
{
// Token: 0x06001528 RID: 5416 RVA: 0x00197BA0 File Offset: 0x00195DA0
public DrawSettings()
{
this.undos = new Stack<Color32[]>();
this.redos = new Stack<Color32[]>();
}
// Token: 0x06001529 RID: 5417 RVA: 0x00197BDB File Offset: 0x00195DDB
public void SetDrawColour(Color new_color)
{
this.drawColor = new_color;
}
// Token: 0x0600152A RID: 5418 RVA: 0x00197BE4 File Offset: 0x00195DE4
public void SetLineWidth(int new_width)
{
this.lineWidth = new_width;
}
// Token: 0x0600152B RID: 5419 RVA: 0x00197BF0 File Offset: 0x00195DF0
public void SetAlpha(float amount)
{
Color color = this.drawColor;
color.a = amount;
this.drawColor = color;
}
// Token: 0x0600152C RID: 5420 RVA: 0x00197C13 File Offset: 0x00195E13
public void AddUndo(Color32[] undo)
{
this.undos.Push(undo);
this.redos.Clear();
}
// Token: 0x0600152D RID: 5421 RVA: 0x00197C2C File Offset: 0x00195E2C
public Color32[] Undo(Color32[] newState)
{
Color32[] array = this.undos.Pop();
this.redos.Push(newState);
return array;
}
// Token: 0x0600152E RID: 5422 RVA: 0x00197C45 File Offset: 0x00195E45
public bool CanUndo()
{
return this.undos.Count > 0;
}
// Token: 0x0600152F RID: 5423 RVA: 0x00197C55 File Offset: 0x00195E55
public Color32[] Redo(Color32[] newState)
{
Color32[] array = this.redos.Pop();
this.undos.Push(newState);
return array;
}
// Token: 0x06001530 RID: 5424 RVA: 0x00197C6E File Offset: 0x00195E6E
public bool CanRedo()
{
return this.redos.Count > 0;
}
// Token: 0x0400250C RID: 9484
public Color drawColor = Color.black;
// Token: 0x0400250D RID: 9485
public int lineWidth = 5;
// Token: 0x0400250E RID: 9486
public float transparency = 1f;
// Token: 0x0400250F RID: 9487
public Stack<Color32[]> undos;
// Token: 0x04002510 RID: 9488
public Stack<Color32[]> redos;
}

View File

@@ -0,0 +1,386 @@
using System;
using System.Collections;
using System.IO;
using DarkTonic.MasterAudio;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
// Token: 0x020000ED RID: 237
public class DrawViewController : MonoBehaviour, IBeginDragHandler, IEventSystemHandler, IDragHandler, IEndDragHandler
{
// Token: 0x06001531 RID: 5425 RVA: 0x00197C80 File Offset: 0x00195E80
private void Awake()
{
this.rectTransform = base.GetComponent<RectTransform>();
this.drawImage = base.GetComponent<Image>();
this.drawSettings = new DrawSettings();
this.drawSettings.lineWidth = this.lineWidth;
this.resetColor = new Color(0f, 0f, 0f, 0f);
this.Initialize();
this.ResetTexture();
}
// Token: 0x06001532 RID: 5426 RVA: 0x00197CEC File Offset: 0x00195EEC
public void CheckAgainstMask()
{
int num = 0;
int num2 = this.currentColors.Length;
int num3 = 0;
for (int i = 0; i < num2; i++)
{
if ((double)this.currentColors[i].a < 0.5 && (double)this.maskColors[i].r > 0.5)
{
num++;
}
if ((double)this.maskColors[i].r > 0.5)
{
num3++;
}
}
int num4 = num3 - num;
this.percentComplete = (float)num4 / (float)num3;
this.meter.fillAmount = this.percentComplete;
float num5 = this.percentComplete;
this.meter.color = Color.Lerp(this.notEnoughColor, this.completeColor, num5);
this.uncoveredText.text = Mathf.Ceil(this.percentComplete * 100f).ToString() + "%";
}
// Token: 0x06001533 RID: 5427 RVA: 0x00197DED File Offset: 0x00195FED
public void SaveAsSprite(string filename, bool saveOver, string scrollName, Library.Inventory invRow, string lookFor)
{
base.StartCoroutine(this.Save(filename, saveOver, scrollName, invRow, lookFor));
}
// Token: 0x06001534 RID: 5428 RVA: 0x00197E03 File Offset: 0x00196003
private IEnumerator Save(string filename, bool saveOver, string scrollName, Library.Inventory invRow, string lookFor)
{
yield return new WaitForEndOfFrame();
Vector3[] array = new Vector3[4];
this.drawImage.gameObject.GetComponent<RectTransform>().GetWorldCorners(array);
Vector2 vector = RectTransformUtility.WorldToScreenPoint(Links.x.menuCamera, array[0]);
Vector2 vector2 = RectTransformUtility.WorldToScreenPoint(Links.x.menuCamera, array[1]);
ref Vector2 ptr = RectTransformUtility.WorldToScreenPoint(Links.x.menuCamera, array[2]);
int num = Mathf.RoundToInt(vector2.y - vector.y);
int num2 = Mathf.RoundToInt(ptr.x - vector.x);
Texture2D texture2D = new Texture2D(num2, num, TextureFormat.RGB24, false);
Rect rect = new Rect(Mathf.Round(vector.x), Mathf.Round(vector.y), (float)num2, (float)num);
texture2D.ReadPixels(rect, 0, 0);
texture2D.Apply();
if (num2 > 512)
{
Texture2D texture2D2 = this.ScaleTexture(texture2D, 512, 512);
byte[] array2 = texture2D2.EncodeToPNG();
Object.Destroy(texture2D);
Object.Destroy(texture2D2);
File.WriteAllBytes(filename, array2);
}
else
{
byte[] array3 = texture2D.EncodeToPNG();
Object.Destroy(texture2D);
File.WriteAllBytes(filename, array3);
}
Links.x.hudControl.chalkRubbing.GetComponent<Animator>().Play("ChalkRubbingClose");
Links.x.dialogue.inventoryItemImage.sprite = Links.x.archives.GetItem(invRow._UIModel);
Debug.Log(filename + " " + lookFor);
Links.x.archives.OverrideRune(lookFor, filename, "", lookFor);
MasterAudio.PlaySoundAndForget("Inventory", 0.6f, new float?(1f), 0f, invRow._Sound, null);
Links.x.dialogue.dialoguePopupBox.SetActive(true);
this.str.Clear();
if (!saveOver)
{
this.str.Append("Item gained\n<size=1.6em><font=Bold>");
}
else
{
this.str.Append("Item updated\n<size=1.6em><font=Bold>");
}
this.str.Append(invRow._DisplayName);
this.str.Append("</font></size>");
Links.x.dialogue.itemPopupText.text = this.str.ToString();
Links.x.dialogue.dialoguePopupBoxAnimator.Play("DialoguePopsItemOn", -1, 0f);
yield return new WaitForSeconds(4.15f);
MasterAudio.PlaySoundAndForget("Feedback", 0.6f, new float?(1f), 0f, "Box Close", null);
yield return new WaitForSeconds(0.6f);
Links.x.dialogue.dialoguePopupBox.SetActive(false);
Links.x.dialogue.itemPopupText.text = "";
Links.x.hudControl.FinishedSavingChalkRubbing(Mathf.Ceil(this.percentComplete * 100f), scrollName, invRow);
this.ResetTexture();
yield break;
}
// Token: 0x06001535 RID: 5429 RVA: 0x00197E38 File Offset: 0x00196038
private Texture2D ScaleTexture(Texture2D source, int targetWidth, int targetHeight)
{
Texture2D texture2D = new Texture2D(targetWidth, targetHeight, source.format, true);
Color[] pixels = texture2D.GetPixels(0);
float num = 1f / (float)source.width * ((float)source.width / (float)targetWidth);
float num2 = 1f / (float)source.height * ((float)source.height / (float)targetHeight);
for (int i = 0; i < pixels.Length; i++)
{
pixels[i] = source.GetPixelBilinear(num * ((float)i % (float)targetWidth), num2 * Mathf.Floor((float)(i / targetWidth)));
}
texture2D.SetPixels(pixels, 0);
texture2D.Apply();
return texture2D;
}
// Token: 0x06001536 RID: 5430 RVA: 0x00197ED4 File Offset: 0x001960D4
public void Initialize()
{
if (!this.drawImage)
{
this.drawImage = base.gameObject.GetComponent<Image>();
this.rectTransform = base.gameObject.GetComponent<RectTransform>();
this.drawSettings = new DrawSettings();
}
this.drawSprite = this.drawImage.sprite;
this.drawTexture = this.drawSprite.texture;
if (this.mask)
{
this.maskColors = this.mask.GetPixels32();
}
this.resetColorsArray = new Color[(int)this.drawSprite.rect.width * (int)this.drawSprite.rect.height];
for (int i = 0; i < this.resetColorsArray.Length; i++)
{
this.resetColorsArray[i] = this.resetColor;
}
}
// Token: 0x06001537 RID: 5431 RVA: 0x00197FB4 File Offset: 0x001961B4
private void KeyboardInput()
{
if (!Input.GetKey(KeyCode.LeftControl))
{
Input.GetKey(KeyCode.RightControl);
}
Input.GetKeyDown(KeyCode.Z);
}
// Token: 0x06001538 RID: 5432 RVA: 0x00197FD8 File Offset: 0x001961D8
public void Paint(Vector2 pixelPosition)
{
this.currentColors = this.drawTexture.GetPixels32();
if (this.previousDragPosition == Vector2.zero)
{
this.MarkPixelsToColour(pixelPosition);
}
else
{
this.ColorBetween(this.previousDragPosition, pixelPosition);
}
this.ApplyCurrentColors();
this.previousDragPosition = pixelPosition;
}
// Token: 0x06001539 RID: 5433 RVA: 0x0019802C File Offset: 0x0019622C
public void MarkPixelsToColour(Vector2 centerPixel)
{
int num = (int)centerPixel.x;
int num2 = (int)centerPixel.y;
for (int i = num - this.drawSettings.lineWidth; i <= num + this.drawSettings.lineWidth; i++)
{
if (i < (int)this.drawSprite.rect.width && i >= 0)
{
for (int j = num2 - this.drawSettings.lineWidth; j <= num2 + this.drawSettings.lineWidth; j++)
{
this.MarkPixelToChange(i, j);
}
}
}
}
// Token: 0x0600153A RID: 5434 RVA: 0x001980BC File Offset: 0x001962BC
public void ColorBetween(Vector2 startPoint, Vector2 endPoint)
{
float num = Vector2.Distance(startPoint, endPoint);
float num2 = 1f / num;
for (float num3 = 0f; num3 <= 1f; num3 += num2)
{
Vector2 vector = Vector2.Lerp(startPoint, endPoint, num3);
this.MarkPixelsToColour(vector);
}
}
// Token: 0x0600153B RID: 5435 RVA: 0x00198100 File Offset: 0x00196300
public void MarkPixelToChange(int x, int y)
{
int num = y * (int)this.drawSprite.rect.width + x;
if (num > this.currentColors.Length || num < 0)
{
return;
}
if (num > -1 && num < this.currentColors.Length)
{
this.currentColors[num] = this.drawSettings.drawColor;
}
}
// Token: 0x0600153C RID: 5436 RVA: 0x00198161 File Offset: 0x00196361
public void ApplyCurrentColors()
{
this.drawTexture.SetPixels32(this.currentColors);
this.drawTexture.Apply();
if (this.checkMask)
{
this.CheckAgainstMask();
}
}
// Token: 0x0600153D RID: 5437 RVA: 0x00198190 File Offset: 0x00196390
public void ResetTexture()
{
if (this.drawTexture)
{
this.drawTexture.SetPixels(this.resetColorsArray);
this.drawTexture.Apply();
this.currentColors = this.drawTexture.GetPixels32();
if (this.checkMask)
{
this.CheckAgainstMask();
}
}
}
// Token: 0x0600153E RID: 5438 RVA: 0x001981E5 File Offset: 0x001963E5
public void OnBeginDrag(PointerEventData eventData)
{
this.drawSettings.AddUndo(this.drawTexture.GetPixels32());
this.OnDrag(eventData);
}
// Token: 0x0600153F RID: 5439 RVA: 0x00198204 File Offset: 0x00196404
public void OnDrag(PointerEventData eventData)
{
Vector2 zero = Vector2.zero;
if (eventData != null)
{
if (!RectTransformUtility.ScreenPointToLocalPointInRectangle(this.rectTransform, eventData.position, eventData.pressEventCamera, out zero))
{
return;
}
}
else
{
zero = this.joystickPosition;
}
if (zero.x < this.rectTransform.rect.width && zero.y < this.rectTransform.rect.height && zero.x > 0f && zero.y > 0f)
{
float num = this.drawImage.sprite.rect.width / this.rectTransform.rect.width;
zero = new Vector2(zero.x * num, zero.y * num);
this.Paint(zero);
this.previousDragPosition = zero;
return;
}
this.previousDragPosition = Vector2.zero;
}
// Token: 0x06001540 RID: 5440 RVA: 0x001982EE File Offset: 0x001964EE
public void OnEndDrag(PointerEventData eventData)
{
this.previousDragPosition = Vector2.zero;
}
// Token: 0x06001541 RID: 5441 RVA: 0x001982FB File Offset: 0x001964FB
public void SetDrawColor(Color color)
{
this.drawSettings.SetDrawColour(color);
}
// Token: 0x06001542 RID: 5442 RVA: 0x00198309 File Offset: 0x00196509
public Color GetDrawColor()
{
return this.drawSettings.drawColor;
}
// Token: 0x06001543 RID: 5443 RVA: 0x00198316 File Offset: 0x00196516
public void SetDrawLineWidth(int width)
{
this.drawSettings.SetLineWidth(width);
}
// Token: 0x06001544 RID: 5444 RVA: 0x00198324 File Offset: 0x00196524
public int GetDrawLineWidth()
{
return this.drawSettings.lineWidth;
}
// Token: 0x06001545 RID: 5445 RVA: 0x00198331 File Offset: 0x00196531
public void SetDrawTransparency(float transparency)
{
this.drawSettings.SetAlpha(transparency);
}
// Token: 0x06001546 RID: 5446 RVA: 0x0019833F File Offset: 0x0019653F
public float GetDrawTransparency()
{
return this.drawSettings.transparency;
}
// Token: 0x04002511 RID: 9489
private DrawSettings drawSettings;
// Token: 0x04002512 RID: 9490
private Image drawImage;
// Token: 0x04002513 RID: 9491
private Sprite drawSprite;
// Token: 0x04002514 RID: 9492
private Texture2D drawTexture;
// Token: 0x04002515 RID: 9493
private Vector2 previousDragPosition;
// Token: 0x04002516 RID: 9494
private Color[] resetColorsArray;
// Token: 0x04002517 RID: 9495
private Color resetColor;
// Token: 0x04002518 RID: 9496
private Color32[] currentColors;
// Token: 0x04002519 RID: 9497
private Color32[] maskColors;
// Token: 0x0400251A RID: 9498
private RectTransform rectTransform;
// Token: 0x0400251B RID: 9499
[Header("Settings")]
public int lineWidth = 5;
// Token: 0x0400251C RID: 9500
[Header("For Chalk Rubbing")]
public bool checkMask;
// Token: 0x0400251D RID: 9501
public Texture2D mask;
// Token: 0x0400251E RID: 9502
public float percentComplete;
// Token: 0x0400251F RID: 9503
public Image meter;
// Token: 0x04002520 RID: 9504
public Color notEnoughColor;
// Token: 0x04002521 RID: 9505
public Color closeColor;
// Token: 0x04002522 RID: 9506
public Color completeColor;
// Token: 0x04002523 RID: 9507
public TextMeshProUGUI uncoveredText;
// Token: 0x04002524 RID: 9508
private StringFast str = new StringFast(64);
// Token: 0x04002525 RID: 9509
public Vector2 joystickPosition;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,716 @@
using System;
using System.Collections.Generic;
using DarkTonic.MasterAudio;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
// Token: 0x020000A4 RID: 164
public class EnchantItem : MonoBehaviour
{
// Token: 0x06000F4A RID: 3914 RVA: 0x00128658 File Offset: 0x00126858
private void Awake()
{
base.gameObject.SetActive(false);
this.camera3D.SetActive(false);
this.camTr = this.camera3D.transform;
foreach (object obj in this.camTr)
{
Transform transform = (Transform)obj;
if (transform.gameObject.name != "Camera" && transform != this.camTr)
{
transform.gameObject.SetActive(false);
}
}
}
// Token: 0x06000F4B RID: 3915 RVA: 0x00128704 File Offset: 0x00126904
private void Update()
{
if (Links.x.characterSheet.open && this.open && Links.x.characterSheet.character != this.character)
{
this.OpenMenu(Links.x.characterSheet.character);
}
}
// Token: 0x06000F4C RID: 3916 RVA: 0x0012875C File Offset: 0x0012695C
public void UpdateSlider()
{
GameObject currentEventObject = Links.x.gameplay.currentEventObject;
if (currentEventObject)
{
float x = Links.x.fellowship.direction.x;
Slider slider = null;
if (currentEventObject == this.slider1.gameObject)
{
slider = this.slider1;
}
if (currentEventObject == this.slider2.gameObject)
{
slider = this.slider2;
}
if (currentEventObject == this.slider3.gameObject)
{
slider = this.slider3;
}
float num = 1f;
if (!slider)
{
Links.x.inventory.inSlider = false;
return;
}
Links.x.inventory.inSlider = true;
float num2 = 0.3f;
if (Time.realtimeSinceStartup > this.lastSliderTime + num2 || this.lastSliderTime == 0f)
{
if (x > 0f)
{
slider.value += num;
}
else if (x < 0f)
{
slider.value -= num;
}
this.lastSliderTime = Time.realtimeSinceStartup;
return;
}
}
else
{
Links.x.inventory.inSlider = false;
}
}
// Token: 0x06000F4D RID: 3917 RVA: 0x00128888 File Offset: 0x00126A88
public void OpenMenu(Character c)
{
this.spellcraftingMenu = Links.x.spellcrafting;
this.ClearSpells();
this.character = c;
this.buttonText.text = "Select Weapon or Jewelry";
this.selectedSpell = "";
this.selected.SetActive(false);
this.description.text = "";
this.noSpells.text = "";
this.itemImage.enabled = false;
this.slider1Obj.SetActive(false);
this.slider2Obj.SetActive(false);
this.slider3Obj.SetActive(false);
this.SetInteractableState(false);
Links.x.gameplay.SetInteractableSelected(EventSystem.current, this.confirmButton.gameObject);
this.confirmButton.gameObject.GetComponent<UITriggerButton>().selectNext = null;
if (!this.open)
{
Records.x.AddMenu(base.gameObject);
this.open = true;
base.gameObject.SetActive(true);
Links.x.characterSheet.anim.Play("OpenEnchantMenu");
this.camera3D.SetActive(true);
string text = "SemizenStatue_C6_FortenLazure";
if (Links.x.diorama.sceneName == "C5_AbandonedFarm")
{
text = "SemizenStatue_C5_AbandonedFarm";
}
if (Links.x.diorama.sceneName == "D6_Rozafir")
{
text = "SemizenStatue_D6_Rozafir";
}
foreach (object obj in this.camTr)
{
Transform transform = (Transform)obj;
if (transform.gameObject.name == text)
{
transform.gameObject.SetActive(true);
}
else if (transform.gameObject.name != "Camera" && transform != this.camTr)
{
transform.gameObject.SetActive(false);
}
}
}
}
// Token: 0x06000F4E RID: 3918 RVA: 0x00128A98 File Offset: 0x00126C98
public void SwitchCharacter(Character c)
{
this.item = null;
this.itemEquipped = null;
this.OpenMenu(c);
}
// Token: 0x06000F4F RID: 3919 RVA: 0x00128AB0 File Offset: 0x00126CB0
public void SelectedItem(Item itemToEnchant, ItemEquipped itemEquippedToEnchant)
{
this.item = itemToEnchant;
this.itemEquipped = null;
if (itemEquippedToEnchant)
{
this.itemEquipped = itemEquippedToEnchant;
this.item = null;
}
this.SetupGrid();
if (this.item)
{
this.itemImage.sprite = Links.x.archives.GetItem(this.item.invRow._UIModel);
}
else
{
this.itemImage.sprite = Links.x.archives.GetItem(this.itemEquipped.invRow._UIModel);
}
this.itemImage.enabled = true;
if (Links.x.joy)
{
Links.x.gameplay.SetInteractableSelected(EventSystem.current, this.usedSpells[0]);
this.confirmButton.gameObject.GetComponent<UITriggerButton>().selectNext = this.usedSpells[0];
Navigation navigation = this.slider1.navigation;
navigation.selectOnUp = this.usedSpells[0].GetComponent<Button>();
if (this.slider2.interactable)
{
navigation.selectOnDown = this.slider2;
}
else
{
navigation.selectOnDown = this.confirmButton;
}
this.slider1.navigation = navigation;
navigation = this.slider2.navigation;
if (this.slider3.interactable)
{
navigation.selectOnDown = this.slider3;
}
else
{
navigation.selectOnDown = this.confirmButton;
}
this.slider2.navigation = navigation;
navigation = this.confirmButton.navigation;
if (this.slider3.interactable)
{
navigation.selectOnUp = this.slider3;
}
else if (this.slider2.interactable)
{
navigation.selectOnUp = this.slider2;
}
else
{
navigation.selectOnUp = this.slider1;
}
this.confirmButton.navigation = navigation;
}
}
// Token: 0x06000F50 RID: 3920 RVA: 0x00128CA0 File Offset: 0x00126EA0
public void SetupGrid()
{
this.ClearSpells();
this.isWeapon = false;
if (this.item && this.item.invRow._Tag == "Weapon")
{
this.isWeapon = true;
}
if (this.itemEquipped && this.itemEquipped.invRow._Tag == "Weapon")
{
this.isWeapon = true;
}
if (Links.x.diorama.sceneName == "C6_FortenLazure")
{
this.weaponBindingSpells = new string[] { "BlindingLight", "KnockbackLight", "SunStrafe" };
this.jewelryBindingSpells = new string[] { "SunShield", "DaylightPower" };
}
if (Links.x.diorama.sceneName == "C5_AbandonedFarm")
{
this.weaponBindingSpells = new string[] { "HarvestHealth", "HarvestGluttony" };
this.jewelryBindingSpells = new string[] { "HarvestStamina", "HarvestOverflowing" };
}
if (Links.x.diorama.sceneName == "D6_Rozafir")
{
this.jewelryBindingSpells = new string[] { "ChoraFluteBuff", "ChoraMusicResist" };
this.weaponBindingSpells = new string[] { "ChoraFormUpRally", "ChoraFormUpSpeed", "ChoraHitHornTarget" };
}
int num = this.weaponBindingSpells.Length;
if (!this.isWeapon)
{
num = this.jewelryBindingSpells.Length;
}
for (int i = 0; i < num; i++)
{
string text;
if (this.isWeapon)
{
text = this.weaponBindingSpells[i];
}
else
{
text = this.jewelryBindingSpells[i];
}
GameObject gameObject;
if (this.openSpells.Count > 0)
{
gameObject = this.openSpells[0];
this.openSpells.RemoveAt(0);
}
else
{
gameObject = Object.Instantiate<GameObject>(this.spellPrefab, Vector3.zero, Quaternion.identity);
gameObject.transform.SetParent(this.grid, true);
gameObject.transform.localPosition = Vector3.zero;
gameObject.transform.localRotation = Quaternion.identity;
gameObject.transform.localScale = new Vector3(1f, 1f, 1f);
}
gameObject.name = text;
this.usedSpells.Add(gameObject);
TMP_Text component = gameObject.transform.GetChild(0).gameObject.GetComponent<TextMeshProUGUI>();
this.paganRow = Links.x.library.GetPaganRow(text);
component.text = this.paganRow._DisplayName;
gameObject.SetActive(true);
if (i == 0)
{
this.SetSpell(gameObject);
}
}
}
// Token: 0x06000F51 RID: 3921 RVA: 0x00128F64 File Offset: 0x00127164
public void CloseMenu()
{
Links.x.characterSheet.anim.Play("CloseEnchantMenu");
this.camera3D.SetActive(false);
Records.x.RemoveMenu(base.gameObject);
this.ClearSpells();
this.usedSpells.Clear();
this.spellcraftingMenu.fromEnchantMenu = false;
base.gameObject.GetComponent<Animator>().Play("CloseSubMenu");
this.open = false;
this.selected.SetActive(false);
Links.x.inventory.inSlider = false;
}
// Token: 0x06000F52 RID: 3922 RVA: 0x00128FFC File Offset: 0x001271FC
private void ClearSpells()
{
for (int i = 0; i < this.usedSpells.Count; i++)
{
this.openSpells.Add(this.usedSpells[i]);
this.usedSpells[i].SetActive(false);
}
this.usedSpells.Clear();
}
// Token: 0x06000F53 RID: 3923 RVA: 0x00129053 File Offset: 0x00127253
public void FinishCloseMenu()
{
}
// Token: 0x06000F54 RID: 3924 RVA: 0x00129058 File Offset: 0x00127258
public void SetSpell(GameObject go)
{
this.selectedSpell = go.name;
this.selected.transform.SetParent(go.transform, false);
this.selected.transform.SetAsLastSibling();
this.selected.SetActive(true);
this.selected.GetComponent<RectTransform>().anchoredPosition3D = new Vector3(0f, 0f, 0f);
this.paganRow = Links.x.library.GetPaganRow(this.selectedSpell);
this.spellcraftingMenu.fromEnchantMenu = true;
this.spellcraftingMenu.enchant = this;
this.spellcraftingMenu.selectedPagan = this.paganRow;
this.spellcraftingMenu.characterSkill = 0f;
this.spellcraftingMenu.SelectLearningButton(-1);
this.slider1Obj.SetActive(true);
this.SetDesc();
Links.x.characterSheet.PlayRandomClick();
this.spellCost = this.SpellCost();
if (this.spellcraftingMenu.selectedPagan._Slider2 != "")
{
this.slider2Obj.SetActive(true);
}
else
{
this.slider2Obj.SetActive(false);
}
if (this.spellcraftingMenu.selectedPagan._Slider3 != "")
{
this.slider3Obj.SetActive(true);
}
else
{
this.slider3Obj.SetActive(false);
}
if (Links.x.joy)
{
Links.x.gameplay.SetInteractableSelected(EventSystem.current, this.slider1.gameObject);
this.confirmButton.gameObject.GetComponent<UITriggerButton>().selectNext = this.usedSpells[0];
}
}
// Token: 0x06000F55 RID: 3925 RVA: 0x0012920D File Offset: 0x0012740D
public void UpdateVariables()
{
this.spellcraftingMenu.UpdateVariablesFromEnchantMenu();
this.SetDesc();
if (this.open)
{
Links.x.characterSheet.PlayRandomClick();
}
this.spellCost = this.SpellCost();
}
// Token: 0x06000F56 RID: 3926 RVA: 0x00129244 File Offset: 0x00127444
private void SetDesc()
{
this.str.Clear();
this.str.Append("<font=BoldOutline><size=1.6em>");
this.str.Append(this.paganRow._DisplayName);
this.str.Append("</font></size>\n");
this.str.Append(this.spellcraftingMenu.SetDescription());
float num = this.Difficulty();
float num2 = this.character.stats.EnchantWearingAbility();
if (num2 < 0f)
{
num2 = 0f;
}
this.str.Append("\nDifficulty is ");
this.str.Append(this.Difficulty());
if (num2 >= num)
{
this.str.Append(" vs. <color=#CA8C1E>");
}
else
{
this.str.Append(" vs. <color=#F3482F>");
}
this.str.Append(this.character.stats.GetName());
this.str.Append("'s ");
this.str.Append(num2);
this.str.Append("</color>");
this.description.text = this.str.ToString();
}
// Token: 0x06000F57 RID: 3927 RVA: 0x00129380 File Offset: 0x00127580
private int SpellCost()
{
int num = this.spellcraftingMenu.selectedPagan._LearningCost;
if (this.slider1.interactable)
{
num += Mathf.RoundToInt((this.slider1.value - this.slider1.minValue) * Records.x.EnchantCostWeight(this.spellcraftingMenu.selectedPagan._Slider1));
}
if (this.slider2.interactable)
{
num += Mathf.RoundToInt((this.slider2.value - this.slider2.minValue) * Records.x.EnchantCostWeight(this.spellcraftingMenu.selectedPagan._Slider2));
}
if (this.slider3.interactable)
{
num += Mathf.RoundToInt((this.slider3.value - this.slider3.minValue) * Records.x.EnchantCostWeight(this.spellcraftingMenu.selectedPagan._Slider3));
}
this.cost.text = "Donation: " + num.ToString() + " emeralds";
if (num <= Links.x.inventory.emeralds)
{
if (this.isWeapon)
{
this.buttonText.text = "Bless Weapon";
}
else
{
this.buttonText.text = "Bless Jewelry";
}
}
else
{
this.buttonText.text = "Too few emeralds";
}
return num;
}
// Token: 0x06000F58 RID: 3928 RVA: 0x001294E3 File Offset: 0x001276E3
private float R1(float s)
{
return Mathf.Round(s * 10f) / 10f;
}
// Token: 0x06000F59 RID: 3929 RVA: 0x001294F8 File Offset: 0x001276F8
private float Difficulty()
{
float num = (float)this.spellcraftingMenu.selectedPagan._Difficulty;
if (this.slider1.interactable)
{
num += (this.slider1.value - this.slider1.minValue) * Records.x.EnchantCostWeight(this.spellcraftingMenu.selectedPagan._Slider1);
}
if (this.slider2.interactable)
{
num += (this.slider2.value - this.slider2.minValue) * Records.x.EnchantCostWeight(this.spellcraftingMenu.selectedPagan._Slider2);
}
if (this.slider3.interactable)
{
num += (this.slider3.value - this.slider3.minValue) * Records.x.EnchantCostWeight(this.spellcraftingMenu.selectedPagan._Slider3);
}
num /= 4f;
return Mathf.Round(num * 10f) / 10f;
}
// Token: 0x06000F5A RID: 3930 RVA: 0x001295F8 File Offset: 0x001277F8
public void Enchant()
{
if (this.spellCost <= Links.x.inventory.emeralds && (this.item || this.itemEquipped) && this.selectedSpell != "")
{
this.paganRow = Links.x.library.GetPaganRow(this.selectedSpell);
int number = this.paganRow._Number;
float num = this.slider1.value;
float num2 = this.slider2.value;
float num3 = this.slider3.value;
string text;
if (this.item)
{
this.item.socketA = new Vector3((float)number, num, num2);
this.item.socketB = new Vector3(num3, (float)this.spellCost, this.Difficulty());
this.item.SetDurabilityVisual();
text = this.item.invRow._DisplayName;
}
else
{
this.itemEquipped.socketA = new Vector3((float)number, num, num2);
this.itemEquipped.socketB = new Vector3(num3, (float)this.spellCost, this.Difficulty());
this.itemEquipped.SetDurabilityVisual();
text = this.itemEquipped.invRow._DisplayName;
}
this.str.Clear();
this.str.Append(Links.x.gameFeed.GetPartyColorText(this.character));
this.str.Append(this.character.stats.GetName());
this.str.Append("</color>");
this.str.Append(" blessed ");
this.str.Append(text);
this.str.Append(" with ");
this.str.Append(this.paganRow._DisplayName);
if (Records.x.showRulesetInfo)
{
this.str.Append(" <color #857C6C>... ");
this.str.Append(this.character.stats.IntercessionCalculation());
this.str.Append("</color>");
}
Links.x.gameFeed.AddFeed(this.str.ToString());
this.character.stats.AddSkillProgress(16, this.Difficulty(), null);
if (this.item)
{
Links.x.inventory.SetBagSockets(this.item);
}
else
{
Links.x.inventory.SetBagSocketsEquipped(this.itemEquipped);
}
if (Records.x.InCombat(false))
{
Links.x.inventory.AddCombatTime(Links.x.characterSheet.character, "ExtraLong");
}
int num4 = Random.Range(0, 3);
if (num4 == 0)
{
MasterAudio.PlaySoundAndForget("Feedback", Random.Range(0.5f, 0.6f), new float?(1f), 0f, "IntercessionA", null);
}
if (num4 == 1)
{
MasterAudio.PlaySoundAndForget("Feedback", Random.Range(0.5f, 0.6f), new float?(1f), 0f, "IntercessionB", null);
}
if (num4 == 2)
{
MasterAudio.PlaySoundAndForget("Feedback", Random.Range(0.5f, 0.6f), new float?(1f), 0f, "IntercessionC", null);
}
Links.x.itemPickupFX.gameObject.SetActive(true);
Links.x.itemPickupFX.gameObject.GetComponent<HannahAnimator>().Play("Idle");
Links.x.itemPickupFX.position = this.itemImage.gameObject.transform.position;
Links.x.inventory.fx.gameObject.SetActive(true);
Links.x.inventory.fx.gameObject.GetComponent<HannahAnimator>().Play("Idle");
if (this.item)
{
Links.x.inventory.fx.gameObject.transform.position = this.item.gameObject.transform.position;
}
else
{
Links.x.inventory.fx.gameObject.transform.position = this.itemEquipped.gameObject.transform.position;
}
this.character.UpdateListsFromInv(true);
Links.x.inventory.emeralds -= this.spellCost;
Links.x.inventory.UpdateMisc();
if (this.itemEquipped && !this.isWeapon)
{
this.character.stats.EnchantJewelryEffects(Links.x.inventory.GetEquippedID(this.itemEquipped) * 2, true);
}
this.OpenMenu(this.character);
}
}
// Token: 0x06000F5B RID: 3931 RVA: 0x00129B1C File Offset: 0x00127D1C
private void SetInteractableState(bool state)
{
this.slider1.interactable = state;
this.slider2.interactable = state;
this.slider3.interactable = state;
this.tetherSlider.interactable = state;
this.slider1Image.enabled = state;
this.slider2Image.enabled = state;
this.slider3Image.enabled = state;
this.tetherImage.enabled = state;
this.slider1label.enabled = state;
this.slider2label.enabled = state;
this.slider3label.enabled = state;
this.slider1Min.enabled = state;
this.slider1Max.enabled = state;
this.slider2Min.enabled = state;
this.slider2Max.enabled = state;
this.slider3Min.enabled = state;
this.slider3Max.enabled = state;
this.tetherMin.enabled = state;
this.tetherMax.enabled = state;
this.tetherLabel.enabled = state;
if (!state)
{
this.description.text = "";
}
}
// Token: 0x04001913 RID: 6419
public bool open;
// Token: 0x04001914 RID: 6420
public Image itemImage;
// Token: 0x04001915 RID: 6421
public Item item;
// Token: 0x04001916 RID: 6422
public ItemEquipped itemEquipped;
// Token: 0x04001917 RID: 6423
public Character character;
// Token: 0x04001918 RID: 6424
public GameObject spellPrefab;
// Token: 0x04001919 RID: 6425
public GameObject camera3D;
// Token: 0x0400191A RID: 6426
public List<GameObject> openSpells = new List<GameObject>();
// Token: 0x0400191B RID: 6427
public List<GameObject> usedSpells = new List<GameObject>();
// Token: 0x0400191C RID: 6428
public TextMeshProUGUI noSpells;
// Token: 0x0400191D RID: 6429
public TextMeshProUGUI description;
// Token: 0x0400191E RID: 6430
public TextMeshProUGUI buttonText;
// Token: 0x0400191F RID: 6431
public ButtonMultiTargets confirmButton;
// Token: 0x04001920 RID: 6432
public Transform grid;
// Token: 0x04001921 RID: 6433
private Library.Pagan paganRow;
// Token: 0x04001922 RID: 6434
private string selectedSpell;
// Token: 0x04001923 RID: 6435
public string[] weaponBindingSpells;
// Token: 0x04001924 RID: 6436
public string[] jewelryBindingSpells;
// Token: 0x04001925 RID: 6437
public GameObject selected;
// Token: 0x04001926 RID: 6438
public GameObject slider1Obj;
// Token: 0x04001927 RID: 6439
public GameObject slider2Obj;
// Token: 0x04001928 RID: 6440
public GameObject slider3Obj;
// Token: 0x04001929 RID: 6441
private StringFast str = new StringFast(64);
// Token: 0x0400192A RID: 6442
public Slider slider1;
// Token: 0x0400192B RID: 6443
public Slider slider2;
// Token: 0x0400192C RID: 6444
public Slider slider3;
// Token: 0x0400192D RID: 6445
public Slider tetherSlider;
// Token: 0x0400192E RID: 6446
public TextMeshProUGUI slider1label;
// Token: 0x0400192F RID: 6447
public TextMeshProUGUI slider2label;
// Token: 0x04001930 RID: 6448
public TextMeshProUGUI slider3label;
// Token: 0x04001931 RID: 6449
public TextMeshProUGUI tetherLabel;
// Token: 0x04001932 RID: 6450
public TextMeshProUGUI tetherMin;
// Token: 0x04001933 RID: 6451
public TextMeshProUGUI tetherMax;
// Token: 0x04001934 RID: 6452
public TextMeshProUGUI slider1Min;
// Token: 0x04001935 RID: 6453
public TextMeshProUGUI slider1Max;
// Token: 0x04001936 RID: 6454
public TextMeshProUGUI slider2Min;
// Token: 0x04001937 RID: 6455
public TextMeshProUGUI slider2Max;
// Token: 0x04001938 RID: 6456
public TextMeshProUGUI slider3Min;
// Token: 0x04001939 RID: 6457
public TextMeshProUGUI slider3Max;
// Token: 0x0400193A RID: 6458
public TextMeshProUGUI cost;
// Token: 0x0400193B RID: 6459
public Image slider1Image;
// Token: 0x0400193C RID: 6460
public Image slider2Image;
// Token: 0x0400193D RID: 6461
public Image slider3Image;
// Token: 0x0400193E RID: 6462
public Image tetherImage;
// Token: 0x0400193F RID: 6463
private Spellcrafting spellcraftingMenu;
// Token: 0x04001940 RID: 6464
public int spellCost;
// Token: 0x04001941 RID: 6465
private bool isWeapon;
// Token: 0x04001942 RID: 6466
private Transform camTr;
// Token: 0x04001943 RID: 6467
private float lastSliderTime;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,360 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Pathfinding;
using UnityEngine;
// Token: 0x0200002B RID: 43
public class EnvironmentNodes : MonoBehaviour
{
// Token: 0x060006DD RID: 1757 RVA: 0x00093EE4 File Offset: 0x000920E4
private void Start()
{
this.tr = base.transform;
base.gameObject.layer = 1;
if (this.tr.childCount > 0)
{
this.tr.GetChild(0).gameObject.SetActive(false);
}
this.sphere = base.gameObject.AddComponent<SphereCollider>();
this.sphere.radius = (float)this.radius;
this.sphere.isTrigger = true;
base.gameObject.AddComponent<Rigidbody>().isKinematic = true;
if (this.tr.parent)
{
this.character = this.tr.parent.gameObject.GetComponent<Character>();
}
if (this.character)
{
this.isDynamic = true;
}
this.prevPosition = new Vector3(1000000f, 100000f, 0f);
this.count = Time.timeSinceLevelLoad;
this.lerpingPosition = this.tr.position;
this.thisObject = base.gameObject;
if (this.needsNodes)
{
this.StartFindNodes();
return;
}
if (this.isDynamic)
{
this.mainVisual = Links.x.cellar.GetPooledGameObject(64);
this.mainVisual.SetActive(true);
}
}
// Token: 0x060006DE RID: 1758 RVA: 0x0009402C File Offset: 0x0009222C
private void OnTriggerEnter(Collider other)
{
GameObject gameObject = other.gameObject;
if (gameObject && gameObject.layer == 1)
{
Character component = gameObject.GetComponent<Character>();
if (component && !component.ghostVanishing && component.ghost)
{
component.Flee(this.targetNode, false, Links.x.gameplay.seconds, 50f);
}
}
}
// Token: 0x060006DF RID: 1759 RVA: 0x00094094 File Offset: 0x00092294
public void Remove()
{
if (this.corout != null)
{
base.StopCoroutine(this.corout);
}
this.stop = true;
if (this.updating)
{
for (int i = 0; i < this.tempNodes.Count; i++)
{
if (this.tempNodes[i] != null)
{
this.tempNodes[i].environment = this.tempNodes[i].originalEnvironment;
}
}
}
for (int j = 0; j < this.pickedGroundNodes.Count; j++)
{
this.pickedGroundNodes[j].environment = this.pickedGroundNodes[j].originalEnvironment;
}
for (int k = 0; k < this.fx.Count; k++)
{
if (this.fx[k] && this.fx[k] != this.thisObject)
{
Links.x.cellar.ReturnPooledGameObject(64, this.fx[k]);
}
}
if (this.mainVisual)
{
this.mainVisual.transform.localScale = new Vector3(1f, 1f, 1f);
Links.x.cellar.ReturnPooledGameObject(64, this.mainVisual);
}
}
// Token: 0x060006E0 RID: 1760 RVA: 0x000941E9 File Offset: 0x000923E9
public void StartFindNodes()
{
this.corout = this.FindNodes();
base.StartCoroutine(this.corout);
}
// Token: 0x060006E1 RID: 1761 RVA: 0x00094204 File Offset: 0x00092404
private void Update()
{
float num = 5f;
this.lerpingPosition = Vector3.Lerp(this.lerpingPosition, this.tr.position, Time.deltaTime * num);
if (this.mainVisual)
{
this.mainVisual.transform.position = this.lerpingPosition + new Vector3(0f, 2f, 0f);
if (!this.mainVisual.activeSelf)
{
this.mainVisual.SetActive(true);
}
}
}
// Token: 0x060006E2 RID: 1762 RVA: 0x0009428F File Offset: 0x0009248F
private IEnumerator FindNodes()
{
if (!Links.x.gaia.sceneLoaded)
{
this.lerpingPosition = this.tr.position;
}
if ((this.lerpingPosition - this.prevPosition).sqrMagnitude > 0.010000001f || Time.timeSinceLevelLoad < this.count + 2f)
{
int visualCount = 0;
this.nodeConstraint.constrainWalkability = false;
this.nodeConstraint.walkable = true;
this.nodeConstraint.constrainTags = false;
this.nodeConstraint.checkCircleID = 0;
this.nodeConstraint.passID = 0;
this.nodeConstraint.passID2 = 0;
this.nodeConstraint.checkConnections = 0;
this.nodeConstraint.constrainPenalty = 0;
this.nodeConstraint.constrainToArea = -1;
this.nodeConstraint.constrainToEnvironment = -1;
if (Links.x.gaia.pathfindingReady && AstarPath.active != null)
{
this.targetNode = AstarPath.active.GetNearest(this.lerpingPosition, this.nodeConstraint).node;
this.updating = true;
if (this.isDynamic)
{
for (int i = 0; i < this.pickedGroundNodes.Count; i++)
{
this.tempNodes.Add(this.pickedGroundNodes[i]);
this.tempNodesContinue.Add(false);
}
}
this.pickedGroundNodes.Clear();
this.newNodes.Clear();
if (this.targetNode != null && Links.x.gaia.pathfindingReady)
{
this.count = Time.timeSinceLevelLoad;
float num = (float)this.radius;
ConstantPath constPath = null;
float max = (num * Records.x.nodeSize + 0.1f) * (num * Records.x.nodeSize + 0.1f);
constPath = ConstantPath.ConstructFast(this.targetNode, Records.x.GetConstantPathRadius(this.radius), null);
constPath.nnConstraint = this.nodeConstraint;
AstarPath.StartPath(constPath, false);
yield return base.StartCoroutine(constPath.WaitForPath());
constPath.Claim(this);
this.allNodes = constPath.allNodes;
int num2 = this.allNodes.Count;
int num3 = 0;
for (int j = 0; j < num2; j++)
{
if (((Vector3)this.allNodes[j].position - (Vector3)this.targetNode.position).sqrMagnitude < max && !this.stop)
{
GraphNode graphNode = this.allNodes[j];
int num4 = this.tempNodes.IndexOf(graphNode);
if (num4 > -1)
{
this.tempNodesContinue[num4] = true;
}
else
{
this.newNodes.Add(graphNode);
}
num3++;
}
}
constPath.Release(this, false);
Vector3 zero = Vector3.zero;
num2 = this.tempNodes.Count;
for (int k = 0; k < num2; k++)
{
if (this.tempNodesContinue[k])
{
if (this.tempNodes[k].originalEnvironment == 0)
{
this.tempNodes[k].environment = 1;
}
}
else if (!this.stop)
{
this.tempNodes[k].environment = this.tempNodes[k].originalEnvironment;
this.tempNodes[k] = null;
}
}
this.tempNodes.RemoveAll((GraphNode item) => item == null);
num2 = this.newNodes.Count;
for (int l = num2 - 1; l >= 0; l--)
{
if (!this.stop)
{
GraphNode graphNode = this.newNodes[l];
if (graphNode.originalEnvironment == 0 && graphNode.environment == 0)
{
graphNode.environment = 1;
}
if (visualCount == 0)
{
int num5 = visualCount;
visualCount = num5 + 1;
}
this.tempNodes.Add(graphNode);
}
}
num2 = this.tempNodes.Count;
bool flag = false;
for (int m = 0; m < num2; m++)
{
if (!this.stop)
{
GraphNode graphNode = this.tempNodes[m];
this.pickedGroundNodes.Add(graphNode);
if (graphNode.ID > 0 && !Records.x.pocketPause)
{
if (!flag)
{
this.gos = Links.x.diorama.characters;
flag = true;
}
int num6 = this.gos.Count;
for (int n = 0; n < num6; n++)
{
Character character = this.gos[n];
if (character && character.ghost && (character.nodeStationaryID == graphNode.ID || character.nodeMovingID == graphNode.ID) && !character.dead && !character.stunned && character.IsSentient())
{
character.SetRotation(Quaternion.LookRotation(this.character.tr.position - character.tr.position), false, true);
character.GhostFlee();
}
}
}
}
}
this.updating = false;
this.tempNodes.Clear();
this.tempNodesContinue.Clear();
this.prevPosition = this.lerpingPosition;
if (!this.mainVisual && this.isDynamic)
{
this.mainVisual = Links.x.cellar.GetPooledGameObject(64);
this.mainVisual.SetActive(true);
}
if (!this.isDynamic && this.pickedGroundNodes.Count > 0 && this.nonDynamicCount > 5)
{
this.corout = null;
}
this.nonDynamicCount++;
constPath = null;
}
}
}
this.corout = null;
if ((this.isDynamic || (!this.isDynamic && this.nonDynamicCount <= 5)) && !this.stop)
{
float max = Time.timeSinceLevelLoad;
while (Time.timeSinceLevelLoad < max + 0.01f)
{
yield return null;
}
this.StartFindNodes();
}
yield break;
}
// Token: 0x040009E8 RID: 2536
public bool isDynamic;
// Token: 0x040009E9 RID: 2537
public bool incense = true;
// Token: 0x040009EA RID: 2538
public int radius = 3;
// Token: 0x040009EB RID: 2539
public bool needsNodes = true;
// Token: 0x040009EC RID: 2540
private Character character;
// Token: 0x040009ED RID: 2541
public List<GraphNode> pickedGroundNodes = new List<GraphNode>();
// Token: 0x040009EE RID: 2542
private List<GraphNode> tempNodes = new List<GraphNode>();
// Token: 0x040009EF RID: 2543
private List<GraphNode> newNodes = new List<GraphNode>();
// Token: 0x040009F0 RID: 2544
private List<bool> tempNodesContinue = new List<bool>();
// Token: 0x040009F1 RID: 2545
private NNConstraint nodeConstraint = new NNConstraint();
// Token: 0x040009F2 RID: 2546
private List<GraphNode> allNodes;
// Token: 0x040009F3 RID: 2547
private Transform tr;
// Token: 0x040009F4 RID: 2548
private bool updating;
// Token: 0x040009F5 RID: 2549
private bool stop;
// Token: 0x040009F6 RID: 2550
private IEnumerator corout;
// Token: 0x040009F7 RID: 2551
private Vector3 prevPosition;
// Token: 0x040009F8 RID: 2552
private SphereCollider sphere;
// Token: 0x040009F9 RID: 2553
private float count;
// Token: 0x040009FA RID: 2554
private Vector3 lerpingPosition;
// Token: 0x040009FB RID: 2555
private GameObject thisObject;
// Token: 0x040009FC RID: 2556
private int nonDynamicCount;
// Token: 0x040009FD RID: 2557
private GraphNode targetNode;
// Token: 0x040009FE RID: 2558
public List<GameObject> fx = new List<GameObject>();
// Token: 0x040009FF RID: 2559
public List<float> fxScaleTarget = new List<float>();
// Token: 0x04000A00 RID: 2560
public List<Vector3> fxLerpTarget = new List<Vector3>();
// Token: 0x04000A01 RID: 2561
public GameObject mainVisual;
// Token: 0x04000A02 RID: 2562
private List<Character> gos;
}

View File

@@ -0,0 +1,15 @@
using System;
using UnityEngine;
// Token: 0x0200002C RID: 44
public class Equipment : MonoBehaviour
{
// Token: 0x04000A03 RID: 2563
public int id;
// Token: 0x04000A04 RID: 2564
public GameObject ammoObject;
// Token: 0x04000A05 RID: 2565
public string ammoObjectName;
}

View File

@@ -0,0 +1,122 @@
using System;
using UnityEngine;
// Token: 0x0200000B RID: 11
public class FOWRevealer : MonoBehaviour
{
// Token: 0x0600008F RID: 143 RVA: 0x0000CC1B File Offset: 0x0000AE1B
protected virtual void Start()
{
this.mTrans = base.transform;
this.mRevealer = FOWSystem.CreateRevealer();
}
// Token: 0x06000090 RID: 144 RVA: 0x0000CC34 File Offset: 0x0000AE34
protected virtual void OnDisable()
{
if (this.temporary && this.tempCount < 15)
{
return;
}
if (this.mRevealer != null)
{
this.mRevealer.isActive = false;
}
}
// Token: 0x06000091 RID: 145 RVA: 0x0000CC5D File Offset: 0x0000AE5D
protected virtual void OnDestroy()
{
if (this.mRevealer != null)
{
FOWSystem.DeleteRevealer(this.mRevealer);
this.mRevealer = null;
}
}
// Token: 0x06000092 RID: 146 RVA: 0x0000CC7C File Offset: 0x0000AE7C
protected virtual void LateUpdate()
{
if (this.isActive)
{
if (this.lineOfSightCheck != FOWSystem.LOSChecks.OnlyOnce)
{
this.mRevealer.isValid = false;
}
if (this.main || Records.x.mainMenuOpen)
{
if (!this.character)
{
this.character = base.gameObject.GetComponent<Character>();
}
if (this.character)
{
this.character.UpdateCC();
if (this.character.mainSelected)
{
this.range = new Vector2(0.1f, this.character.stats.SightRadius(false, false, true));
}
else
{
this.range = new Vector2(1f, 4f);
}
}
}
this.mRevealer.pos = this.mTrans.position + new Vector3(0f, 3f, 0f);
this.mRevealer.inner = this.range.x;
this.mRevealer.outer = this.range.y;
this.mRevealer.los = this.lineOfSightCheck;
this.mRevealer.isActive = true;
if (this.temporary && this.tempCount > 15)
{
base.gameObject.SetActive(false);
}
if (this.temporary)
{
this.tempCount++;
return;
}
}
else if (this.mRevealer.isActive)
{
this.mRevealer.isActive = false;
this.mRevealer.isValid = false;
}
}
// Token: 0x06000093 RID: 147 RVA: 0x0000CE0C File Offset: 0x0000B00C
public void Rebuild()
{
this.mRevealer.isValid = false;
}
// Token: 0x040001EA RID: 490
private Transform mTrans;
// Token: 0x040001EB RID: 491
public Character character;
// Token: 0x040001EC RID: 492
private string currentTimeOfDay;
// Token: 0x040001ED RID: 493
public bool main;
// Token: 0x040001EE RID: 494
public Vector2 range;
// Token: 0x040001EF RID: 495
public FOWSystem.LOSChecks lineOfSightCheck = FOWSystem.LOSChecks.EveryUpdate;
// Token: 0x040001F0 RID: 496
public bool isActive = true;
// Token: 0x040001F1 RID: 497
public bool temporary;
// Token: 0x040001F2 RID: 498
private int tempCount;
// Token: 0x040001F3 RID: 499
protected FOWSystem.Revealer mRevealer;
}

View File

@@ -0,0 +1,116 @@
using System;
using UnityEngine;
// Token: 0x0200000C RID: 12
public class FOWRevealerInterior : MonoBehaviour
{
// Token: 0x06000095 RID: 149 RVA: 0x0000CE30 File Offset: 0x0000B030
protected virtual void Start()
{
this.mTrans = base.transform;
if (this.once)
{
this.lineOfSightCheck = FOWSystemInterior.LOSChecks.OnlyOnce;
this.isActive = true;
}
this.mRevealer = FOWSystemInterior.CreateRevealer();
}
// Token: 0x06000096 RID: 150 RVA: 0x0000CE5F File Offset: 0x0000B05F
protected virtual void OnDisable()
{
if (this.mRevealer != null)
{
this.mRevealer.isActive = false;
}
}
// Token: 0x06000097 RID: 151 RVA: 0x0000CE75 File Offset: 0x0000B075
protected virtual void OnDestroy()
{
if (this.mRevealer != null)
{
FOWSystemInterior.DeleteRevealer(this.mRevealer);
this.mRevealer = null;
}
}
// Token: 0x06000098 RID: 152 RVA: 0x0000CE94 File Offset: 0x0000B094
protected virtual void LateUpdate()
{
if (this.isActive)
{
if (this.lineOfSightCheck != FOWSystemInterior.LOSChecks.OnlyOnce)
{
this.mRevealer.isValid = false;
}
if (this.main || Records.x.mainMenuOpen)
{
if (!this.character)
{
this.character = base.gameObject.GetComponent<Character>();
}
if (this.character.mainSelected)
{
this.character.UpdateCC();
if (this.character.stats.SightRadiusBase() < 0.5f)
{
this.range = new Vector2(0.1f, 50f);
}
else
{
this.range = new Vector2(0.1f, this.character.stats.SightRadius(false, false, true));
}
}
else
{
this.range = new Vector2(1f, 4f);
}
}
this.mRevealer.pos = this.mTrans.position + new Vector3(0f, 3f, 0f);
this.mRevealer.inner = this.range.x;
this.mRevealer.outer = this.range.y;
this.mRevealer.los = this.lineOfSightCheck;
this.mRevealer.isActive = true;
return;
}
if (this.mRevealer.isActive)
{
this.mRevealer.isActive = false;
this.mRevealer.isValid = false;
}
}
// Token: 0x06000099 RID: 153 RVA: 0x0000D014 File Offset: 0x0000B214
public void Rebuild()
{
this.mRevealer.isValid = false;
}
// Token: 0x040001F4 RID: 500
private Transform mTrans;
// Token: 0x040001F5 RID: 501
public Vector2 range;
// Token: 0x040001F6 RID: 502
public Character character;
// Token: 0x040001F7 RID: 503
private string currentTimeOfDay;
// Token: 0x040001F8 RID: 504
public bool main;
// Token: 0x040001F9 RID: 505
public bool once;
// Token: 0x040001FA RID: 506
public FOWSystemInterior.LOSChecks lineOfSightCheck = FOWSystemInterior.LOSChecks.EveryUpdate;
// Token: 0x040001FB RID: 507
public bool isActive = true;
// Token: 0x040001FC RID: 508
protected FOWSystemInterior.Revealer mRevealer;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,63 @@
using System;
using TMPro;
using UnityEngine;
// Token: 0x020000A8 RID: 168
public class FPS : MonoBehaviour
{
// Token: 0x06000F8B RID: 3979 RVA: 0x0012CE7C File Offset: 0x0012B07C
private void Start()
{
if (Records.x.showFPS && (Records.x.editor || Records.x.secrets))
{
base.gameObject.SetActive(true);
}
else
{
base.gameObject.SetActive(false);
}
this.timeleft = this.updateInterval;
}
// Token: 0x06000F8C RID: 3980 RVA: 0x0012CED4 File Offset: 0x0012B0D4
private void Update()
{
if (!Records.x.dialogue)
{
this.timeleft -= Time.unscaledDeltaTime;
this.accum += 1f / Time.unscaledDeltaTime;
this.frames++;
if ((double)this.timeleft <= 0.0)
{
int num = Mathf.RoundToInt(this.accum / (float)this.frames);
this.label.text = num.ToString();
this.timeleft = this.updateInterval;
this.accum = 0f;
this.frames = 0;
return;
}
}
else
{
this.label.text = "";
}
}
// Token: 0x040019A1 RID: 6561
public float updateInterval = 0.1f;
// Token: 0x040019A2 RID: 6562
private float accum;
// Token: 0x040019A3 RID: 6563
private int frames;
// Token: 0x040019A4 RID: 6564
private float timeleft;
// Token: 0x040019A5 RID: 6565
private string format;
// Token: 0x040019A6 RID: 6566
public TextMeshProUGUI label;
}

View File

@@ -0,0 +1,297 @@
using System;
using System.Collections;
using System.Collections.Generic;
using DarkTonic.MasterAudio;
using Pathfinding;
using UnityEngine;
// Token: 0x0200002D RID: 45
public class Fauna : MonoBehaviour
{
// Token: 0x060006E5 RID: 1765 RVA: 0x00094328 File Offset: 0x00092528
public void GetVariables()
{
this.attacking = false;
this.moving = false;
this.t = 0f;
this.currentIndex = 0;
this.tr = base.transform;
this.anim = base.gameObject.GetComponent<Animator>();
this.seeker = base.gameObject.GetComponent<Seeker>();
this.seeker.pathCallback = new OnPathDelegate(this.PathFinished);
GameObject pooledGameObject = Links.x.cellar.GetPooledGameObject(84);
this.tr.parent = null;
pooledGameObject.SetActive(true);
this.startPosition = this.tr.position;
}
// Token: 0x060006E6 RID: 1766 RVA: 0x000943CE File Offset: 0x000925CE
public void Spawn()
{
this.anim.Play("Cast");
}
// Token: 0x060006E7 RID: 1767 RVA: 0x000943E0 File Offset: 0x000925E0
public void Collide()
{
if (!this.attacking && base.gameObject.activeSelf && base.gameObject.activeInHierarchy)
{
this.attacking = true;
base.StartCoroutine(this.Attacking());
}
}
// Token: 0x060006E8 RID: 1768 RVA: 0x00094418 File Offset: 0x00092618
private IEnumerator Attacking()
{
this.moving = false;
this.anim.Play("Combat_basic_attack");
MasterAudio.PlaySound3DAtVector3AndForget("Squish", this.tr.position, 1f, new float?(1f), 0f, "", null);
yield return new WaitForSeconds(0.5f);
this.Remove();
base.gameObject.SetActive(false);
yield break;
}
// Token: 0x060006E9 RID: 1769 RVA: 0x00094428 File Offset: 0x00092628
public void Remove()
{
if (!this.fx)
{
this.fx = Links.x.cellar.GetPooledGameObject(21);
if (this.fx)
{
this.fx.transform.position = base.gameObject.transform.position;
this.fx.SetActive(true);
}
}
}
// Token: 0x060006EA RID: 1770 RVA: 0x00094494 File Offset: 0x00092694
public void MakePath(GraphNode targetNode, int environment)
{
if (this.attacking)
{
return;
}
this.nodeConstraint.constrainWalkability = true;
this.nodeConstraint.walkable = true;
this.nodeConstraint.constrainTags = false;
this.nodeConstraint.checkCircleID = 0;
this.nodeConstraint.passID = 0;
this.nodeConstraint.passID2 = 0;
this.nodeConstraint.checkConnections = 0;
this.nodeConstraint.constrainPenalty = 0;
this.nodeConstraint.constrainToEnvironment = -1;
this.nodeConstraint.constrainToArea = -1;
if (targetNode != null && Links.x.gaia.sceneLoaded && Links.x.gaia.changingMapsComplete)
{
this.seeker.pathConstraint = this.nodeConstraint;
this.seeker.StartPath(this.node, targetNode, new OnPathDelegate(this.PathFinished));
}
}
// Token: 0x060006EB RID: 1771 RVA: 0x00094578 File Offset: 0x00092778
public void Stop()
{
this.moving = false;
this.anim.Play("Combat_Idle_loop");
if (!this.tileEffect)
{
this.Remove();
base.gameObject.SetActive(false);
return;
}
this.tileEffect.FaunaRepath(this);
}
// Token: 0x060006EC RID: 1772 RVA: 0x000945C8 File Offset: 0x000927C8
public void PathFinished(Path p)
{
p.Claim(this);
if (!p.error && !this.attacking)
{
this.nodes.Clear();
this.nodeVectors.Clear();
this.pathVectors = p.vectorPath;
this.pathNodes = p.path;
for (int i = 0; i < this.pathVectors.Count; i++)
{
this.nodeVectors.Add(this.pathVectors[i]);
this.nodes.Add(this.pathNodes[i]);
}
this.lastNode = this.pathNodes[this.pathNodes.Count - 1];
this.currentIndex = 0;
this.t = 0f;
this.startPosition = (Vector3)this.node.position;
if (this.currentIndex < this.nodes.Count && this.currentIndex > -1)
{
if (this.node == this.nodes[this.currentIndex] && this.currentIndex + 1 < this.nodes.Count)
{
this.currentIndex++;
}
this.targetPosition = this.nodeVectors[this.currentIndex];
this.node = this.nodes[this.currentIndex];
this.anim.Play("Combat_walk");
if (Records.x.banquetIsle)
{
this.anim.speed = 1.75f;
}
else if (this.type.Contains("Lizard"))
{
this.anim.speed = 2f;
}
else if (this.type.Contains("Roly"))
{
this.anim.speed = 1.75f;
}
else
{
this.anim.speed = 1.4f;
}
this.moving = true;
}
else
{
this.targetPosition = this.tr.position;
this.Stop();
this.moving = false;
}
p.Release(this, false);
if (!this.tileEffect)
{
this.Remove();
base.gameObject.SetActive(false);
return;
}
}
else
{
p.Release(this, false);
this.moving = false;
if (!this.tileEffect)
{
this.Remove();
base.gameObject.SetActive(false);
return;
}
this.tileEffect.FaunaRepath(this);
}
}
// Token: 0x060006ED RID: 1773 RVA: 0x00094848 File Offset: 0x00092A48
private void OnAnimatorMove()
{
if (this.targetPosition != Vector3.zero && this.startPosition != Vector3.zero && !Records.x.pocketPause && this.moving)
{
if ((this.tr.position - this.targetPosition).sqrMagnitude < 0.09f || (this.tr.position - this.targetPosition).sqrMagnitude > Records.x.nodeSize * 2f * (Records.x.nodeSize * 2f))
{
if (this.currentIndex + 1 < this.nodes.Count && this.nodes.Count > 0)
{
if (this.tileEffect)
{
this.tileEffect.UpdateFaunaNode(this.node, this);
}
this.currentIndex++;
this.targetPosition = this.nodeVectors[this.currentIndex];
this.node = this.nodes[this.currentIndex];
this.t = 0f;
this.startPosition = this.tr.position;
}
else
{
if (!this.tileEffect)
{
this.Remove();
base.gameObject.SetActive(false);
return;
}
this.tileEffect.FaunaRepath(this);
return;
}
}
if (this.useRootMotion)
{
this.tr.rotation = Quaternion.Slerp(this.tr.rotation, Quaternion.LookRotation(this.targetPosition - this.tr.position), Time.deltaTime * 30f);
Vector3 rootPosition = this.anim.rootPosition;
rootPosition.y = Mathf.Lerp(this.tr.position.y, this.targetPosition.y, Time.deltaTime * 5f);
this.tr.position = rootPosition;
}
else
{
this.tr.rotation = Quaternion.Slerp(this.tr.rotation, Quaternion.LookRotation(this.targetPosition - this.tr.position), Time.deltaTime * 9f);
this.t += Time.deltaTime;
this.tr.position = Vector3.Lerp(this.startPosition, this.targetPosition, this.t * 3f);
}
}
if (Records.x.pocketPause)
{
this.anim.speed = 0f;
return;
}
this.anim.speed = 1f;
}
// Token: 0x04000A06 RID: 2566
public Transform tr;
// Token: 0x04000A07 RID: 2567
private Animator anim;
// Token: 0x04000A08 RID: 2568
private Vector3 moveFollow;
// Token: 0x04000A09 RID: 2569
private Seeker seeker;
// Token: 0x04000A0A RID: 2570
private NNConstraint nodeConstraint = new NNConstraint();
// Token: 0x04000A0B RID: 2571
public List<Vector3> nodeVectors = new List<Vector3>();
// Token: 0x04000A0C RID: 2572
public List<GraphNode> nodes = new List<GraphNode>();
// Token: 0x04000A0D RID: 2573
private List<Vector3> pathVectors;
// Token: 0x04000A0E RID: 2574
private List<GraphNode> pathNodes;
// Token: 0x04000A0F RID: 2575
private GraphNode lastNode;
// Token: 0x04000A10 RID: 2576
private Vector3 targetPosition;
// Token: 0x04000A11 RID: 2577
private Vector3 startPosition;
// Token: 0x04000A12 RID: 2578
private float t;
// Token: 0x04000A13 RID: 2579
private int currentIndex;
// Token: 0x04000A14 RID: 2580
public GraphNode node;
// Token: 0x04000A15 RID: 2581
public bool useRootMotion;
// Token: 0x04000A16 RID: 2582
public TileEffects tileEffect;
// Token: 0x04000A17 RID: 2583
public bool moving;
// Token: 0x04000A18 RID: 2584
public bool attacking;
// Token: 0x04000A19 RID: 2585
private GameObject fx;
// Token: 0x04000A1A RID: 2586
public string type;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,164 @@
using System;
using UnityEngine;
// Token: 0x0200002F RID: 47
public class Flag : MonoBehaviour
{
// Token: 0x06000747 RID: 1863 RVA: 0x0009B0F8 File Offset: 0x000992F8
private void Start()
{
this.tr = base.transform;
this.anim = base.gameObject.GetComponent<Animator>();
if (this.anim && this.randomize && this.anim && base.gameObject.activeSelf)
{
this.anim.Play(this.anim.GetCurrentAnimatorStateInfo(0).shortNameHash, 0, Random.Range(0f, 1f));
}
}
// Token: 0x06000748 RID: 1864 RVA: 0x0009B180 File Offset: 0x00099380
public void OnParticleSystemStopped()
{
base.gameObject.transform.SetParent(Links.x.cellar.tr);
base.gameObject.SetActive(false);
}
// Token: 0x06000749 RID: 1865 RVA: 0x0009B1AD File Offset: 0x000993AD
public void VineJump()
{
base.gameObject.transform.Rotate(new Vector3(0f, Random.Range(0f, 180f), 0f));
}
// Token: 0x0600074A RID: 1866 RVA: 0x0009B1DD File Offset: 0x000993DD
public void AnimationDone()
{
this.anim.enabled = false;
}
// Token: 0x0600074B RID: 1867 RVA: 0x0009B1EB File Offset: 0x000993EB
public void ReturnAnimatedText()
{
Links.x.cellar.ReturnanimatedText(base.gameObject.GetComponent<Animator>());
}
// Token: 0x0600074C RID: 1868 RVA: 0x0009B207 File Offset: 0x00099407
public void TurnOffObject()
{
base.gameObject.SetActive(false);
}
// Token: 0x0600074D RID: 1869 RVA: 0x0009B215 File Offset: 0x00099415
public void FXDone()
{
Links.x.cellar.ReturnPooledGameObject(this.id, base.gameObject);
}
// Token: 0x0600074E RID: 1870 RVA: 0x0009B232 File Offset: 0x00099432
public void CloseBoroHover()
{
Links.x.hudControl.BoroHoverCardOff();
}
// Token: 0x0600074F RID: 1871 RVA: 0x0009B243 File Offset: 0x00099443
public void ReturnToPool()
{
this.tr.SetParent(Links.x.cellar.tr, true);
this.tr.gameObject.SetActive(false);
}
// Token: 0x06000750 RID: 1872 RVA: 0x0009B271 File Offset: 0x00099471
public void CircleOff()
{
Links.x.gameplay.TurnOffSelectionCircle();
}
// Token: 0x06000751 RID: 1873 RVA: 0x0009B282 File Offset: 0x00099482
public void Popup1()
{
Debug.Log("pop up 1 " + this.id.ToString());
if (this.id == 0)
{
Links.x.dialogue.SongCompleteUIPart2();
}
}
// Token: 0x06000752 RID: 1874 RVA: 0x0009B2B5 File Offset: 0x000994B5
public void Popup2()
{
Debug.Log("pop up 2");
if (this.id == 0)
{
base.gameObject.SetActive(false);
}
}
// Token: 0x06000753 RID: 1875 RVA: 0x0009B2D5 File Offset: 0x000994D5
public void TransitionReady()
{
Links.x.cameraEffects.FinishTransition(true);
}
// Token: 0x06000754 RID: 1876 RVA: 0x0009B2E7 File Offset: 0x000994E7
public void TransitionDone()
{
Links.x.cameraEffects.FinishFade();
}
// Token: 0x06000755 RID: 1877 RVA: 0x0009B2F8 File Offset: 0x000994F8
public void AnimCanvasAlphaOn()
{
if (!this.canvGroup)
{
this.canvGroup = base.gameObject.GetComponent<CanvasGroup>();
}
this.AnimationDone();
this.canvGroup.alpha = 1f;
}
// Token: 0x06000756 RID: 1878 RVA: 0x0009B32E File Offset: 0x0009952E
public void AnimCanvasAlphaOff()
{
if (!this.canvGroup)
{
this.canvGroup = base.gameObject.GetComponent<CanvasGroup>();
}
this.AnimationDone();
this.canvGroup.alpha = 0f;
}
// Token: 0x06000757 RID: 1879 RVA: 0x0009B364 File Offset: 0x00099564
public void attack()
{
}
// Token: 0x06000758 RID: 1880 RVA: 0x0009B366 File Offset: 0x00099566
public void step()
{
}
// Token: 0x06000759 RID: 1881 RVA: 0x0009B368 File Offset: 0x00099568
public void TurnOffAnimator()
{
Links.x.cameraEffects.cameraAnimator.enabled = false;
}
// Token: 0x04000A82 RID: 2690
public string sound;
// Token: 0x04000A83 RID: 2691
private Transform tr;
// Token: 0x04000A84 RID: 2692
private Animator anim;
// Token: 0x04000A85 RID: 2693
private CanvasGroup canvGroup;
// Token: 0x04000A86 RID: 2694
public int id;
// Token: 0x04000A87 RID: 2695
public bool randomize;
// Token: 0x04000A88 RID: 2696
public Character character;
}

View File

@@ -0,0 +1,27 @@
using System;
using UnityEngine;
// Token: 0x020000A5 RID: 165
public static class FloatExtensions
{
// Token: 0x06000F5D RID: 3933 RVA: 0x00129C58 File Offset: 0x00127E58
public static float ToNearestMultiple(this float f, float multiple, int roundingType)
{
f = (float)Mathf.CeilToInt(f * 100f);
multiple = (float)Mathf.CeilToInt(multiple * 100f);
f /= multiple;
f = ((roundingType == 0) ? Mathf.Ceil(f) : ((roundingType == 1) ? Mathf.Floor(f) : Mathf.Round(f))) * multiple;
return f / 100f;
}
// Token: 0x0200021B RID: 539
public enum ROUNDING
{
// Token: 0x0400334F RID: 13135
UP,
// Token: 0x04003350 RID: 13136
DOWN,
// Token: 0x04003351 RID: 13137
CLOSEST
}
}

View File

@@ -0,0 +1,840 @@
using System;
using UnityEngine;
// Token: 0x020000F4 RID: 244
public class FlockChild : MonoBehaviour
{
// Token: 0x0600155D RID: 5469 RVA: 0x001986D8 File Offset: 0x001968D8
public void Start()
{
this.FindRequiredComponents();
if (this._spawner == null)
{
base.enabled = false;
return;
}
this.Wander();
base.InvokeRepeating("FindWaypoint", 0f, 20f);
this.SetRandomScale();
this.FindWaypoint();
this._thisT.position = this._wayPoint;
this.RandomizeStartAnimationFrame();
this.InitAvoidanceValues();
this._speed = this._spawner._minSpeed;
this._spawner._activeChildren += 1f;
this._instantiated = true;
if (this._spawner._skipFrame)
{
FlockChild._updateNextSeed++;
this._updateSeed = FlockChild._updateNextSeed;
FlockChild._updateNextSeed %= 1;
}
}
// Token: 0x0600155E RID: 5470 RVA: 0x001987A4 File Offset: 0x001969A4
public void BirdUpdate()
{
if (this == null || !this._instantiated)
{
return;
}
if (!this._spawner._skipFrame || this._spawner._updateCounter == this._updateSeed)
{
if (this._spawner.LimitPitchRotation || this._landing)
{
this.LimitRotationOfModel();
}
if (!this._landing)
{
this.SoarTimeLimit();
this.CheckForDistanceToWaypoint();
this.RotationBasedOnWaypointOrAvoidance();
this.Move();
}
else if (!this._move)
{
this.RotateBird();
if (!this._bakedAnimator)
{
return;
}
if (this._bakedAnimator.isActiveAndEnabled)
{
this._bakedAnimator.AnimateUpdate();
}
return;
}
else
{
if (this.distance > 5f)
{
this._wayPoint = this.GetLandingSpotPosition() + this._landingSpot._preLandWaypoint;
}
else
{
this._wayPoint = this.AddVectors(this.AddVectors(this._landingSpot.landingPoint, this._landingPosOffset), this._landingOffsetFix * this._thisT.localScale.y);
}
this._damping = this._landingSpot._controller._landingTurnSpeedModifier;
this.RotationBasedOnWaypointOrAvoidance();
this.Move();
this.Landing();
}
}
if (!this._bakedAnimator)
{
return;
}
if (this._bakedAnimator.isActiveAndEnabled)
{
this._bakedAnimator.AnimateUpdate();
}
}
// Token: 0x0600155F RID: 5471 RVA: 0x00198914 File Offset: 0x00196B14
private void Landing()
{
if (this.currentAnim == 2)
{
return;
}
Vector3 position = this._thisT.position;
Vector3 landingSpotPosition = this.GetLandingSpotPosition();
this.distance = this.SubtractVectors(position, landingSpotPosition).sqrMagnitude;
if (!this._landingSpot._controller._soarLand && this.currentAnim != 0)
{
if (!this._animationIsBaked)
{
if (!this._animator)
{
this._modelAnimation.CrossFade(this._spawner._flapAnimation, 0.5f);
}
else
{
this._animator.CrossFade(this._spawner._flapAnimation, 0.5f);
}
}
else
{
this._bakedAnimator.SetAnimation(0, -1);
this._bakedAnimator.SetSpeedMultiplier(this._spawner._maxAnimationSpeed);
}
this.currentAnim = 0;
}
if (this.distance < 64f && this.distance >= 1f)
{
if (this._landingSpot._controller._soarLand)
{
if (this.distance < 16f)
{
if (this.currentAnim != 0)
{
if (!this._animationIsBaked)
{
if (!this._animator)
{
this._modelAnimation.CrossFade(this._spawner._flapAnimation, 0.5f);
}
else
{
this._animator.CrossFade(this._spawner._flapAnimation, 0.5f);
}
}
else
{
this._bakedAnimator.SetAnimation(0, -1);
this._bakedAnimator.SetSpeedMultiplier(this._spawner._maxAnimationSpeed);
}
this.currentAnim = 0;
}
}
else if (this.currentAnim != 1)
{
if (!this._animationIsBaked)
{
if (!this._animator)
{
this._modelAnimation.CrossFade(this._spawner._soarAnimation, 0.5f);
}
else
{
this._animator.CrossFade(this._spawner._soarAnimation, 0.5f);
}
}
else
{
this._bakedAnimator.SetAnimation(1);
this._bakedAnimator.SetSpeedMultiplier(this._spawner._minAnimationSpeed);
}
this.currentAnim = 1;
}
}
this._targetSpeed = this._spawner._maxSpeed * this._landingSpot._controller._landingSpeedModifier;
return;
}
if (this.distance < 1f)
{
float num = this._spawner._newDelta * this._landingSpot._controller._closeToSpotSpeedModifier * this._targetSpeed;
this._thisT.position += this.SubtractVectors(landingSpotPosition, position).normalized * num;
this._closeToSpot = true;
if (this.distance < this._landingSpot._controller._snapLandDistance * this._landingSpot._controller._snapLandDistance)
{
if (this.currentAnim != 2)
{
base.Invoke("Idle", Random.Range(0.1f, 0.75f));
this.currentAnim = 2;
}
this._move = false;
this._thisT.position = landingSpotPosition;
this._modelT.localRotation = Quaternion.identity;
this._thisT.eulerAngles = new Vector3(0f, this._thisT.rotation.eulerAngles.y, 0f);
this._damping = 0.75f;
return;
}
this._speed = this._spawner._minSpeed * 0.2f;
}
}
// Token: 0x06001560 RID: 5472 RVA: 0x00198C94 File Offset: 0x00196E94
public Vector3 SubtractVectors(Vector3 a, Vector3 b)
{
Vector3 vector;
vector.x = a.x - b.x;
vector.y = a.y - b.y;
vector.z = a.z - b.z;
return vector;
}
// Token: 0x06001561 RID: 5473 RVA: 0x00198CE0 File Offset: 0x00196EE0
public Vector3 AddVectors(Vector3 a, Vector3 b)
{
Vector3 vector;
vector.x = a.x + b.x;
vector.y = a.y + b.y;
vector.z = a.z + b.z;
return vector;
}
// Token: 0x06001562 RID: 5474 RVA: 0x00198D2C File Offset: 0x00196F2C
private void Idle()
{
if (this._animationIsBaked)
{
this._bakedAnimator.SetAnimation(2, -1);
return;
}
if (!this._animator)
{
this._modelAnimation.CrossFade(this._spawner._idleAnimation, 0.5f);
return;
}
this._animator.CrossFade(this._spawner._idleAnimation, 0.5f);
}
// Token: 0x06001563 RID: 5475 RVA: 0x00198D93 File Offset: 0x00196F93
public Vector3 GetLandingSpotPosition()
{
return this.AddVectors(this.AddVectors(this._landingSpot.landingPoint, this._landingPosOffset), this._landingOffsetFix * this._thisT.localScale.y);
}
// Token: 0x06001564 RID: 5476 RVA: 0x00198DD0 File Offset: 0x00196FD0
public void RotateBird()
{
if (!this._landingSpot._controller._rotateAfterLanding)
{
return;
}
if (this._thisT.rotation != this._landingSpot.landingRot)
{
this._thisT.rotation = this._landingSpot.landingRot;
return;
}
}
// Token: 0x06001565 RID: 5477 RVA: 0x00198E24 File Offset: 0x00197024
public void OnDisable()
{
base.CancelInvoke();
if (this._spawner)
{
this._spawner._activeChildren -= 1f;
}
}
// Token: 0x06001566 RID: 5478 RVA: 0x00198E50 File Offset: 0x00197050
public void OnEnable()
{
if (this._instantiated)
{
this._spawner._activeChildren += 1f;
if (this._animationIsBaked)
{
if (this._landing)
{
this._bakedAnimator.SetAnimation(2);
return;
}
this._bakedAnimator.SetAnimation(0);
return;
}
else
{
if (this._landing)
{
this._modelAnimation.Play(this._spawner._idleAnimation);
return;
}
this._modelAnimation.Play(this._spawner._flapAnimation);
}
}
}
// Token: 0x06001567 RID: 5479 RVA: 0x00198EE0 File Offset: 0x001970E0
public void FindRequiredComponents()
{
if (this._thisT == null)
{
this._thisT = base.transform;
}
if (this._model == null)
{
this._model = this._thisT.Find("Model").gameObject;
}
if (this._bakedAnimator == null)
{
this._bakedAnimator = base.GetComponent<BakedMeshAnimator>();
}
if (this._bakedAnimator == null)
{
this._bakedAnimator = this._model.GetComponent<BakedMeshAnimator>();
}
if (this._modelT == null)
{
this._modelT = this._model.transform;
}
this._modelAnimation = this._model.GetComponent<Animation>();
if (!this._modelAnimation)
{
this._animator = this._model.GetComponent<Animator>();
}
if (!this._modelAnimation && !this._animator)
{
this._animationIsBaked = true;
return;
}
this._animationIsBaked = false;
}
// Token: 0x06001568 RID: 5480 RVA: 0x00198FE0 File Offset: 0x001971E0
public void RandomizeStartAnimationFrame()
{
if (this._animationIsBaked || this._animator)
{
return;
}
foreach (object obj in this._modelAnimation)
{
AnimationState animationState = (AnimationState)obj;
animationState.time = Random.value * animationState.length;
}
}
// Token: 0x06001569 RID: 5481 RVA: 0x0019905C File Offset: 0x0019725C
public void InitAvoidanceValues()
{
this._avoidValue = Random.Range(0.3f, 0.1f);
if (this._spawner._birdAvoidDistanceMax != this._spawner._birdAvoidDistanceMin)
{
this._avoidDistance = Random.Range(this._spawner._birdAvoidDistanceMax, this._spawner._birdAvoidDistanceMin);
return;
}
this._avoidDistance = this._spawner._birdAvoidDistanceMin;
}
// Token: 0x0600156A RID: 5482 RVA: 0x001990CC File Offset: 0x001972CC
public void SetRandomScale()
{
float num = Random.Range(this._spawner._minScale, this._spawner._maxScale);
this._thisT.localScale = new Vector3(num, num, num);
}
// Token: 0x0600156B RID: 5483 RVA: 0x00199108 File Offset: 0x00197308
public void SoarTimeLimit()
{
if (this._soar && this._spawner._soarMaxTime > 0f)
{
if (this._soarTimer > this._spawner._soarMaxTime)
{
this.Flap(0.5f);
this._soarTimer = 0f;
return;
}
this._soarTimer += this._spawner._newDelta;
}
}
// Token: 0x0600156C RID: 5484 RVA: 0x00199174 File Offset: 0x00197374
public void CheckForDistanceToWaypoint()
{
if (!this._landing && (this._thisT.position - this._wayPoint).magnitude < this._spawner._waypointDistance)
{
this.Wander();
}
}
// Token: 0x0600156D RID: 5485 RVA: 0x001991BC File Offset: 0x001973BC
public void RotationBasedOnWaypointOrAvoidance()
{
if (this._avoiding)
{
return;
}
Vector3 position = this._thisT.position;
Vector3 vector = this.SubtractVectors(this._wayPoint, position);
if (this._targetSpeed > -1f && vector.x != 0f && vector.z != 0f)
{
Quaternion quaternion = Quaternion.LookRotation(vector);
this._thisT.rotation = Quaternion.Slerp(this._thisT.rotation, quaternion, this._spawner._newDelta * this._damping);
}
if (this._spawner._childTriggerPos && this.SubtractVectors(position, this._spawner._posBuffer).magnitude < 1f)
{
this._spawner.SetFlockRandomPosition();
}
}
// Token: 0x0600156E RID: 5486 RVA: 0x00199284 File Offset: 0x00197484
private void Move()
{
if (this._move)
{
this.ChangeSpeed();
if (!this._closeToSpot)
{
this._thisT.position += this._thisT.forward * this._speed * this._spawner._newDelta;
}
if (this.SubtractVectors(this._thisT.position, Links.x.rtsCamera.cameraTargetPosition).sqrMagnitude < 2500f && this.Avoidance() && !this._avoiding)
{
this._avoiding = true;
base.Invoke("AvoidNoLonger", Random.Range(0.25f, 0.5f));
}
}
}
// Token: 0x0600156F RID: 5487 RVA: 0x00199346 File Offset: 0x00197546
private void AvoidNoLonger()
{
this._avoiding = false;
}
// Token: 0x06001570 RID: 5488 RVA: 0x00199350 File Offset: 0x00197550
private void ChangeSpeed()
{
if (this._speed < this._targetSpeed)
{
this._speed += this._acceleration * this._spawner._newDelta;
return;
}
if (this._speed > this._targetSpeed)
{
this._speed -= this._acceleration * this._spawner._newDelta;
}
}
// Token: 0x06001571 RID: 5489 RVA: 0x001993B8 File Offset: 0x001975B8
public bool Avoidance()
{
if (!this._avoid || !this._spawner._birdAvoid)
{
return false;
}
Vector3 forward = this._modelT.forward;
bool flag = false;
Vector3 position = this._thisT.position;
Quaternion rotation = this._thisT.rotation;
Vector3 eulerAngles = this._thisT.rotation.eulerAngles;
if (Physics.Raycast(this._thisT.position, forward + this._modelT.right * this._avoidValue, this._avoidDistance, 1))
{
if (this._landing)
{
this._damping = this._spawner._minDamping;
}
eulerAngles.y -= (float)this._spawner._birdAvoidHorizontalForce * this._spawner._newDelta * this._damping;
rotation.eulerAngles = eulerAngles;
this._thisT.rotation = rotation;
return true;
}
if (Physics.Raycast(this._thisT.position, forward + this._modelT.right * -this._avoidValue, this._avoidDistance, 1))
{
if (this._landing)
{
this._damping = this._spawner._minDamping;
}
eulerAngles.y += (float)this._spawner._birdAvoidHorizontalForce * this._spawner._newDelta * this._damping;
rotation.eulerAngles = eulerAngles;
this._thisT.rotation = rotation;
return true;
}
if (this._spawner._birdAvoidDown && this._spawner._birdAvoidDown && !this._landing && Physics.Raycast(this._thisT.position, -Vector3.up, this._avoidDistance, 1))
{
eulerAngles.x -= (float)this._spawner._birdAvoidVerticalForce * this._spawner._newDelta * this._damping;
rotation.eulerAngles = eulerAngles;
this._thisT.rotation = rotation;
position.y += (float)this._spawner._birdAvoidVerticalForce * this._spawner._newDelta * 0.01f;
this._thisT.position = position;
flag = true;
}
if (this._spawner._birdAvoidUp && this._spawner._birdAvoidUp && !this._landing && Physics.Raycast(this._thisT.position, Vector3.up, this._avoidDistance, 1))
{
eulerAngles.x += (float)this._spawner._birdAvoidVerticalForce * this._spawner._newDelta * this._damping;
rotation.eulerAngles = eulerAngles;
this._thisT.rotation = rotation;
position.y -= (float)this._spawner._birdAvoidVerticalForce * this._spawner._newDelta * 0.01f;
this._thisT.position = position;
flag = true;
}
return flag;
}
// Token: 0x06001572 RID: 5490 RVA: 0x001996BF File Offset: 0x001978BF
public void LimitRotationOfModel()
{
}
// Token: 0x06001573 RID: 5491 RVA: 0x001996C4 File Offset: 0x001978C4
public void Wander()
{
if (!this._landing)
{
this._damping = Random.Range(this._spawner._minDamping, this._spawner._maxDamping);
this._targetSpeed = Random.Range(this._spawner._minSpeed, this._spawner._maxSpeed);
if (this != null)
{
this.SetRandomMode();
}
}
}
// Token: 0x06001574 RID: 5492 RVA: 0x0019972C File Offset: 0x0019792C
public void Wander(float delay)
{
if (!this._landing)
{
this._damping = Random.Range(this._spawner._minDamping, this._spawner._maxDamping);
this._targetSpeed = Random.Range(this._spawner._minSpeed, this._spawner._maxSpeed);
if (this != null)
{
base.Invoke("SetRandomMode", delay);
}
}
}
// Token: 0x06001575 RID: 5493 RVA: 0x00199798 File Offset: 0x00197998
public void SetRandomMode()
{
base.CancelInvoke("SetRandomMode");
if (!this._dived && Random.value < this._spawner._soarFrequency)
{
this.Soar(0.75f);
return;
}
if (!this._dived && Random.value < this._spawner._diveFrequency)
{
this.Dive();
return;
}
this.Flap(0.5f);
}
// Token: 0x06001576 RID: 5494 RVA: 0x00199804 File Offset: 0x00197A04
public void Flap(float crossfadeSeconds = 0.5f)
{
this.AnimationSpeed();
this.FindWaypoint();
if (this.currentAnim == 0 || !this._move)
{
return;
}
if (!this._animationIsBaked)
{
if (!this._animator)
{
this._modelAnimation.CrossFade(this._spawner._flapAnimation, crossfadeSeconds);
}
else
{
this._animator.CrossFade(this._spawner._flapAnimation, crossfadeSeconds);
}
}
else
{
this.CachedAnimationHandler(0);
}
this._soar = false;
this._dived = false;
this.currentAnim = 0;
}
// Token: 0x06001577 RID: 5495 RVA: 0x00199894 File Offset: 0x00197A94
public void FindWaypoint()
{
Vector3 zero = Vector3.zero;
zero.x = Random.Range(-this._spawner._spawnSphere, this._spawner._spawnSphere) + this._spawner._posBuffer.x;
zero.z = Random.Range(-this._spawner._spawnSphereDepth, this._spawner._spawnSphereDepth) + this._spawner._posBuffer.z;
zero.y = Random.Range(-this._spawner._spawnSphereHeight, this._spawner._spawnSphereHeight) + this._spawner._posBuffer.y;
this._wayPoint = zero;
}
// Token: 0x06001578 RID: 5496 RVA: 0x0019994C File Offset: 0x00197B4C
public void Soar(float crossfadeSeconds = 0.75f)
{
this.FindWaypoint();
if (this.currentAnim == 1 || !this._move)
{
return;
}
if (!this._animationIsBaked)
{
if (!this._animator)
{
this._modelAnimation.CrossFade(this._spawner._soarAnimation, crossfadeSeconds);
}
else
{
this._animator.CrossFade(this._spawner._soarAnimation, crossfadeSeconds);
}
}
else
{
this.CachedAnimationHandler(1);
}
this._soar = true;
this.currentAnim = 1;
}
// Token: 0x06001579 RID: 5497 RVA: 0x001999D0 File Offset: 0x00197BD0
public void CachedAnimationHandler(int type)
{
if (!this._bakedAnimator)
{
return;
}
if (type == 0)
{
this._bakedAnimator.SetAnimation(0);
return;
}
if (type == 1)
{
this._bakedAnimator.SetAnimation(1);
return;
}
if (type == 2)
{
this._bakedAnimator.SetAnimation(2);
return;
}
}
// Token: 0x0600157A RID: 5498 RVA: 0x00199A20 File Offset: 0x00197C20
public void Dive()
{
if (!this._animationIsBaked)
{
if (!this._animator)
{
this._modelAnimation.CrossFade(this._spawner._soarAnimation, 0.2f);
}
else
{
this._animator.CrossFade(this._spawner._soarAnimation, 0.2f);
}
}
else
{
this.CachedAnimationHandler(1);
}
this.currentAnim = 1;
this._wayPoint = this._thisT.position;
this._wayPoint.y = this._wayPoint.y - this._spawner._diveValue;
this._dived = true;
}
// Token: 0x0600157B RID: 5499 RVA: 0x00199ABC File Offset: 0x00197CBC
public void AnimationSpeed()
{
if (!this._animationIsBaked)
{
if (!this._animator)
{
if (this.flapState == null)
{
this.flapState = this._modelAnimation[this._spawner._flapAnimation];
this.idleState = this._modelAnimation[this._spawner._idleAnimation];
this.soarState = this._modelAnimation[this._spawner._soarAnimation];
}
float num;
if (!this._dived && !this._landing)
{
num = Random.Range(this._spawner._minAnimationSpeed, this._spawner._maxAnimationSpeed);
}
else
{
num = this._spawner._maxAnimationSpeed;
}
if (this.currentAnim == 0)
{
this.flapState.speed = num;
return;
}
if (this.currentAnim == 1)
{
this.soarState.speed = num;
return;
}
if (this.currentAnim == 1)
{
this.idleState.speed = num;
return;
}
}
else
{
if (!this._dived && !this._landing)
{
this._animator.speed = Random.Range(this._spawner._minAnimationSpeed, this._spawner._maxAnimationSpeed);
return;
}
this._animator.speed = this._spawner._maxAnimationSpeed;
}
return;
}
if (!this._dived && !this._landing)
{
this._bakedAnimator.SetSpeedMultiplier(Random.Range(this._spawner._minAnimationSpeed, this._spawner._maxAnimationSpeed));
return;
}
this._bakedAnimator.SetSpeedMultiplier(this._spawner._maxAnimationSpeed);
}
// Token: 0x0400253E RID: 9534
[HideInInspector]
public FlockController _spawner;
// Token: 0x0400253F RID: 9535
[HideInInspector]
public Vector3 _wayPoint;
// Token: 0x04002540 RID: 9536
[HideInInspector]
public float _speed;
// Token: 0x04002541 RID: 9537
[HideInInspector]
public bool _dived = true;
// Token: 0x04002542 RID: 9538
[HideInInspector]
public float _damping;
// Token: 0x04002543 RID: 9539
[HideInInspector]
public bool _soar = true;
// Token: 0x04002544 RID: 9540
[HideInInspector]
public bool _landing;
// Token: 0x04002545 RID: 9541
[HideInInspector]
public bool _landed;
// Token: 0x04002546 RID: 9542
[HideInInspector]
public LandingSpot _landingSpot;
// Token: 0x04002547 RID: 9543
[HideInInspector]
public float _targetSpeed;
// Token: 0x04002548 RID: 9544
[HideInInspector]
public bool _move = true;
// Token: 0x04002549 RID: 9545
public GameObject _model;
// Token: 0x0400254A RID: 9546
public Transform _modelT;
// Token: 0x0400254B RID: 9547
[HideInInspector]
public float _avoidValue;
// Token: 0x0400254C RID: 9548
[HideInInspector]
public float _avoidDistance;
// Token: 0x0400254D RID: 9549
private float _soarTimer;
// Token: 0x0400254E RID: 9550
private bool _instantiated;
// Token: 0x0400254F RID: 9551
private static int _updateNextSeed;
// Token: 0x04002550 RID: 9552
private int _updateSeed = -1;
// Token: 0x04002551 RID: 9553
[HideInInspector]
public bool _avoid = true;
// Token: 0x04002552 RID: 9554
public Transform _thisT;
// Token: 0x04002553 RID: 9555
public Vector3 _landingPosOffset;
// Token: 0x04002554 RID: 9556
[HideInInspector]
public bool _animationIsBaked;
// Token: 0x04002555 RID: 9557
public BakedMeshAnimator _bakedAnimator;
// Token: 0x04002556 RID: 9558
[HideInInspector]
public Animation _modelAnimation;
// Token: 0x04002557 RID: 9559
public Animator _animator;
// Token: 0x04002558 RID: 9560
private float _acceleration = 20f;
// Token: 0x04002559 RID: 9561
[HideInInspector]
public int currentAnim;
// Token: 0x0400255A RID: 9562
[HideInInspector]
public bool _closeToSpot;
// Token: 0x0400255B RID: 9563
private float distance;
// Token: 0x0400255C RID: 9564
private bool _avoiding;
// Token: 0x0400255D RID: 9565
private AnimationState flapState;
// Token: 0x0400255E RID: 9566
private AnimationState soarState;
// Token: 0x0400255F RID: 9567
private AnimationState idleState;
// Token: 0x04002560 RID: 9568
public Vector3 _landingOffsetFix = new Vector3(0f, 0.1f, 0f);
}

View File

@@ -0,0 +1,91 @@
using System;
using UnityEngine;
// Token: 0x020000F5 RID: 245
[RequireComponent(typeof(AudioSource))]
public class FlockChildSound : MonoBehaviour
{
// Token: 0x0600157D RID: 5501 RVA: 0x00199CB8 File Offset: 0x00197EB8
public void Start()
{
this._flockChild = base.GetComponent<FlockChild>();
this._audio = base.GetComponent<AudioSource>();
base.InvokeRepeating("PlayRandomSound", Random.value + 1f, 1f);
if (this._scareSounds.Length != 0)
{
base.InvokeRepeating("ScareSound", 1f, 0.01f);
}
}
// Token: 0x0600157E RID: 5502 RVA: 0x00199D18 File Offset: 0x00197F18
public void PlayRandomSound()
{
if (base.gameObject.activeInHierarchy)
{
if (!this._audio.isPlaying && this._flightSounds.Length != 0 && this._flightSoundRandomChance > Random.value && !this._flockChild._landing)
{
this._audio.clip = this._flightSounds[Random.Range(0, this._flightSounds.Length)];
this._audio.pitch = Random.Range(this._pitchMin, this._pitchMax);
this._audio.volume = Random.Range(this._volumeMin, this._volumeMax);
this._audio.Play();
return;
}
if (!this._audio.isPlaying && this._idleSounds.Length != 0 && this._idleSoundRandomChance > Random.value && this._flockChild._landing)
{
this._audio.clip = this._idleSounds[Random.Range(0, this._idleSounds.Length)];
this._audio.pitch = Random.Range(this._pitchMin, this._pitchMax);
this._audio.volume = Random.Range(this._volumeMin, this._volumeMax);
this._audio.Play();
this._hasLanded = true;
}
}
}
// Token: 0x0600157F RID: 5503 RVA: 0x00199E6C File Offset: 0x0019806C
public void ScareSound()
{
if (base.gameObject.activeInHierarchy && this._hasLanded && !this._flockChild._landing && this._idleSoundRandomChance * 2f > Random.value)
{
this._audio.clip = this._scareSounds[Random.Range(0, this._scareSounds.Length)];
this._audio.volume = Random.Range(this._volumeMin, this._volumeMax);
this._audio.PlayDelayed(Random.value * 0.2f);
this._hasLanded = false;
}
}
// Token: 0x04002561 RID: 9569
public AudioClip[] _idleSounds;
// Token: 0x04002562 RID: 9570
public float _idleSoundRandomChance = 0.05f;
// Token: 0x04002563 RID: 9571
public AudioClip[] _flightSounds;
// Token: 0x04002564 RID: 9572
public float _flightSoundRandomChance = 0.05f;
// Token: 0x04002565 RID: 9573
public AudioClip[] _scareSounds;
// Token: 0x04002566 RID: 9574
public float _pitchMin = 0.85f;
// Token: 0x04002567 RID: 9575
public float _pitchMax = 1f;
// Token: 0x04002568 RID: 9576
public float _volumeMin = 0.6f;
// Token: 0x04002569 RID: 9577
public float _volumeMax = 0.8f;
// Token: 0x0400256A RID: 9578
private FlockChild _flockChild;
// Token: 0x0400256B RID: 9579
private AudioSource _audio;
// Token: 0x0400256C RID: 9580
private bool _hasLanded;
}

View File

@@ -0,0 +1,369 @@
using System;
using System.Collections.Generic;
using UnityEngine;
// Token: 0x020000F6 RID: 246
public class FlockController : MonoBehaviour
{
// Token: 0x06001581 RID: 5505 RVA: 0x00199F61 File Offset: 0x00198161
public void Start()
{
this._roamers.Clear();
this.LateStart();
}
// Token: 0x06001582 RID: 5506 RVA: 0x00199F74 File Offset: 0x00198174
public void LateStart()
{
if (!this._childPrefab)
{
Debug.LogWarning("Bird Flock does not have a bird prefab assigned, aborting.");
base.enabled = false;
return;
}
this._thisT = base.transform;
if (this._positionSphereDepth == -1f)
{
this._positionSphereDepth = this._positionSphere;
}
if (this._spawnSphereDepth == -1f)
{
this._spawnSphereDepth = this._spawnSphere;
}
this._posBuffer = this._thisT.position + this._startPosOffset;
if (!this._slowSpawn)
{
this.AddChild(this._childAmount);
this._childCountCache = this._roamers.Count;
}
if (this._randomPositionTimer > 0f)
{
base.InvokeRepeating("SetFlockRandomPosition", this._randomPositionTimer, this._randomPositionTimer);
}
}
// Token: 0x06001583 RID: 5507 RVA: 0x0019A044 File Offset: 0x00198244
public void AddChild(int amount)
{
if (this._groupChildToNewTransform)
{
this.InstantiateGroup();
}
for (int i = 0; i < amount; i++)
{
FlockChild flockChild = Object.Instantiate<FlockChild>(this._childPrefab);
flockChild._spawner = this;
if (flockChild)
{
flockChild.transform.parent = base.transform;
flockChild.transform.parent = null;
}
this._roamers.Add(flockChild);
this.AddChildToParent(flockChild.transform);
}
this._childCountCache += amount;
}
// Token: 0x06001584 RID: 5508 RVA: 0x0019A0C9 File Offset: 0x001982C9
public void AddChildToParent(Transform obj)
{
if (this._groupChildToFlock)
{
this._groupTransform = this._thisT;
}
obj.parent = this._groupTransform;
}
// Token: 0x06001585 RID: 5509 RVA: 0x0019A0EC File Offset: 0x001982EC
public void RemoveChild(int amount)
{
for (int i = 0; i < amount; i++)
{
Component component = this._roamers[this._roamers.Count - 1];
this._roamers.RemoveAt(this._roamers.Count - 1);
Object.Destroy(component.gameObject);
}
this._childCountCache -= amount;
}
// Token: 0x06001586 RID: 5510 RVA: 0x0019A150 File Offset: 0x00198350
public void Update()
{
if (this._activeChildren > 0f)
{
if (this._skipFrame)
{
this._updateCounter++;
this._updateCounter %= 2;
this._newDelta = Time.deltaTime * 2f % 0.5f;
}
else
{
this._newDelta = Time.deltaTime;
}
}
this.UpdateChildAmount();
for (int i = 0; i < this._roamers.Count; i++)
{
this._roamers[i].BirdUpdate();
}
}
// Token: 0x06001587 RID: 5511 RVA: 0x0019A1E0 File Offset: 0x001983E0
public void InstantiateGroup()
{
if (this._groupTransform != null)
{
return;
}
GameObject gameObject = new GameObject();
this._groupTransform = gameObject.transform;
this._groupTransform.position = this._thisT.position;
if (this._groupName != "")
{
gameObject.name = this._groupName;
return;
}
gameObject.name = this._thisT.name + " Bird Container";
}
// Token: 0x06001588 RID: 5512 RVA: 0x0019A25E File Offset: 0x0019845E
public void UpdateChildAmount()
{
if (this._childAmount >= 0 && this._childAmount < this._roamers.Count)
{
this.RemoveChild(1);
return;
}
if (this._childAmount > this._roamers.Count)
{
this.AddChild(1);
}
}
// Token: 0x06001589 RID: 5513 RVA: 0x0019A2A0 File Offset: 0x001984A0
public void OnDrawGizmos()
{
if (this._thisT == null)
{
this._thisT = base.transform;
}
if (!Application.isPlaying)
{
if (this._roamers.Count > 0)
{
this._roamers.Clear();
}
if (this._posBuffer != this._thisT.position + this._startPosOffset)
{
this._posBuffer = this._thisT.position + this._startPosOffset;
}
}
if (this._positionSphereDepth == -1f)
{
this._positionSphereDepth = this._positionSphere;
}
if (this._spawnSphereDepth == -1f)
{
this._spawnSphereDepth = this._spawnSphere;
}
Gizmos.color = Color.blue;
Gizmos.DrawWireCube(this._posBuffer, new Vector3(this._spawnSphere * 2f, this._spawnSphereHeight * 2f, this._spawnSphereDepth * 2f));
Gizmos.color = Color.cyan;
Gizmos.DrawWireCube(this._thisT.position, new Vector3(this._positionSphere * 2f + this._spawnSphere * 2f, this._positionSphereHeight * 2f + this._spawnSphereHeight * 2f, this._positionSphereDepth * 2f + this._spawnSphereDepth * 2f));
}
// Token: 0x0600158A RID: 5514 RVA: 0x0019A400 File Offset: 0x00198600
public void SetFlockRandomPosition()
{
Vector3 zero = Vector3.zero;
zero.x = Random.Range(-this._positionSphere, this._positionSphere) + this._thisT.position.x;
zero.z = Random.Range(-this._positionSphereDepth, this._positionSphereDepth) + this._thisT.position.z;
zero.y = Random.Range(-this._positionSphereHeight, this._positionSphereHeight) + this._thisT.position.y;
this._posBuffer = zero;
if (this._forceChildWaypoints)
{
for (int i = 0; i < this._roamers.Count; i++)
{
this._roamers[i].Wander(Random.value * this._forcedRandomDelay);
}
}
}
// Token: 0x0600158B RID: 5515 RVA: 0x0019A4D4 File Offset: 0x001986D4
public void destroyBirds()
{
for (int i = 0; i < this._roamers.Count; i++)
{
if (this._roamers[i] != null)
{
Object.Destroy(this._roamers[i].gameObject);
}
}
this._childCountCache = 0;
this._childAmount = 0;
this._roamers.Clear();
}
// Token: 0x0400256D RID: 9581
public FlockChild _childPrefab;
// Token: 0x0400256E RID: 9582
public int _childAmount = 250;
// Token: 0x0400256F RID: 9583
public bool _slowSpawn;
// Token: 0x04002570 RID: 9584
public float _spawnSphere = 3f;
// Token: 0x04002571 RID: 9585
public float _spawnSphereHeight = 3f;
// Token: 0x04002572 RID: 9586
public float _spawnSphereDepth = -1f;
// Token: 0x04002573 RID: 9587
public float _minSpeed = 6f;
// Token: 0x04002574 RID: 9588
public float _maxSpeed = 10f;
// Token: 0x04002575 RID: 9589
public float _minScale = 0.7f;
// Token: 0x04002576 RID: 9590
public float _maxScale = 1f;
// Token: 0x04002577 RID: 9591
public float _soarFrequency;
// Token: 0x04002578 RID: 9592
public string _soarAnimation = "Soar";
// Token: 0x04002579 RID: 9593
public string _flapAnimation = "Flap";
// Token: 0x0400257A RID: 9594
public string _idleAnimation = "Idle";
// Token: 0x0400257B RID: 9595
public float _diveValue = 7f;
// Token: 0x0400257C RID: 9596
public float _diveFrequency = 0.5f;
// Token: 0x0400257D RID: 9597
public float _minDamping = 1f;
// Token: 0x0400257E RID: 9598
public float _maxDamping = 2f;
// Token: 0x0400257F RID: 9599
public float _waypointDistance = 1f;
// Token: 0x04002580 RID: 9600
public float _minAnimationSpeed = 2f;
// Token: 0x04002581 RID: 9601
public float _maxAnimationSpeed = 4f;
// Token: 0x04002582 RID: 9602
public float _randomPositionTimer = 10f;
// Token: 0x04002583 RID: 9603
public float _positionSphere = 25f;
// Token: 0x04002584 RID: 9604
public float _positionSphereHeight = 25f;
// Token: 0x04002585 RID: 9605
public float _positionSphereDepth = -1f;
// Token: 0x04002586 RID: 9606
public bool _childTriggerPos;
// Token: 0x04002587 RID: 9607
public bool _forceChildWaypoints;
// Token: 0x04002588 RID: 9608
public float _forcedRandomDelay = 1.5f;
// Token: 0x04002589 RID: 9609
public bool _flatFly;
// Token: 0x0400258A RID: 9610
public bool _flatSoar;
// Token: 0x0400258B RID: 9611
public bool _birdAvoid;
// Token: 0x0400258C RID: 9612
public int _birdAvoidHorizontalForce = 1000;
// Token: 0x0400258D RID: 9613
public bool _birdAvoidDown;
// Token: 0x0400258E RID: 9614
public bool _birdAvoidUp;
// Token: 0x0400258F RID: 9615
public int _birdAvoidVerticalForce = 300;
// Token: 0x04002590 RID: 9616
public float _birdAvoidDistanceMax = 4.5f;
// Token: 0x04002591 RID: 9617
public float _birdAvoidDistanceMin = 5f;
// Token: 0x04002592 RID: 9618
public float _soarMaxTime;
// Token: 0x04002593 RID: 9619
public LayerMask _avoidanceMask = -1;
// Token: 0x04002594 RID: 9620
public List<FlockChild> _roamers;
// Token: 0x04002595 RID: 9621
public Vector3 _posBuffer;
// Token: 0x04002596 RID: 9622
public bool _skipFrame;
// Token: 0x04002597 RID: 9623
public int _updateDivisor = 2;
// Token: 0x04002598 RID: 9624
public float _newDelta;
// Token: 0x04002599 RID: 9625
public int _updateCounter;
// Token: 0x0400259A RID: 9626
public float _activeChildren;
// Token: 0x0400259B RID: 9627
public bool _groupChildToNewTransform;
// Token: 0x0400259C RID: 9628
public Transform _groupTransform;
// Token: 0x0400259D RID: 9629
public string _groupName = "";
// Token: 0x0400259E RID: 9630
public bool _groupChildToFlock;
// Token: 0x0400259F RID: 9631
public Vector3 _startPosOffset;
// Token: 0x040025A0 RID: 9632
public Transform _thisT;
// Token: 0x040025A1 RID: 9633
public bool LimitPitchRotation = true;
// Token: 0x040025A2 RID: 9634
public int _childCountCache;
}

View File

@@ -0,0 +1,104 @@
using System;
using UnityEngine;
// Token: 0x020000F7 RID: 247
public class FlockScare : MonoBehaviour
{
// Token: 0x0600158D RID: 5517 RVA: 0x0019A6A0 File Offset: 0x001988A0
private void CheckProximityToLandingSpots()
{
this.IterateLandingSpots();
if (this.currentController._activeLandingSpots > 0 && this.CheckDistanceToLandingSpot(this.landingSpotControllers[this.lsc]))
{
this.landingSpotControllers[this.lsc].ScareAll();
}
base.Invoke("CheckProximityToLandingSpots", this.scareInterval);
}
// Token: 0x0600158E RID: 5518 RVA: 0x0019A6FC File Offset: 0x001988FC
private void IterateLandingSpots()
{
this.ls += this.checkEveryNthLandingSpot;
this.currentController = this.landingSpotControllers[this.lsc];
int childCount = this.currentController.transform.childCount;
if (this.ls > childCount - 1)
{
this.ls -= childCount;
if (this.lsc < this.landingSpotControllers.Length - 1)
{
this.lsc++;
return;
}
this.lsc = 0;
}
}
// Token: 0x0600158F RID: 5519 RVA: 0x0019A784 File Offset: 0x00198984
private bool CheckDistanceToLandingSpot(LandingSpotController lc)
{
Transform child = lc.transform.GetChild(this.ls);
LandingSpot component = child.GetComponent<LandingSpot>();
if (component._landingChild != null && (child.position - base.transform.position).sqrMagnitude < this.distanceToScare * this.distanceToScare)
{
if (this.scareAll)
{
return true;
}
component.ReleaseFlockChild();
}
return false;
}
// Token: 0x06001590 RID: 5520 RVA: 0x0019A7F8 File Offset: 0x001989F8
private void Invoker()
{
for (int i = 0; i < this.InvokeAmounts; i++)
{
float num = this.scareInterval / (float)this.InvokeAmounts * (float)i;
base.Invoke("CheckProximityToLandingSpots", this.scareInterval + num);
}
}
// Token: 0x06001591 RID: 5521 RVA: 0x0019A83B File Offset: 0x00198A3B
private void OnEnable()
{
base.CancelInvoke("CheckProximityToLandingSpots");
if (this.landingSpotControllers.Length != 0)
{
this.Invoker();
}
}
// Token: 0x06001592 RID: 5522 RVA: 0x0019A857 File Offset: 0x00198A57
private void OnDisable()
{
base.CancelInvoke("CheckProximityToLandingSpots");
}
// Token: 0x040025A3 RID: 9635
public LandingSpotController[] landingSpotControllers;
// Token: 0x040025A4 RID: 9636
public float scareInterval = 0.1f;
// Token: 0x040025A5 RID: 9637
public float distanceToScare = 2f;
// Token: 0x040025A6 RID: 9638
public int checkEveryNthLandingSpot = 1;
// Token: 0x040025A7 RID: 9639
public int InvokeAmounts = 1;
// Token: 0x040025A8 RID: 9640
private int lsc;
// Token: 0x040025A9 RID: 9641
private int ls;
// Token: 0x040025AA RID: 9642
private LandingSpotController currentController;
// Token: 0x040025AB RID: 9643
public bool scareAll = true;
}

View File

@@ -0,0 +1,29 @@
using System;
using UnityEngine;
// Token: 0x020000F8 RID: 248
public class FlockWaypointTrigger : MonoBehaviour
{
// Token: 0x06001594 RID: 5524 RVA: 0x0019A898 File Offset: 0x00198A98
public void Start()
{
if (this._flockChild == null)
{
this._flockChild = base.transform.parent.GetComponent<FlockChild>();
}
float num = Random.Range(this._timer, this._timer * 3f);
base.InvokeRepeating("Trigger", num, num);
}
// Token: 0x06001595 RID: 5525 RVA: 0x0019A8EE File Offset: 0x00198AEE
public void Trigger()
{
this._flockChild.Wander(0f);
}
// Token: 0x040025AC RID: 9644
public float _timer = 1f;
// Token: 0x040025AD RID: 9645
public FlockChild _flockChild;
}

View File

@@ -0,0 +1,466 @@
using System;
using System.Collections;
using System.Collections.Generic;
using DarkTonic.MasterAudio;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
// Token: 0x020000A6 RID: 166
public class Forfeits : MonoBehaviour
{
// Token: 0x06000F5E RID: 3934 RVA: 0x00129CB0 File Offset: 0x00127EB0
private void Start()
{
this.anim.enabled = false;
this.exiles = Records.x.exiles;
this.exilesPurseState = Records.x.exilesPurseState;
if (!Records.x.windows && this.scrollRect1)
{
this.scrollRect1.scrollSensitivity = 9f;
}
}
// Token: 0x06000F5F RID: 3935 RVA: 0x00129D14 File Offset: 0x00127F14
public void DoUpdate()
{
if (Links.x.joy && this.on)
{
RectTransform viewport = this.scrollRect1.viewport;
for (int i = 0; i < this.usedButtons.Count; i++)
{
if (this.usedButtons[i])
{
Vector2 vector = RectTransformUtility.WorldToScreenPoint(Links.x.hudCanvas.worldCamera, this.usedButtons[i].gameObject.transform.position);
bool flag = RectTransformUtility.RectangleContainsScreenPoint(viewport, vector, Links.x.hudCanvas.worldCamera);
this.usedButtons[i].GetComponent<Button>().interactable = flag;
}
}
}
}
// Token: 0x06000F60 RID: 3936 RVA: 0x00129DD4 File Offset: 0x00127FD4
public void ResetExiles()
{
for (int i = 0; i < this.usedButtons.Count; i++)
{
if (this.usedButtons[i])
{
this.openButtons.Add(this.usedButtons[i]);
this.usedButtons[i].SetActive(false);
this.usedButtons[i].transform.SetParent(this.lineParent, true);
this.usedButtons[i] = null;
}
}
this.usedButtons.Clear();
for (int j = 0; j < this.usedButtonsUnavailable.Count; j++)
{
if (this.usedButtonsUnavailable[j])
{
this.openButtonsUnavailable.Add(this.usedButtonsUnavailable[j]);
this.usedButtonsUnavailable[j].SetActive(false);
this.usedButtonsUnavailable[j].transform.SetParent(this.lineParent, true);
this.usedButtonsUnavailable[j] = null;
}
}
this.usedButtonsUnavailable.Clear();
for (int k = 0; k < this.usedLines.Count; k++)
{
if (this.usedLines[k])
{
this.openLines.Add(this.usedLines[k]);
this.usedLines[k].SetActive(false);
this.usedLines[k] = null;
}
}
this.usedLines.RemoveAll((GameObject item) => item == null);
}
// Token: 0x06000F61 RID: 3937 RVA: 0x00129F7C File Offset: 0x0012817C
public void SetupFromGameLoad()
{
this.ResetExiles();
this.exiles = Records.x.exiles;
this.exilesPurseState = Records.x.exilesPurseState;
for (int i = 0; i < this.exiles.Count; i++)
{
this.AddLine(this.exiles[i], this.exilesPurseState[i]);
}
}
// Token: 0x06000F62 RID: 3938 RVA: 0x00129FE4 File Offset: 0x001281E4
public void StartMenu()
{
if (!base.gameObject.activeSelf)
{
base.gameObject.SetActive(true);
}
if (this.contents1.activeSelf)
{
return;
}
Links.x.gameplay.lastMenu = "Forfeits";
Links.x.gameplay.openingAnotherMenu = true;
Links.x.gameplay.CloseAllMenus();
if (!Records.x.inMenus && Links.x.gaia.sceneLoaded)
{
Links.x.gameplay.OpenDock();
}
this.on = true;
Records.x.AddMenu(base.gameObject);
this.anim.enabled = true;
this.anim.Play("RestOpen");
this.contents1.SetActive(true);
this.exiles = Records.x.exiles;
this.exilesPurseState = Records.x.exilesPurseState;
Links.x.hudControl.ChangeHudVisibility(false, true);
this.CheckButtons();
this.SetFirstButtonAsSelected(true);
if (Links.x.joy)
{
this.controller.spriteAsset = Links.x.GetSpriteSheetAsset(Links.x.gameplay.currentSpriteSheetAsset);
this.str.Clear();
this.str.Append("<voffset=.4em><size=40><sprite=");
int controllerSprite = Links.x.gameplay.GetControllerSprite("Joystick", Links.x.gameplay.controllerName);
this.str.Append(controllerSprite);
this.str.Append("></size></voffset> Navigate ");
this.controller.text = this.str.ToString();
return;
}
this.controller.text = "";
}
// Token: 0x06000F63 RID: 3939 RVA: 0x0012A1B0 File Offset: 0x001283B0
public bool InForfeitsBoard(string characterName)
{
for (int i = 0; i < this.exiles.Count; i++)
{
if (this.exiles[i] != "" && this.exiles[i] == characterName)
{
return true;
}
}
return false;
}
// Token: 0x06000F64 RID: 3940 RVA: 0x0012A204 File Offset: 0x00128404
public void AddLine(string characterName, float state)
{
Library.Characters pcrowFromName = Links.x.library.GetPCRowFromName(characterName);
if (pcrowFromName != null)
{
GameObject gameObject;
if (this.openLines.Count == 0)
{
gameObject = Object.Instantiate<GameObject>(this.line, new Vector3(0f, 0f, 0f), Quaternion.identity, this.lineParent);
gameObject.transform.localPosition = Vector3.zero;
gameObject.SetActive(true);
}
else
{
gameObject = this.openLines[0];
if (!gameObject)
{
gameObject = Object.Instantiate<GameObject>(this.line, new Vector3(0f, 0f, 0f), Quaternion.identity, this.lineParent);
gameObject.transform.localPosition = Vector3.zero;
gameObject.SetActive(true);
}
else
{
this.openLines.RemoveAt(0);
gameObject.SetActive(true);
}
}
gameObject.name = characterName;
string text = pcrowFromName._GenericName;
if (text == "Journeier")
{
text = "Grave Robber";
}
string text2 = pcrowFromName._DisplayName + ", " + text;
gameObject.transform.GetChild(0).gameObject.GetComponent<TextMeshProUGUI>().text = text2;
if (Mathf.Floor((float)Links.x.gameplay.GetCurrentGameTimeHours()) >= state && state != 0f)
{
GameObject gameObject2;
if (this.openButtons.Count == 0)
{
gameObject2 = Object.Instantiate<GameObject>(this.purseButton, new Vector3(0f, 0f, 0f), Quaternion.identity, gameObject.transform);
gameObject2.transform.localPosition = Vector3.zero;
gameObject2.GetComponent<RectTransform>().anchoredPosition = Vector3.zero;
gameObject2.SetActive(true);
}
else
{
gameObject2 = this.openButtons[0];
if (gameObject2)
{
this.openButtons.RemoveAt(0);
gameObject2.SetActive(true);
gameObject2.transform.SetParent(gameObject.transform, false);
gameObject2.GetComponent<RectTransform>().anchoredPosition = Vector3.zero;
}
else
{
gameObject2 = Object.Instantiate<GameObject>(this.purseButton, new Vector3(0f, 0f, 0f), Quaternion.identity, gameObject.transform);
gameObject2.transform.localPosition = Vector3.zero;
gameObject2.GetComponent<RectTransform>().anchoredPosition = Vector3.zero;
gameObject2.SetActive(true);
}
}
this.usedButtons.Add(gameObject2);
gameObject2.GetComponent<Button>().interactable = true;
}
if (Mathf.Floor((float)Links.x.gameplay.GetCurrentGameTimeHours()) < state && state != 0f)
{
GameObject gameObject3;
if (this.openButtonsUnavailable.Count == 0)
{
gameObject3 = Object.Instantiate<GameObject>(this.purseButtonUnavailable, new Vector3(0f, 0f, 0f), Quaternion.identity, gameObject.transform);
gameObject3.transform.localPosition = Vector3.zero;
gameObject3.SetActive(true);
gameObject3.GetComponent<RectTransform>().anchoredPosition = Vector3.zero;
}
else
{
gameObject3 = this.openButtonsUnavailable[0];
if (gameObject3)
{
this.openButtonsUnavailable.RemoveAt(0);
gameObject3.SetActive(true);
gameObject3.transform.SetParent(gameObject.transform, false);
gameObject3.transform.localPosition = Vector3.zero;
gameObject3.GetComponent<RectTransform>().anchoredPosition = Vector3.zero;
}
else
{
gameObject3 = Object.Instantiate<GameObject>(this.purseButtonUnavailable, new Vector3(0f, 0f, 0f), Quaternion.identity, gameObject.transform);
gameObject3.transform.localPosition = Vector3.zero;
gameObject3.SetActive(true);
gameObject3.GetComponent<RectTransform>().anchoredPosition = Vector3.zero;
}
}
this.usedButtonsUnavailable.Add(gameObject3);
}
this.usedLines.Add(gameObject);
this.originals.SetAsLastSibling();
}
}
// Token: 0x06000F65 RID: 3941 RVA: 0x0012A614 File Offset: 0x00128814
private void CheckButtons()
{
for (int i = 0; i < this.exiles.Count; i++)
{
if (this.usedLines[i].transform.childCount > 1)
{
float num = this.exilesPurseState[i];
Debug.Log(string.Concat(new string[]
{
this.exiles[i],
" ",
num.ToString(),
" ",
Mathf.Floor((float)Links.x.gameplay.GetCurrentGameTimeHours()).ToString()
}));
if (Mathf.Floor((float)Links.x.gameplay.GetCurrentGameTimeHours()) >= num && num != 0f)
{
GameObject gameObject = this.usedLines[i].transform.GetChild(1).gameObject;
int num2 = this.usedButtonsUnavailable.IndexOf(gameObject);
if (num2 > -1)
{
this.openButtonsUnavailable.Add(gameObject);
gameObject.SetActive(false);
gameObject.transform.SetParent(this.lineParent, true);
this.usedButtonsUnavailable[num2] = null;
if (this.openButtons.Count == 0)
{
gameObject = Object.Instantiate<GameObject>(this.purseButton, new Vector3(0f, 0f, 0f), Quaternion.identity, this.usedLines[i].transform);
gameObject.transform.localPosition = Vector3.zero;
gameObject.SetActive(true);
gameObject.GetComponent<RectTransform>().anchoredPosition = Vector3.zero;
}
else
{
gameObject = this.openButtons[0];
if (gameObject)
{
this.openButtons.RemoveAt(0);
gameObject.SetActive(true);
gameObject.transform.SetParent(this.usedLines[i].transform, false);
gameObject.transform.localPosition = Vector3.zero;
gameObject.GetComponent<RectTransform>().anchoredPosition = Vector3.zero;
}
else
{
gameObject = Object.Instantiate<GameObject>(this.purseButton, new Vector3(0f, 0f, 0f), Quaternion.identity, this.usedLines[i].transform);
gameObject.transform.localPosition = Vector3.zero;
gameObject.SetActive(true);
gameObject.GetComponent<RectTransform>().anchoredPosition = Vector3.zero;
}
}
this.usedButtons.Add(gameObject);
}
}
}
}
}
// Token: 0x06000F66 RID: 3942 RVA: 0x0012A89C File Offset: 0x00128A9C
public void ClickedReward(GameObject go)
{
string name = go.gameObject.transform.parent.gameObject.name;
Debug.Log(name);
go.gameObject.SetActive(false);
this.openButtons.Add(go);
Links.x.itemPickupFX.gameObject.SetActive(true);
Links.x.itemPickupFX.gameObject.GetComponent<HannahAnimator>().Play("Idle");
Links.x.itemPickupFX.position = go.transform.GetChild(0).position;
int num = this.emeraldsPerReward;
if (name.Contains("RobberBaron"))
{
num = 100;
}
Links.x.inventory.emeralds += num;
Links.x.gameFeed.AddFeed("Party received " + num.ToString() + " emeralds");
MasterAudio.PlaySoundAndForget("Inventory", 0.6f, new float?(1f), 0f, "Coins", null);
Links.x.inventory.peddlerFX.gameObject.SetActive(true);
Links.x.inventory.peddlerFX.Play("Peddler", -1, 0f);
Links.x.inventory.peddlerSellAmount.text = num.ToString();
Links.x.inventory.peddlerSellAmount.color = Color.white;
Links.x.inventory.peddlerFX.GetComponent<RectTransform>().position = go.transform.GetChild(0).gameObject.transform.position;
int num2 = this.exiles.IndexOf(name);
if (num2 > -1)
{
this.exilesPurseState[num2] = 0f;
}
this.SetFirstButtonAsSelected(false);
}
// Token: 0x06000F67 RID: 3943 RVA: 0x0012AA7F File Offset: 0x00128C7F
private void SetFirstButtonAsSelected(bool first)
{
base.StartCoroutine(this.SetFirstButton(first));
}
// Token: 0x06000F68 RID: 3944 RVA: 0x0012AA8F File Offset: 0x00128C8F
private IEnumerator SetFirstButton(bool first)
{
yield return new WaitForSecondsRealtime(0.2f);
if (Links.x.joy)
{
Debug.Log(this.usedButtons.Count);
if (this.usedButtons.Count > 0)
{
bool flag = false;
for (int i = 0; i < this.usedButtons.Count; i++)
{
if (this.usedButtons[i].gameObject.activeSelf && !flag)
{
flag = true;
if (first)
{
Links.x.gameplay.SetInteractableSelected(EventSystem.current, this.usedButtons[i].gameObject);
}
else
{
EventSystem.current.SetSelectedGameObject(this.usedButtons[i].gameObject);
}
}
}
if (!flag)
{
EventSystem.current.SetSelectedGameObject(this.scrollbar.gameObject);
}
}
else
{
EventSystem.current.SetSelectedGameObject(this.scrollbar.gameObject);
}
}
yield break;
}
// Token: 0x06000F69 RID: 3945 RVA: 0x0012AAA8 File Offset: 0x00128CA8
public void CloseMenu(bool fromCloseButton)
{
Links.x.hudControl.JoyBox(false);
this.on = false;
Records.x.RemoveMenu(base.gameObject);
this.anim.Play("RestClose");
if (fromCloseButton)
{
Links.x.gameplay.CloseDock();
}
Links.x.hudControl.ChangeHudVisibility(true, true);
}
// Token: 0x06000F6A RID: 3946 RVA: 0x0012AB0F File Offset: 0x00128D0F
public void EndMenu()
{
this.contents1.SetActive(false);
}
// Token: 0x04001944 RID: 6468
public Animator anim;
// Token: 0x04001945 RID: 6469
public GameObject contents1;
// Token: 0x04001946 RID: 6470
public bool on;
// Token: 0x04001947 RID: 6471
public int emeraldsPerReward = 50;
// Token: 0x04001948 RID: 6472
public GameObject line;
// Token: 0x04001949 RID: 6473
public GameObject purseButton;
// Token: 0x0400194A RID: 6474
public GameObject purseButtonUnavailable;
// Token: 0x0400194B RID: 6475
public Transform lineParent;
// Token: 0x0400194C RID: 6476
public List<GameObject> usedLines = new List<GameObject>();
// Token: 0x0400194D RID: 6477
public List<GameObject> openLines = new List<GameObject>();
// Token: 0x0400194E RID: 6478
public List<GameObject> usedButtons = new List<GameObject>();
// Token: 0x0400194F RID: 6479
public List<GameObject> openButtons = new List<GameObject>();
// Token: 0x04001950 RID: 6480
public List<GameObject> usedButtonsUnavailable = new List<GameObject>();
// Token: 0x04001951 RID: 6481
public List<GameObject> openButtonsUnavailable = new List<GameObject>();
// Token: 0x04001952 RID: 6482
private List<string> exiles;
// Token: 0x04001953 RID: 6483
private List<float> exilesPurseState;
// Token: 0x04001954 RID: 6484
public ScrollRectNoDragging scrollRect1;
// Token: 0x04001955 RID: 6485
public Transform originals;
// Token: 0x04001956 RID: 6486
public TextMeshProUGUI controller;
// Token: 0x04001957 RID: 6487
private StringFast str = new StringFast(32);
// Token: 0x04001958 RID: 6488
public GameObject scrollbar;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,846 @@
using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
// Token: 0x020000A9 RID: 169
public class GameCard : MonoBehaviour
{
// Token: 0x06000F8E RID: 3982 RVA: 0x0012CFA2 File Offset: 0x0012B1A2
private void Awake()
{
}
// Token: 0x06000F8F RID: 3983 RVA: 0x0012CFA4 File Offset: 0x0012B1A4
private void Start()
{
this.ToggleState(false);
}
// Token: 0x06000F90 RID: 3984 RVA: 0x0012CFB0 File Offset: 0x0012B1B0
public int GetDiceCountModifier(int type)
{
int num = 0;
this.diceCountMods = this.hoverCharacter.stats.diceCountMods;
this.diceSideMods = this.hoverCharacter.stats.diceSideMods;
this.diceTypeMods = this.hoverCharacter.stats.diceTypeMods;
for (int i = 0; i < this.diceTypeMods.Count; i++)
{
if (this.diceTypeMods[i] == type)
{
int num2 = this.diceCountMods[i];
if (num2 < 0)
{
num2 *= -1;
}
int num3 = this.diceSideMods[i];
int num4 = 0;
for (int j = 0; j < num2; j++)
{
num4 += Random.Range(1, num3 + 1);
}
if (this.diceCountMods[i] < 0)
{
num4 *= -1;
}
num += num4;
}
}
return num;
}
// Token: 0x06000F91 RID: 3985 RVA: 0x0012D084 File Offset: 0x0012B284
private void FixedUpdate()
{
if (Records.x.partySailing)
{
this.Positions();
}
}
// Token: 0x06000F92 RID: 3986 RVA: 0x0012D098 File Offset: 0x0012B298
private void LateUpdate()
{
if (!Records.x.partySailing)
{
this.Positions();
}
}
// Token: 0x06000F93 RID: 3987 RVA: 0x0012D0AC File Offset: 0x0012B2AC
private void Positions()
{
if (this.hoverCharacter)
{
if (this.stopPlaying)
{
this.currIndex = -1;
}
if (!this.animator.enabled || !this.animator.GetBool("On"))
{
this.animator.enabled = true;
this.animator.SetBool("On", true);
}
if (this.fullCard && Records.x.InCombat(false))
{
this.SetHealth();
}
Vector3 anchoredPosition3D = this.statusRT.anchoredPosition3D;
if ((this.t >= 1.3f || anchoredPosition3D.y >= this.target - 0.2f) && this.target != 0f && this.t > 0f)
{
this.t = 0f;
this.start = anchoredPosition3D.y;
this.target = 0f;
}
else if (anchoredPosition3D.y <= 0f && this.t > 0f)
{
this.t = 0f;
this.start = anchoredPosition3D.y;
this.target = this.statusRT.sizeDelta.y - 20.15f;
}
else
{
this.t += Time.deltaTime / 3f;
anchoredPosition3D.y = Mathf.Lerp(this.start, this.target, this.t);
this.statusRT.anchoredPosition3D = anchoredPosition3D;
}
if (this.hoverCharacter.dead || this.hoverCharacter != Links.x.gameplay.gameCardCharacter)
{
this.EndHover(this.hoverCharacter, false);
}
}
if (this.characterName.color.a > 0f && this.body)
{
float num = 0f;
if (!Links.x.worldCamera.orthographic)
{
num = -0.1f;
}
if (this.controlsText.text == "" && this.status.text == "")
{
num += 0.15f;
}
if (this.controlsText.text == "" || this.status.text == "")
{
num += 0.15f;
}
if (this.body.character)
{
if (this.body.character.statusRing)
{
num -= 0.5f;
}
if (this.body.character.isBoro)
{
num += 0.01f;
}
}
if (Links.x.joy && Records.x.pocketPause)
{
num -= 1f;
}
Vector3 vector = Vector3.zero;
this.body.GetBounds();
vector = this.body.bounds.center + new Vector3(0f, this.body.bounds.extents.y / 2f, 0f);
Vector3 vector2 = Links.x.worldCamera.WorldToScreenPoint(vector + new Vector3(0f, 1f - num, 0f));
vector2.z = 0f;
vector2.x = vector2.x * (1920f / (float)Screen.width) - 960f;
vector2.y = vector2.y * (Links.x.canvasRT.sizeDelta.y / (float)Screen.height) - Links.x.canvasRT.sizeDelta.y / 2f;
this.rt.localPosition = vector2;
}
}
// Token: 0x06000F94 RID: 3988 RVA: 0x0012D47B File Offset: 0x0012B67B
public void SetPortrait(RenderTexture t)
{
if (t != null)
{
this.portrait.texture = t;
}
}
// Token: 0x06000F95 RID: 3989 RVA: 0x0012D494 File Offset: 0x0012B694
public void StartHover(Character character, string health)
{
this.currIndex = -1;
this.updateTime = Time.realtimeSinceStartup + 0.14f;
this.str.Clear();
if (this.portraitCharacterToRemove && this.portraitCharacterToRemove.npc)
{
if (this.fullCard)
{
Links.x.renderPortraits.RemoveCharacter(this.portraitCharacterToRemove, "", null);
}
this.portraitCharacterToRemove = null;
}
if (character)
{
if (character.stats.xmlName.Contains("Boro") && !character.isBoro && !character.hasActions && !character.stunned && Records.x.BoroInParty())
{
Records.x.ShowBoroStats(character);
return;
}
this.body = character.body;
if (character.party && this.fullCard)
{
Links.x.renderPortraits.RemoveCharacter(character, character.stats.xmlName, null);
}
}
bool flag = false;
if (Records.x.pocketPause && Links.x.pocketWheel.Charming())
{
flag = true;
}
if (this.coroutine != null)
{
base.StopCoroutine(this.coroutine);
this.coroutine = null;
}
if (Records.x.mainCharacterDead || !character)
{
return;
}
this.hoverCharacter = character;
if (this.hoverCharacter.isBoro)
{
this.str.Append(Records.x.boroName);
}
else
{
this.str.Append(this.hoverCharacter.stats.GetName());
}
if (this.hoverCharacter.stats.initiateDialogue >= 10 && !this.hoverCharacter.isBoro && this.hoverCharacter.stats.characterRow._GenericName != this.hoverCharacter.stats.GetName())
{
this.str.Append(", ");
this.str.Append(this.hoverCharacter.stats.characterRow._GenericName);
}
if (this.hoverCharacter.stunned)
{
if (this.hoverCharacter.stats.xmlName.Contains("LocalGraveKeeper"))
{
this.str.Append(" (Dormant)");
}
else
{
this.str.Append(" (Stunned)");
}
}
if (this.hoverCharacter.sleeping && !this.hoverCharacter.stunned)
{
this.str.Append(" (Asleep)");
}
if (this.hoverCharacter.dayNightVanishing && !this.hoverCharacter.stunned && !this.hoverCharacter.sleeping && !Records.x.pocketPause && !this.hoverCharacter.hasActions)
{
this.str.Append(" (Busy)");
}
this.status.text = "";
this.characterName.text = this.str.ToString();
this.savedHealth = character.stats.HealthCurrent();
this.str.Clear();
this.controlsText.spriteAsset = Links.x.GetSpriteSheetAsset(Links.x.gameplay.currentSpriteSheetAsset);
bool flag2 = false;
if (Links.x.joy)
{
flag2 = true;
}
if (!character.stunned || (character.stunned && Records.x.kill))
{
if (flag)
{
if ((this.hoverCharacter.stats.characterRow._Race == "Forest" || this.hoverCharacter.stats.characterRow._Race == "Fish" || this.hoverCharacter.stats.characterRow._Race == "Shroom") && !this.hoverCharacter.stats.xmlName.Contains("Cat"))
{
string text = "CharmShroom";
if (character.stats.race == "Forest")
{
text = "CharmForest";
}
if (character.stats.race == "Fish")
{
text = "CharmFish";
}
float num = Links.x.main.stats.Charming(text, true);
float num2 = this.hoverCharacter.stats.CharmResistance(false, (float)this.hoverCharacter.stats.HealthCurrent());
num2 += Links.x.main.stats.SummonModCharm();
float num3 = num - num2;
if (Links.x.combat.CanAttackTarget(this.hoverCharacter))
{
string text2 = "Bind";
if (num3 <= 2f)
{
text2 = "Roll to bind";
}
if (this.hoverCharacter.stats.characterRow._Race == "Forest")
{
text2 += " (Forest)";
}
if (this.hoverCharacter.stats.characterRow._Race == "Fish")
{
text2 += " (Fish)";
}
if (this.hoverCharacter.stats.characterRow._Race == "Shroom")
{
text2 += " (Shroom)";
}
if (Links.x.mk || Links.x.pocketWheel.targetSelection)
{
this.str.Append(text2);
this.str.Append(" ");
if (Links.x.mk)
{
this.str.Append(" <voffset=.4em><size=30><sprite=");
int keyIconIndex = Links.x.keyControl.GetKeyIconIndex("LMB");
this.str.Append(keyIconIndex);
this.str.Append("></size></voffset>");
}
else
{
this.str.Append(" <voffset=.4em><size=30><sprite=");
int controllerSprite = Links.x.gameplay.GetControllerSprite("Action", Links.x.gameplay.controllerName);
this.str.Append(controllerSprite);
this.str.Append("></size></voffset>");
}
}
else
{
this.str.Append(" ");
}
}
else
{
string text3 = "Will resist";
if (num3 < 2f)
{
text3 = "Barely resist";
}
if (Records.x.partySailing)
{
text3 = "Cannot bind at sea";
}
if (this.hoverCharacter.stats.characterRow._Race == "Forest")
{
text3 += " (Forest)";
}
if (this.hoverCharacter.stats.characterRow._Race == "Fish")
{
text3 += " (Fish)";
}
if (this.hoverCharacter.stats.characterRow._Race == "Shroom")
{
text3 += " (Shroom)";
}
if (Links.x.main.HasRosary() < 0)
{
text3 = "No charm bells";
}
this.str.Append("<line-height=15>\n");
this.str.Append(text3);
this.str.Append("<cspace=.7em> </cspace=></line-height>");
}
}
else
{
this.str.Append("<line-height=15>\nCannot bind<cspace=.7em> </cspace=></line-height>");
}
flag2 = true;
}
else if (character.hostility < 2 && !character.attackingUntilBribe && character.npc && !Records.x.pocketPause)
{
if (Links.x.hudControl.CharacterIsNear(character))
{
if (!character.stats.animal && !character.sleeping && !character.dayNightVanishing && character.stats.dialogueFile != "" && character.IsSentient())
{
this.str.Append("Talk ");
if (Links.x.mk)
{
this.str.Append(" <voffset=.4em><size=30><sprite=");
int keyIconIndex2 = Links.x.keyControl.GetKeyIconIndex("LMB");
this.str.Append(keyIconIndex2);
this.str.Append("></size></voffset>");
}
else
{
this.str.Append(" <voffset=.4em><size=30><sprite=");
int controllerSprite2 = Links.x.gameplay.GetControllerSprite("Interact", Links.x.gameplay.controllerName);
this.str.Append(controllerSprite2);
this.str.Append("></size></voffset>");
}
flag2 = false;
}
else
{
if (!character.sleeping && !character.stunned)
{
this.str.Append("<line-height=15>\n(Cannot talk)<cspace=.7em> </cspace=></line-height>");
}
flag2 = true;
}
}
else
{
if (character.stats.animal)
{
if (!character.dayNightVanishing)
{
this.str.Append("<line-height=15>\n(Cannot talk)<cspace=.7em> </cspace=></line-height>");
}
}
else if (character.IsSentient())
{
this.str.Append("<line-height=15>\n(Too far away to talk)<cspace=.7em> </cspace=></line-height>");
}
flag2 = true;
}
}
else if ((character.hostility < 2 && !character.attackingUntilBribe) || Records.x.pocketPause)
{
if (Links.x.gameplay.spellTargetingParty && !character.npc)
{
if (!character.stats.animal && !character.sleeping && !character.dayNightVanishing && (Links.x.mk || Links.x.pocketWheel.targetSelection))
{
this.str.Append("Cast Spell ");
if (Links.x.mk)
{
this.str.Append(" <voffset=.4em><size=30><sprite=");
int keyIconIndex3 = Links.x.keyControl.GetKeyIconIndex("LMB");
this.str.Append(keyIconIndex3);
this.str.Append("></size></voffset>");
}
else
{
this.str.Append(" <voffset=.4em><size=30><sprite=");
int controllerSprite3 = Links.x.gameplay.GetControllerSprite("Action", Links.x.gameplay.controllerName);
this.str.Append(controllerSprite3);
this.str.Append("></size></voffset>");
}
}
else
{
this.str.Append(" ");
}
flag2 = false;
}
else if (Links.x.gameplay.spellTargetingEnemy && character.npc)
{
if (!character.stats.animal && !character.sleeping && !character.dayNightVanishing && (Links.x.mk || Links.x.pocketWheel.targetSelection))
{
this.str.Append("Cast Spell ");
if (Links.x.mk)
{
this.str.Append(" <voffset=.4em><size=30><sprite=");
int keyIconIndex4 = Links.x.keyControl.GetKeyIconIndex("LMB");
this.str.Append(keyIconIndex4);
this.str.Append("></size></voffset>");
}
else
{
this.str.Append(" <voffset=.4em><size=30><sprite=");
int controllerSprite4 = Links.x.gameplay.GetControllerSprite("Action", Links.x.gameplay.controllerName);
this.str.Append(controllerSprite4);
this.str.Append("></size></voffset>");
flag2 = false;
}
}
else
{
this.str.Append(" ");
}
}
else if (Links.x.combat.CanAttackTarget(character))
{
if (Links.x.pocketWheel.targetSelection || Links.x.mk)
{
if (Links.x.pocketWheel.selected == "Heavy Attack")
{
flag2 = Links.x.mk;
if ((this.hoverCharacter.currentPosition - Links.x.main.currentPosition).sqrMagnitude < 6.25f)
{
this.str.Append("Kick ");
}
else
{
this.str.Append("Charge ");
}
}
else
{
if (Records.x.kill || character.ghost)
{
this.str.Append("Attack ");
}
else
{
this.str.Append("Stun ");
}
flag2 = false;
}
}
if (Links.x.mk || Links.x.pocketWheel.targetSelection)
{
if (Links.x.mk)
{
this.str.Append(" <voffset=.4em><size=30><sprite=");
int keyIconIndex5 = Links.x.keyControl.GetKeyIconIndex("LMB");
this.str.Append(keyIconIndex5);
this.str.Append("></size></voffset>");
}
else
{
this.str.Append(" <voffset=.4em><size=30><sprite=");
int controllerSprite5 = Links.x.gameplay.GetControllerSprite("Action", Links.x.gameplay.controllerName);
this.str.Append(controllerSprite5);
this.str.Append("></size></voffset>");
}
}
else
{
this.str.Append(" ");
}
}
else if (!flag && Links.x.gameplay.attackingCharacter.CanAttack() && !Links.x.combat.inPocketAttack)
{
if (!Links.x.gameplay.attackingCharacter.HasAmmoOrMelee(Links.x.gameplay.attackingCharacter.invRow1, false))
{
this.str.Append("<line-height=15>\n(No ammo)<cspace=.7em> </cspace=></line-height>");
}
flag2 = true;
}
}
}
if (flag2)
{
this.controlsText.text = this.str.ToString();
}
else
{
this.controlsText.text = "";
}
if (this.controlsText.text != "")
{
this.scrollViewRT.anchoredPosition3D = new Vector3(2.74f, -8.5f, 0f);
}
else
{
this.scrollViewRT.anchoredPosition3D = new Vector3(2.74f, 15.7f, 0f);
}
this.vignetteRT.sizeDelta = new Vector2(this.characterName.preferredWidth + 20f, this.vignetteRT.sizeDelta.y);
if (Links.x.main)
{
this.ToggleState(true);
}
this.hp.text = "";
if (this.fullCard)
{
this.SetHealth();
}
if (this.fullCard)
{
if (!this.hoverCharacter.ghost)
{
Links.x.renderPortraits.AddCharacter(this.hoverCharacter, this.hoverCharacter.stats.xmlName, null, false, null, null, this, null);
if (this.texturesIdle != null)
{
this.portrait.texture = this.texturesIdle;
}
}
else
{
this.portrait.texture = this.ghostTexture;
}
}
if (this.animator.enabled)
{
float normalizedTime = this.animator.GetCurrentAnimatorStateInfo(0).normalizedTime;
if (!this.animator.GetCurrentAnimatorStateInfo(0).IsName("GameCardOff"))
{
this.animator.Play("GameCardIdle", -1, 0f);
}
else
{
this.animator.Play("GameCardOn");
}
}
else
{
this.animator.enabled = true;
this.animator.Play("GameCardOn");
}
this.animator.SetBool("On", true);
this.targetAlpha = 0f;
}
// Token: 0x06000F96 RID: 3990 RVA: 0x0012E492 File Offset: 0x0012C692
public RenderTexture GetTexturePortrait()
{
if (this.texturesIdle != null)
{
return this.texturesIdle;
}
return null;
}
// Token: 0x06000F97 RID: 3991 RVA: 0x0012E4AC File Offset: 0x0012C6AC
private void SetHealth()
{
if (Records.x.InCombat(false) && !this.hoverCharacter.stunned && !this.hoverCharacter.dead)
{
this.healthBar.gameObject.SetActive(true);
this.healthBarBack.gameObject.SetActive(true);
this.healthBar.fillAmount = (float)this.hoverCharacter.stats.HealthCurrent() / (float)this.hoverCharacter.stats.HealthMax();
this.fatigueBar.gameObject.SetActive(true);
this.fatigueBarBack.gameObject.SetActive(true);
}
else
{
this.healthBar.gameObject.SetActive(false);
this.healthBarBack.gameObject.SetActive(false);
this.fatigueBar.gameObject.SetActive(false);
this.fatigueBarBack.gameObject.SetActive(false);
}
if (this.hoverCharacter.stats.HealthCurrent() <= 0)
{
this.fatigueBar.fillAmount = 0f;
return;
}
this.fatigueBar.fillAmount = this.hoverCharacter.stats.stamina / this.hoverCharacter.stats.maxStamina;
}
// Token: 0x06000F98 RID: 3992 RVA: 0x0012E5F0 File Offset: 0x0012C7F0
public void EndHover(Character character, bool wait)
{
if (character.stats.xmlName.Contains("Boro") && !character.isBoro && Records.x.BoroInParty() && Links.x.hudControl.boroHoverCard.activeSelf)
{
this.hoverCharacter = null;
Links.x.hudControl.CloseBoroHoverCard();
return;
}
if (this.hoverCharacter == character && wait)
{
this.coroutine = this.StartEnd();
base.StartCoroutine(this.coroutine);
}
else
{
this.EndHoverContinued();
}
if (this.hoverCharacter)
{
this.portraitCharacterToRemove = this.hoverCharacter;
}
this.hoverCharacter = null;
}
// Token: 0x06000F99 RID: 3993 RVA: 0x0012E6A8 File Offset: 0x0012C8A8
public void EndHoverContinued()
{
this.targetAlpha = 1f;
if (this.hoverCharacter)
{
this.portraitCharacterToRemove = this.hoverCharacter;
}
float num = this.animator.GetCurrentAnimatorStateInfo(0).normalizedTime;
if (!this.animator.GetCurrentAnimatorStateInfo(0).IsName("GameCardOn"))
{
num = 1f;
}
if (this.animator.GetCurrentAnimatorStateInfo(0).IsName("GameCardOn") || this.animator.GetCurrentAnimatorStateInfo(0).IsName("GameCardIdle"))
{
this.animator.Play("GameCardOff", 0, 1f - num);
}
this.animator.SetBool("On", false);
this.AnimationDone();
}
// Token: 0x06000F9A RID: 3994 RVA: 0x0012E774 File Offset: 0x0012C974
public void End()
{
this.targetAlpha = 1f;
this.ToggleState(false);
if (this.hoverCharacter)
{
this.portraitCharacterToRemove = this.hoverCharacter;
}
this.hoverCharacter = null;
float num = this.animator.GetCurrentAnimatorStateInfo(0).normalizedTime;
if (!this.animator.GetCurrentAnimatorStateInfo(0).IsName("GameCardOn"))
{
num = 1f;
}
if (this.animator.GetCurrentAnimatorStateInfo(0).IsName("GameCardOn") || this.animator.GetCurrentAnimatorStateInfo(0).IsName("GameCardIdle"))
{
this.animator.Play("GameCardOff", 0, 1f - num);
}
this.animator.SetBool("On", false);
}
// Token: 0x06000F9B RID: 3995 RVA: 0x0012E848 File Offset: 0x0012CA48
private IEnumerator StartEnd()
{
yield return new WaitForSeconds(0.06f);
if (!this.hoverCharacter)
{
this.ToggleState(false);
this.EndHoverContinued();
}
yield break;
}
// Token: 0x06000F9C RID: 3996 RVA: 0x0012E858 File Offset: 0x0012CA58
public void AnimationDone()
{
this.ToggleState(false);
this.animator.enabled = false;
if (this.portraitCharacterToRemove && this.portraitCharacterToRemove.npc && !this.portraitCharacterToRemove.ghost && !this.portraitCharacterToRemove.party)
{
if (this.fullCard)
{
Links.x.renderPortraits.RemoveCharacter(this.portraitCharacterToRemove, "", null);
}
this.portraitCharacterToRemove = null;
}
}
// Token: 0x06000F9D RID: 3997 RVA: 0x0012E8D8 File Offset: 0x0012CAD8
public void ToggleState(bool state)
{
for (int i = 0; i < this.images.Count; i++)
{
this.images[i].enabled = state;
}
for (int j = 0; j < this.texts.Count; j++)
{
this.texts[j].enabled = state;
}
this.portrait.enabled = state;
}
// Token: 0x040019A7 RID: 6567
public Animator animator;
// Token: 0x040019A8 RID: 6568
public RectTransform rt;
// Token: 0x040019A9 RID: 6569
public RectTransform scrollViewRT;
// Token: 0x040019AA RID: 6570
public RectTransform vignetteRT;
// Token: 0x040019AB RID: 6571
public float offset;
// Token: 0x040019AC RID: 6572
public List<Image> images = new List<Image>();
// Token: 0x040019AD RID: 6573
public List<TextMeshProUGUI> texts = new List<TextMeshProUGUI>();
// Token: 0x040019AE RID: 6574
public RawImage portrait;
// Token: 0x040019AF RID: 6575
public TextMeshProUGUI characterName;
// Token: 0x040019B0 RID: 6576
public TextMeshProUGUI hp;
// Token: 0x040019B1 RID: 6577
public TextMeshProUGUI dmg;
// Token: 0x040019B2 RID: 6578
public TextMeshProUGUI status;
// Token: 0x040019B3 RID: 6579
public TextMeshProUGUI controlsText;
// Token: 0x040019B4 RID: 6580
public Character hoverCharacter;
// Token: 0x040019B5 RID: 6581
public Image healthBar;
// Token: 0x040019B6 RID: 6582
public Image healthBarBack;
// Token: 0x040019B7 RID: 6583
public Image fatigueBar;
// Token: 0x040019B8 RID: 6584
public Image fatigueBarBack;
// Token: 0x040019B9 RID: 6585
private List<Effects> effects;
// Token: 0x040019BA RID: 6586
private List<int> diceCountMods;
// Token: 0x040019BB RID: 6587
private List<int> diceSideMods;
// Token: 0x040019BC RID: 6588
private List<int> diceTypeMods;
// Token: 0x040019BD RID: 6589
public Sprite emptySprite;
// Token: 0x040019BE RID: 6590
public RenderTexture texturesIdle;
// Token: 0x040019BF RID: 6591
private float updateTime;
// Token: 0x040019C0 RID: 6592
public int currIndex;
// Token: 0x040019C1 RID: 6593
private IEnumerator coroutine;
// Token: 0x040019C2 RID: 6594
private float closeTime;
// Token: 0x040019C3 RID: 6595
public bool needToScroll;
// Token: 0x040019C4 RID: 6596
private float t;
// Token: 0x040019C5 RID: 6597
private float start;
// Token: 0x040019C6 RID: 6598
private float target;
// Token: 0x040019C7 RID: 6599
public RectTransform statusRT;
// Token: 0x040019C8 RID: 6600
private StringFast str = new StringFast(64);
// Token: 0x040019C9 RID: 6601
public int savedHealth;
// Token: 0x040019CA RID: 6602
public bool stopPlaying;
// Token: 0x040019CB RID: 6603
public Texture ghostTexture;
// Token: 0x040019CC RID: 6604
public CanvasGroup badgesCanvasGroup;
// Token: 0x040019CD RID: 6605
public float targetAlpha;
// Token: 0x040019CE RID: 6606
public ItemCard itemCard;
// Token: 0x040019CF RID: 6607
private Character portraitCharacterToRemove;
// Token: 0x040019D0 RID: 6608
public bool fullCard;
// Token: 0x040019D1 RID: 6609
private Body body;
}

Some files were not shown because too many files have changed in this diff Show More