Browse Source

[2.0.5.2] init

Zariteis 4 years ago
commit
a14f718357

+ 512 - 0
.gitignore

@@ -0,0 +1,512 @@
+### Csharp ###
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+[Ll]ogs/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUnit
+*.VisualState.xml
+TestResult.xml
+nunit-*.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*[.json, .xml, .info]
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
+
+### vs ###
+
+# User-specific files
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+
+# Mono auto generated files
+
+# Build results
+
+# Visual Studio 2015/2017 cache/options directory
+# Uncomment if you have tasks that create the project's static files in wwwroot
+
+# Visual Studio 2017 auto generated files
+
+# MSTest test Results
+
+# NUnit
+
+# Build Results of an ATL Project
+
+# Benchmark Results
+
+# .NET Core
+
+# StyleCop
+
+# Files built by Visual Studio
+
+# Chutzpah Test files
+
+# Visual C++ cache files
+
+# Visual Studio profiler
+
+# Visual Studio Trace Files
+
+# TFS 2012 Local Workspace
+
+# Guidance Automation Toolkit
+
+# ReSharper is a .NET coding add-in
+
+# TeamCity is a build add-in
+
+# DotCover is a Code Coverage Tool
+
+# AxoCover is a Code Coverage Tool
+
+# Coverlet is a free, cross platform Code Coverage Tool
+
+# Visual Studio code coverage results
+
+# NCrunch
+
+# MightyMoose
+
+# Web workbench (sass)
+
+# Installshield output folder
+
+# DocProject is a documentation generator add-in
+
+# Click-Once directory
+
+# Publish Web Output
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+
+# NuGet Packages
+# NuGet Symbol Packages
+# The packages folder can be ignored because of Package Restore
+# except build/, which is used as an MSBuild target.
+# Uncomment if necessary however generally it will be regenerated when needed
+# NuGet v3's project.json files produces more ignorable files
+
+# Microsoft Azure Build Output
+
+# Microsoft Azure Emulator
+
+# Windows Store app package directories and files
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+# but keep track of directories ending in .cache
+
+# Others
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+
+# RIA/Silverlight projects
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+
+# SQL Server files
+
+# Business Intelligence projects
+
+# Microsoft Fakes
+
+# GhostDoc plugin setting file
+
+# Node.js Tools for Visual Studio
+
+# Visual Studio 6 build log
+
+# Visual Studio 6 workspace options file
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+
+# Visual Studio LightSwitch build output
+
+# Paket dependency manager
+
+# FAKE - F# Make
+
+# CodeRush personal settings
+
+# Python Tools for Visual Studio (PTVS)
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+
+# Telerik's JustMock configuration file
+
+# BizTalk build output
+
+# OpenCover UI analysis results
+
+# Azure Stream Analytics local run output
+
+# MSBuild Binary and Structured Log
+
+# NVidia Nsight GPU debugger configuration file
+
+# MFractors (Xamarin productivity tool) working folder
+
+# Local History for Visual Studio
+
+# BeatPulse healthcheck temp database
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+
+# Ionide (cross platform F# VS Code tools) working folder

BIN
Assets/entity/goldenShroomHead.png


BIN
Assets/entity/goldenShroomTop.png


BIN
Assets/objects/ancientCrystal.png


BIN
Assets/objects/ancientCrystalCMTop.png


BIN
Assets/objects/ancientCrystalTop.png


BIN
Assets/objects/bugTree.png


BIN
Assets/objects/bugspotBig.png


BIN
Assets/objects/frozenWisp.png


BIN
Assets/objects/goldenShroom.png


BIN
Assets/objects/molten.png


BIN
Assets/objects/plagueNest.png


BIN
Assets/objects/spiderEgg.png


BIN
Assets/objects/spiderEggCM.png


BIN
Assets/objects/spiderEggCM2.png


BIN
Assets/objects/spikePlant.png


BIN
Assets/objects/spikePlantCM.png


BIN
Assets/objects/spikePlantCMTop.png


BIN
Assets/objects/spikePlantTop.png


BIN
Assets/objects/wizShroom.png


BIN
Assets/projectiles/goldenShroom.png


+ 24 - 0
Core.cs

@@ -0,0 +1,24 @@
+using GadgetCore;
+using GadgetCore.API;
+
+namespace MonsterNests
+{
+  internal static class Core
+  {
+    public static ObjectInfo objectBugspotBig;
+    public static ObjectInfo objectBugTree;
+    public static ObjectInfo objectSpiderEgg;
+    public static ObjectInfo objectSpiderEggCM;
+    public static ObjectInfo objectGoldenShroom;
+    public static ObjectInfo objectWizShroom;
+    public static ObjectInfo objectSpikePlant;
+    public static ObjectInfo objectSpikePlantCM;
+    public static ObjectInfo objectAncientCrystal;
+    public static ObjectInfo objectAncientCrystalCM;
+    public static ObjectInfo objectPlagueNest;
+    public static ObjectInfo objectFrozenWisp;
+    public static ObjectInfo objectMolten;
+
+    public static GadgetLogger logger;
+  }
+}

+ 3 - 0
Manifest.ini

@@ -0,0 +1,3 @@
+[Metadata]
+Name=Monster Nests
+Assembly=MonsterNests.dll

+ 1 - 0
ModInfo.txt

@@ -0,0 +1 @@
+A mod that adds some rare dangerous harvestables.

+ 178 - 0
MonsterNests.cs

@@ -0,0 +1,178 @@
+using UnityEngine;
+using GadgetCore.API;
+using GadgetCore.Util;
+using GadgetCore.API.ConfigMenu;
+using MonsterNests.Scripts;
+
+namespace MonsterNests
+{
+  [Gadget("MonsterNests", RequiredOnClients: true)]
+  public class MonsterNests : Gadget<MonsterNests>
+  {
+    public const string MOD_VERSION = "1.0"; // Set this to the version of your mod.
+    public const string CONFIG_VERSION = "1.0"; // Increment this whenever you change your mod's config file.
+
+    protected override void LoadConfig()
+    {
+      Config.Load();
+
+      string fileVersion = Config.ReadString("ConfigVersion", CONFIG_VERSION, comments: "The Config Version (not to be confused with mod version)");
+
+      if (fileVersion != CONFIG_VERSION)
+      {
+        Config.Reset();
+        Config.WriteString("ConfigVersion", CONFIG_VERSION, comments: "The Config Version (not to be confused with mod version)");
+      }
+
+      Config.Reset();
+      Config.Save();
+    }
+    public override IGadgetConfigMenu GetConfigMenu() { return null; }
+
+    public override string GetModDescription()
+    {
+      return "A mod that adds some rare dangerous harvestables.";
+    }
+
+    protected override void Initialize()
+    {
+      Logger.Log("Monster Nests v" + Info.Mod.Version);
+      Core.logger = Logger;
+
+      Texture2D textureBugspotBig = GadgetCoreAPI.LoadTexture2D("objects/bugspotBig.png");
+      Texture2D textureBugTree = GadgetCoreAPI.LoadTexture2D("objects/bugTree.png");
+      Texture2D textureSpikePlant = GadgetCoreAPI.LoadTexture2D("objects/spikePlant.png");
+      Texture2D textureSpikePlantTop = GadgetCoreAPI.LoadTexture2D("objects/spikePlantTop.png");
+      Texture2D textureSpikePlantCM = GadgetCoreAPI.LoadTexture2D("objects/spikePlantCM.png");
+      Texture2D textureSpikePlantCMTop = GadgetCoreAPI.LoadTexture2D("objects/spikePlantCMTop.png");
+      Texture2D textureSpiderEgg = GadgetCoreAPI.LoadTexture2D("objects/spiderEgg.png");
+      Texture2D textureSpiderEggCM = GadgetCoreAPI.LoadTexture2D("objects/spiderEggCM.png");
+      Texture2D textureGoldenShroom = GadgetCoreAPI.LoadTexture2D("objects/goldenShroom.png");
+      Texture2D textureWizShroom = GadgetCoreAPI.LoadTexture2D("objects/wizShroom.png");
+      Texture2D textureAncientCrystal = GadgetCoreAPI.LoadTexture2D("objects/ancientCrystal.png");
+      Texture2D textureAncientCrystalCMTop = GadgetCoreAPI.LoadTexture2D("objects/ancientCrystalCMTop.png");
+      Texture2D textureAncientCrystalTop = GadgetCoreAPI.LoadTexture2D("objects/ancientCrystalTop.png");
+      Texture2D texturePlagueNest = GadgetCoreAPI.LoadTexture2D("objects/plagueNest.png");
+      Texture2D textureFrozenWisp = GadgetCoreAPI.LoadTexture2D("objects/frozenWisp.png");
+      Texture2D textureMolten = GadgetCoreAPI.LoadTexture2D("objects/molten.png");
+
+      Core.objectBugspotBig = new ObjectInfo(ObjectType.BUGSPOT, new Item(31, 1, 0, 0, 0, new int[3], new int[3]), 16, textureBugspotBig).Register("bugspotBig");
+      Core.objectBugTree = new ObjectInfo(ObjectType.TREE, new Item(11, 1, 0, 0, 0, new int[3], new int[3]), 16, textureBugTree).Register("bugTree");
+      Core.objectSpikePlant = new ObjectInfo(ObjectType.PLANT, new Item(11, 1, 0, 0, 0, new int[3], new int[3]), 16, textureSpikePlant).Register("spikePlant");
+      Core.objectSpikePlantCM = new ObjectInfo(ObjectType.PLANT, new Item(11, 1, 0, 0, 0, new int[3], new int[3]), 16, textureSpikePlantCM).Register("spikePlantCM");
+      Core.objectSpiderEgg = new ObjectInfo(ObjectType.ORE, new Item(2, 1, 0, 0, 0, new int[3], new int[3]), 16, textureSpiderEgg).Register("spiderEgg");
+      Core.objectSpiderEggCM = new ObjectInfo(ObjectType.ORE, new Item(2, 1, 0, 0, 0, new int[3], new int[3]), 16, textureSpiderEggCM).Register("spiderEggCM");
+      Core.objectGoldenShroom = new ObjectInfo(ObjectType.PLANT, new Item(12, 1, 0, 0, 0, new int[3], new int[3]), 16, textureGoldenShroom).Register("goldenShroom");
+      Core.objectWizShroom = new ObjectInfo(ObjectType.PLANT, new Item(12, 1, 0, 0, 0, new int[3], new int[3]), 16, textureWizShroom).Register("wizShroom");
+      Core.objectAncientCrystal = new ObjectInfo(ObjectType.ORE, new Item(57, 1, 0, 0, 0, new int[3], new int[3]), 106, textureAncientCrystal).Register("ancientCrystal");
+      Core.objectAncientCrystalCM = new ObjectInfo(ObjectType.ORE, new Item(57, 1, 0, 0, 0, new int[3], new int[3]), 106, textureAncientCrystal).Register("ancientCrystalCM");
+      Core.objectPlagueNest = new ObjectInfo(ObjectType.TREE, new Item(51, 1, 0, 0, 0, new int[3], new int[3]), 106, texturePlagueNest).Register("plagueNest");
+      Core.objectFrozenWisp = new ObjectInfo(ObjectType.ORE, new Item(3, 1, 0, 0, 0, new int[3], new int[3]), 16, textureFrozenWisp).Register("frozenWisp");
+      Core.objectMolten = new ObjectInfo(ObjectType.ORE, new Item(5, 1, 0, 0, 0, new int[3], new int[3]), 16, textureMolten).Register("molten");
+      CreatGoldenShroom("goldenShroom", GadgetCoreAPI.LoadTexture2D("entity/goldenShroomHead.png"), GadgetCoreAPI.LoadTexture2D("entity/goldenShroomTop.png"));
+      CreatGoldenShroomProjectile("goldenShroom", GadgetCoreAPI.LoadTexture2D("projectiles/goldenShroom.png"));
+
+      AlterObjectSpike(Core.objectSpikePlant, textureSpikePlantTop);
+      AlterObjectSpike(Core.objectSpikePlantCM, textureSpikePlantCMTop);
+
+      AlterObjectAncientCrystal(Core.objectAncientCrystal, textureAncientCrystalTop);
+      AlterObjectAncientCrystal(Core.objectAncientCrystalCM, textureAncientCrystalCMTop);
+    }
+
+    private void AlterObjectSpike(ObjectInfo info, Texture2D texture)
+    {
+      var obj = (GameObject)Resources.Load(info.ResourcePath);
+      obj.name = "plant";
+      var o = GameObject.Instantiate(obj.transform.GetChild(0).gameObject);
+      o.transform.SetParent(obj.transform);
+      o.transform.localPosition = obj.transform.GetChild(0).localPosition + new Vector3(0, 0.3125f * 1.5f, -1.05f);
+      var haz = o.AddComponent<HazardScript>();
+      haz.damage = 2;
+      var box = o.AddComponent<BoxCollider>();
+      box.size = new Vector3(1.25f, 1.25f, 4);
+      box.isTrigger = true;
+      obj.transform.GetChild(1).localPosition = new Vector3(0, 2.2f, 0);
+      var ani = o.GetComponent<Animation>();
+      ani.playAutomatically = true;
+      AnimationClip clip = new AnimationClip
+      {
+        name = "plantSquish",
+        wrapMode = WrapMode.Loop,
+        legacy = true
+      };
+      clip.SetCurve("", typeof(Transform), "m_LocalScale.x", new AnimationCurve(new Keyframe(0f, 1.9f, 0f, 0f), new Keyframe(0.371f, 2.1f, 0f, 0f), new Keyframe(1f, 1.9f, 0f, 0f)));
+      clip.SetCurve("", typeof(Transform), "m_LocalScale.y", new AnimationCurve(new Keyframe(0f, 2.1f, 0f, 0f), new Keyframe(0.442f, 1.9f, 0f, 0f), new Keyframe(1f, 2.1f, 0f, 0f)));
+      ani.RemoveClip("shake_0");
+      ani.AddClip(clip, "plantSquish");
+      ani.clip = clip;
+      o.GetComponent<Renderer>().material
+        = new Material(o.GetComponent<Renderer>().material) { mainTexture = texture };
+      GadgetCoreAPI.AddCustomResource(info.ResourcePath, obj);
+    }
+
+    private void AlterObjectAncientCrystal(ObjectInfo info, Texture2D texture)
+    {
+      var obj = (GameObject)Resources.Load(info.ResourcePath);
+      obj.name = "plant";
+      var o = GameObject.Instantiate(obj.transform.GetChild(0).gameObject);
+      o.transform.SetParent(obj.transform);
+      o.transform.localPosition = obj.transform.GetChild(0).localPosition + new Vector3(0, 0.3125f * 2f, 0);
+      obj.transform.GetChild(1).localPosition = new Vector3(0, 2.2f, 0);
+      var ani = o.GetComponent<Animation>();
+      ani.playAutomatically = true;
+      AnimationClip clip = new AnimationClip
+      {
+        name = "plantSquish",
+        wrapMode = WrapMode.Loop,
+        legacy = true
+      };
+      clip.SetCurve("", typeof(Transform), "m_LocalScale.x", new AnimationCurve(new Keyframe(0f, 1.8f, 0f, 0f), new Keyframe(0.171f, 2.1f, 0f, 0f), new Keyframe(0.5f, 1.8f, 0f, 0f)));
+      clip.SetCurve("", typeof(Transform), "m_LocalScale.y", new AnimationCurve(new Keyframe(0f, 2.1f, 0f, 0f), new Keyframe(0.142f, 1.8f, 0f, 0f), new Keyframe(0.5f, 2.1f, 0f, 0f)));
+      ani.RemoveClip("shake_0");
+      ani.AddClip(clip, "plantSquish");
+      ani.clip = clip;
+      o.GetComponent<Renderer>().material
+        = new Material(o.GetComponent<Renderer>().material) { mainTexture = texture };
+      GadgetCoreAPI.AddCustomResource(info.ResourcePath, obj);
+    }
+
+    private void CreatGoldenShroom(string name, Texture2D textureHead, Texture2D textureBody)
+    {
+      GameObject gameObject = Object.Instantiate<GameObject>((GameObject)Resources.Load("e/shroomy1"));
+      Renderer rendererHead = gameObject.transform.GetChild(0).GetChild(0).GetChild(1).GetComponentInChildren<Renderer>();
+      rendererHead.material = new Material(Shader.Find("Unlit/Transparent"))
+      {
+        mainTexture = textureHead
+      };
+      Renderer rendererBody = gameObject.transform.GetChild(0).GetChild(0).GetChild(0).GetComponentInChildren<Renderer>();
+      rendererBody.material = new Material(Shader.Find("Unlit/Transparent"))
+      {
+        mainTexture = textureBody
+      };
+
+      Component.DestroyImmediate(gameObject.GetComponent<RolandBall>());
+      gameObject.AddComponent<GoldenShroomScript>();
+
+      GadgetCoreAPI.AddCustomResource("e/MonsterNests/" + name, gameObject);
+    }
+
+    private void CreatGoldenShroomProjectile(string name, Texture2D texture)
+    {
+      GameObject gameObject = Object.Instantiate<GameObject>((GameObject)Resources.Load("proj/ballProj"));
+      Renderer rendererHead = gameObject.transform.GetChild(0).GetComponentInChildren<Renderer>();
+      rendererHead.material = new Material(Shader.Find("Unlit/Transparent"))
+      {
+        mainTexture = texture
+      };
+      Renderer rendererBody = gameObject.transform.GetChild(1).GetComponentInChildren<Renderer>();
+      rendererBody.material = new Material(Shader.Find("Unlit/Transparent"))
+      {
+        mainTexture = texture
+      };
+
+      gameObject.GetComponent<HazardScript>().damage = 8;
+
+      GadgetCoreAPI.AddCustomResource("proj/MonsterNests/" + name, gameObject);
+    }
+  }
+}

+ 146 - 0
MonsterNests.csproj

@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project Sdk="Microsoft.NET.Sdk">
+  <ImportGroup>
+    <Import Project="../GamePaths.xml" />
+  </ImportGroup>
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProjectGuid>{91AB81DE-EAEE-47D1-93DD-541179208219}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>MonsterNests</RootNamespace>
+    <AssemblyName>MonsterNests</AssemblyName>
+    <TargetFrameworks>net35</TargetFrameworks>
+    <FileAlignment>512</FileAlignment>
+    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
+    <Configurations>Release</Configurations>
+    <Authors>Zariteis</Authors>
+    <ApplicationIcon />
+    <StartupObject />
+    <Platforms>x86</Platforms>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugType>none</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net35|x86'">
+    <NoWarn>1701;1702</NoWarn>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="0Harmony">
+      <HintPath>$(GamePath)$(ManagedFolder)0Harmony.dll</HintPath>
+      <Private>false</Private>
+    </Reference>
+    <Reference Include="Assembly-CSharp">
+      <HintPath>$(GamePath)$(ManagedFolder)Assembly-CSharp.dll</HintPath>
+      <Private>false</Private>
+    </Reference>
+    <Reference Include="GadgetCore">
+      <HintPath>$(GamePath)$(ManagedFolder)GadgetCore.dll</HintPath>
+      <Private>false</Private>
+    </Reference>
+    <Reference Include="UnityEngine">
+      <HintPath>$(GamePath)$(ManagedFolder)UnityEngine.dll</HintPath>
+      <Private>false</Private>
+    </Reference>
+    <Reference Include="WindowsBase" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="ModInfo.txt">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+  </ItemGroup>
+  <UsingTask TaskName="GetFileVersion" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
+    <ParameterGroup>
+      <AssemblyPath ParameterType="System.String" Required="true" />
+      <Version ParameterType="System.String" Output="true" />
+      <TrimmedVersion ParameterType="System.String" Output="true" />
+    </ParameterGroup>
+    <Task>
+      <Using Namespace="System.Diagnostics" />
+      <Using Namespace="System.Text" />
+      <Using Namespace="System.Linq" />
+      <Code Type="Fragment" Language="cs">
+        <![CDATA[
+      this.Version = FileVersionInfo.GetVersionInfo(this.AssemblyPath).FileVersion;  
+      this.TrimmedVersion = this.Version.Split('.').TakeWhile(x => !x.Equals("0")).Aggregate(new StringBuilder(), (a, b) => { if (a.Length > 0) a.Append("."); a.Append(b); return a; }).ToString();
+      if (this.TrimmedVersion.IndexOf('.') == -1) this.TrimmedVersion += ".0";
+    ]]>
+      </Code>
+    </Task>
+  </UsingTask>
+  <Target Name="PostBuild" AfterTargets="PostBuildEvent">
+    <GetFileVersion AssemblyPath="$(TargetPath)">
+      <Output TaskParameter="Version" PropertyName="ModFullVersion" />
+      <Output TaskParameter="TrimmedVersion" PropertyName="AssemblyFileVersion" />
+    </GetFileVersion>
+    <ItemGroup>
+      <OldZip Include="$(TargetDir)$(AssemblyName)_v*.zip" />
+      <OldZip Include="$(GamePath)GadgetCore\Mods\$(AssemblyName)_v*.zip" />
+    </ItemGroup>
+    <Delete Files="@(OldZip)" />
+    <MakeDir Directories="$(TargetDir)..\BuildCache\" />
+    <ZipDirectory SourceDirectory="$(TargetDir)" DestinationFile="$(TargetDir)..\BuildCache\$(AssemblyName)_v$(AssemblyFileVersion).zip" />
+    <Copy SourceFiles="$(TargetDir)..\BuildCache\$(AssemblyName)_v$(AssemblyFileVersion).zip" DestinationFiles="$(TargetDir)$(AssemblyName)_v$(AssemblyFileVersion).zip" />
+    <RemoveDir Directories="$(TargetDir)..\BuildCache\" />
+    <MakeDir Directories="$(GamePath)GadgetCore\Mods\" />
+    <Copy SourceFiles="$(TargetDir)$(AssemblyName)_v$(AssemblyFileVersion).zip" DestinationFiles="$(GamePath)GadgetCore\Mods\$(AssemblyName)_v$(AssemblyFileVersion).zip" />
+    <Message Importance="High" Text="Mod Exported to $(GamePath)GadgetCore\Mods\$(AssemblyName)_v$(AssemblyFileVersion).zip" />
+  </Target>
+  <ItemGroup>
+    <None Update="Assets\**">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Manifest.ini">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Update="System">
+      <Private>false</Private>
+      <SpecificVersion>true</SpecificVersion>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Update="System.Data">
+      <EmbedInteropTypes>false</EmbedInteropTypes>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Update="System.Drawing">
+      <EmbedInteropTypes>false</EmbedInteropTypes>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Update="System.IO.Compression.FileSystem">
+      <EmbedInteropTypes>false</EmbedInteropTypes>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Update="System.Numerics">
+      <EmbedInteropTypes>false</EmbedInteropTypes>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Update="System.Runtime.Serialization">
+      <EmbedInteropTypes>false</EmbedInteropTypes>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Update="System.Xml">
+      <EmbedInteropTypes>false</EmbedInteropTypes>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Update="System.Xml.Linq">
+      <EmbedInteropTypes>false</EmbedInteropTypes>
+    </Reference>
+  </ItemGroup>
+</Project>

+ 22 - 0
MonsterNests.sln

@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.31729.503
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MonsterNests", "MonsterNests.csproj", "{91AB81DE-EAEE-47D1-93DD-541179208219}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{91AB81DE-EAEE-47D1-93DD-541179208219}.Release|x86.ActiveCfg = Release|x86
+		{91AB81DE-EAEE-47D1-93DD-541179208219}.Release|x86.Build.0 = Release|x86
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {D1BE5DE3-DC8B-4D54-9F05-E665688A71DE}
+	EndGlobalSection
+EndGlobal

+ 96 - 0
Patches/Patch_Chunk_SpawnBiomeSlot.cs

@@ -0,0 +1,96 @@
+using GadgetCore.API;
+using GadgetCore.Util;
+using HarmonyLib;
+using System.Collections;
+using System.Threading;
+using System.Windows.Threading;
+using UnityEngine;
+
+namespace MonsterNests.Patches
+{
+
+  [HarmonyPatch(typeof(Chunk))]
+  [HarmonyPatch("SpawnBiomeSlot")]
+  [HarmonyGadget("MonsterNests")]
+  public static class Patch_Chunk_SpawnBiomeSlot
+  {
+    [HarmonyPostfix]
+    public static bool Prefix(Chunk __instance, int a, int i, int mid, ref GameObject[] ___spawnSpot, ref GameObject[] ___spawnSpotMid, ref GameObject[] ___networkStuff, ref int ___temp)
+    {
+      Transform transform;
+      if (mid == 1)
+        transform = ___spawnSpotMid[i].transform;
+      else
+        transform = ___spawnSpot[i].transform;
+
+      int num = UnityEngine.Random.Range(0, 700);
+      if (num < 5)
+      {
+        if (a == 0)
+        {
+          if (Random.Range(0, 2) == 0)
+            ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectBugTree.Object, transform.position, Quaternion.identity, 0);
+          else
+            ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectBugspotBig.Object, transform.position, Quaternion.identity, 0);
+          ___temp++;
+          return false;
+        }
+        else if (a == 1)
+        {
+          if (GameScript.challengeLevel <= 0)
+            ___networkStuff[___temp] = (GameObject)Network.Instantiate((GameObject)Resources.Load(Core.objectSpikePlant.ResourcePath), transform.position, Quaternion.identity, 0);
+          else
+            ___networkStuff[___temp] = (GameObject)Network.Instantiate((GameObject)Resources.Load(Core.objectSpikePlantCM.ResourcePath), transform.position, Quaternion.identity, 0);
+          ___temp++;
+          return false;
+        }
+        else if (a == 2)
+        {
+          if (GameScript.challengeLevel <= 0)
+            ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectSpiderEgg.Object, transform.position, Quaternion.identity, 0);
+          else
+            ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectSpiderEggCM.Object, transform.position, Quaternion.identity, 0);
+          ___temp++;
+          return false;
+        }
+        else if (a == 3)
+        {
+          if (Random.Range(0, 2) == 0)
+            ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectGoldenShroom.Object, transform.position, Quaternion.identity, 0);
+          else
+            ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectWizShroom.Object, transform.position, Quaternion.identity, 0);
+          ___temp++;
+          return false;
+        }
+        else if (a == 4)
+        {
+          if (GameScript.challengeLevel <= 0)
+            ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectAncientCrystal.Object, transform.position, Quaternion.identity, 0);
+          else
+            ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectAncientCrystalCM.Object, transform.position, Quaternion.identity, 0);
+          ___temp++;
+          return false;
+        }
+        //else if (a == 5)
+        //{
+        //  ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectPlagueNest.Object, transform.position, Quaternion.identity, 0);
+        //  ___temp++;
+        //  return false;
+        //}
+        else if (a == 6)
+        {
+          ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectFrozenWisp.Object, transform.position, Quaternion.identity, 0);
+          ___temp++;
+          return false;
+        }
+        else if (a == 7)
+        {
+          ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectMolten.Object, transform.position, Quaternion.identity, 0);
+          ___temp++;
+          return false;
+        }
+      }
+      return true;
+    }
+  }
+}

+ 125 - 0
Patches/Patch_ObjectScript_Die.cs

@@ -0,0 +1,125 @@
+using GadgetCore.API;
+using GadgetCore.Util;
+using HarmonyLib;
+using System.Collections;
+using System.Threading;
+using System.Windows.Threading;
+using UnityEngine;
+
+namespace MonsterNests.Patches
+{
+
+  [HarmonyPatch(typeof(ObjectScript))]
+  [HarmonyPatch("Die")]
+  [HarmonyGadget("MonsterNests")]
+  public static class Patch_ObjectScript_Die
+  {
+    [HarmonyPostfix]
+    public static void Prefix(ObjectScript __instance, ref int ___id)
+    {
+      if (___id == Core.objectBugspotBig.GetID())
+      {
+        GameScript.cadetValue += 34;
+        __instance.StartCoroutine(Shake());
+        if (Network.isServer)
+          __instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 10, 6, "e/wasp", 0.1f));
+      }
+      if (___id == Core.objectBugTree.GetID())
+      {
+        GameScript.cadetValue += 34;
+        __instance.StartCoroutine(Shake());
+        if (Network.isServer)
+          __instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 10, 3, "e/wasp", 0.2f));
+      }
+      else if (___id == Core.objectSpikePlant.GetID())
+      {
+        GameScript.cadetValue += 34;
+        __instance.StartCoroutine(Shake());
+        if (Network.isServer)
+          __instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 0, 12, "haz/vinegas", 0.1f));
+      }
+      else if (___id == Core.objectSpikePlantCM.GetID())
+      {
+        GameScript.cadetValue += 34;
+        __instance.StartCoroutine(Shake());
+        if (Network.isServer)
+          __instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 0, 6, "e/sliver", 0.3f));
+      }
+      else if (___id == Core.objectSpiderEgg.GetID() || ___id == Core.objectSpiderEggCM.GetID())
+      {
+        GameScript.cadetValue += 34;
+        __instance.StartCoroutine(Shake());
+        if (Network.isServer)
+          __instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 4, 10, "e/rockspider", 0.3f));
+      }
+      else if (___id == Core.objectWizShroom.GetID() || ___id == Core.objectSpiderEggCM.GetID())
+      {
+        GameScript.cadetValue += 34;
+        __instance.StartCoroutine(Shake());
+        if (Network.isServer)
+        Network.Instantiate(Resources.Load("e/Shroomwizard"), new Vector3(__instance.transform.position.x, __instance.transform.position.y + 5f, 0f), Quaternion.identity, 0);
+      }
+      else if (___id == Core.objectGoldenShroom.GetID())
+      {
+        GameScript.cadetValue += 34;
+        __instance.StartCoroutine(Shake());
+        if (Network.isServer)
+          Network.Instantiate(Resources.Load("e/MonsterNests/goldenShroom"), new Vector3(__instance.transform.position.x, __instance.transform.position.y + 1.1f, 0f), Quaternion.identity, 0);
+      }
+      else if (___id == Core.objectAncientCrystal.GetID() || ___id == Core.objectAncientCrystalCM.GetID())
+      {
+        GameScript.cadetValue += 34;
+        __instance.StartCoroutine(Shake());
+        if (Network.isServer)
+          Network.Instantiate(Resources.Load("e/golem"), new Vector3(__instance.transform.position.x, __instance.transform.position.y + 1.1f, 0f), Quaternion.identity, 0);
+      }
+      else if (___id == Core.objectPlagueNest.GetID())
+      {
+        GameScript.cadetValue += 34;
+        __instance.StartCoroutine(Shake());
+        if (Network.isServer) ;
+        //Network.Instantiate(Resources.Load("e/plaguebeast"), new Vector3(__instance.transform.position.x, __instance.transform.position.y + 1.1f, 0f), Quaternion.identity, 0);
+      }
+      else if (___id == Core.objectFrozenWisp.GetID())
+      {
+        GameScript.cadetValue += 34;
+        __instance.StartCoroutine(Shake());
+        if (Network.isServer)
+          __instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 5, 6, "e/wisp", 0.35f));
+      }
+      else if (___id == Core.objectMolten.GetID())
+      {
+        GameScript.cadetValue += 34;
+        __instance.StartCoroutine(Shake());
+        if (Network.isServer)
+          __instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 5, 6, "e/wyvern", 0.35f));
+      }
+    }
+
+    private static IEnumerator Shake()
+    {
+      Camera.main.GetComponent<Animation>().Play("shake");
+      yield return new WaitForSeconds(1.0f);
+      Camera.main.GetComponent<Animation>().Stop();
+      Camera.main.transform.eulerAngles = new Vector3(0f, 0f, 0f);
+      yield break;
+    }
+
+    private static IEnumerator SpawnMultiple(float xBase, float yBase, float range, int amount, string name, float speed)
+    {
+      for (int i = 0; i < amount; i++)
+      {
+        int x = 0;
+        int y = 0;
+        if (range > 0)
+        {
+          x = Random.Range(-1 * (int)(range * 10), (int)(range * 10));
+          y = Random.Range(-1 * (int)(range * 10), (int)(range * 10));
+        }
+        Network.Instantiate(Resources.Load(name), new Vector3(xBase + x / 10f, yBase + 1.1f + y / 10f, 0f), Quaternion.identity, 0);
+        yield return new WaitForSeconds(speed);
+      }
+      yield break;
+    }
+  }
+}

+ 10 - 0
Properties/AssemblyInfo.cs

@@ -0,0 +1,10 @@
+using System.Reflection;
+using static MonsterNests.MonsterNests;
+
+[assembly: AssemblyProduct("MonsterNests")] //Set this to the full name of the mod including spaces.
+[assembly: AssemblyTitle("ScrapYard")] //This is only used when mousing over a dll file in Windows explorer.
+[assembly: AssemblyDescription("A Gadget mod for Roguelands, adding a space planet.")] //This is a short description for your mod's assembly.
+[assembly: AssemblyCompany("")] //Set this to your name/nickname and/or website
+[assembly: AssemblyCopyright("© 2021 Zariteis. All rights reserved.")] //Set this to your copyright name.
+[assembly: AssemblyVersion(MOD_VERSION)]
+[assembly: AssemblyFileVersion(MOD_VERSION)]

+ 8 - 0
Properties/launchSettings.json

@@ -0,0 +1,8 @@
+{
+  "profiles": {
+    "MonsterNests": {
+      "commandName": "Executable",
+      "executablePath": "C:\\Program Files (x86)\\Steam\\steamapps\\common\\Roguelands\\Roguelands.exe"
+    }
+  }
+}

+ 15 - 0
README.txt

@@ -0,0 +1,15 @@
+In addition to changing all references to "Template" this and that to a more appropriate name,
+you need to add a file called "GamePaths.xml" to the folder ABOVE where you put this template, with the following content:
+
+<?xml version="1.0" encoding="utf-8"?>
+<Project>
+  <PropertyGroup>
+    <!-- Set this full path to your game folder. Must contain a slash at the end. -->
+    <GamePath>C:\Program Files (x86)\Steam\steamapps\common\Roguelands\</GamePath>
+
+    <!-- Set this partial path to the game's Managed folder. Must contain a slash at the end. -->
+    <ManagedFolder>Roguelands_Data\Managed\</ManagedFolder>
+  </PropertyGroup>
+</Project>
+
+Note that `GamePath` may need to be changed, depending on the nature of your installation.

+ 130 - 0
Scripts/GoldenShroomScript.cs

@@ -0,0 +1,130 @@
+using System.Collections;
+using UnityEngine;
+
+namespace MonsterNests.Scripts
+{
+  class GoldenShroomScript : EnemyScript
+  {
+
+    private bool attacking;
+    private Vector3 dir;
+    private bool moving;
+    private float spd;
+    private bool shooting;
+
+    private void Awake()
+    {
+      r = gameObject.GetComponent<Rigidbody>();
+      t = transform;
+      b = transform.GetChild(0).GetChild(0).gameObject;
+      e = transform.GetChild(0).gameObject;
+
+      networkR2 = gameObject.GetComponent<NetworkR2>();
+
+      trig[0] = gameObject.transform.GetChild(1).gameObject;
+      trig[1] = gameObject.transform.GetChild(2).gameObject;
+
+      var drops = new int[] { 24, 53, 53 };
+      Initialize(750, 8, 103, drops, 50);
+      if (Network.isServer)
+      {
+        base.StartCoroutine(this.Bolt());
+      }
+    }
+
+    [RPC]
+    private void MakeFace()
+    {
+      base.GetComponent<AudioSource>().PlayOneShot((AudioClip)Resources.Load("Au/roll"), Menuu.soundLevel / 10f);
+    }
+
+
+    private IEnumerator MF()
+    {
+      yield return new WaitForSeconds(0.8f);
+      yield break;
+    }
+
+
+    private IEnumerator Bolt()
+    {
+      for (; ; )
+      {
+        if (this.target && Vector3.Distance(this.target.transform.position, this.t.position) < 20f)
+        {
+          this.shooting = true;
+          base.GetComponent<NetworkView>().RPC("MakeFace", RPCMode.All, new object[0]);
+          yield return new WaitForSeconds(0.2f);
+          for (int i = 0; i < 3; i++)
+          {
+            GameObject p = (GameObject)Network.Instantiate(Resources.Load("proj/MonsterNests/goldenShroom"), this.t.position + new Vector3(0, i - 1, 0), Quaternion.identity, 0);
+            p.SendMessage("EnemySet", this.target.transform.position, SendMessageOptions.DontRequireReceiver);
+          }
+          yield return new WaitForSeconds(0.5f);
+          this.shooting = false;
+        }
+        yield return new WaitForSeconds(2f);
+      }
+      yield break;
+    }
+
+
+    private void Update()
+    {
+      if (Network.isServer)
+      {
+        if (this.target)
+        {
+          if (Mathf.Abs(this.target.transform.position.x - this.t.position.x) < 80f)
+          {
+            if (!this.attacking)
+            {
+              this.attacking = true;
+              base.StartCoroutine(this.Attack());
+            }
+          }
+          else
+          {
+            this.target = null;
+            this.r.velocity = new Vector3(0f, 0f, 0f);
+          }
+        }
+        if (this.moving && !this.knocking && !this.shooting)
+        {
+          this.r.velocity = this.dir * this.spd;
+        }
+      }
+    }
+
+
+    private IEnumerator Attack()
+    {
+      if (this.target.transform.position.x > this.t.position.x)
+      {
+        this.e.transform.rotation = Quaternion.Euler(0f, 180f, 0f);
+      }
+      else
+      {
+        this.e.transform.rotation = Quaternion.Euler(0f, 0f, 0f);
+      }
+      if (UnityEngine.Random.Range(0, 4) == 0)
+      {
+        this.spd = 3f;
+        this.dir = this.t.position - this.target.transform.position;
+      }
+      else
+      {
+        this.spd = 12f;
+        Vector3 a = new Vector3(this.target.transform.position.x, this.target.transform.position.y + (float)UnityEngine.Random.Range(-15, 15), 0f);
+        this.dir = a - this.t.position;
+      }
+      this.dir.Normalize();
+      this.moving = true;
+      yield return new WaitForSeconds((float)UnityEngine.Random.Range(1, 3) * 0.2f);
+      this.moving = false;
+      yield return new WaitForSeconds(0.5f);
+      this.attacking = false;
+      yield break;
+    }
+  }
+}