public void Awake() { On.EntityStates.ClaymanMonster.SwipeForward.OnEnter += (orig, self) => { EntityStates.ClaymanMonster.SwipeForward.attackString = "Play_merc_sword_swing"; EntityStates.ClaymanMonster.SwipeForward.selfForceMagnitude = 1800f; EntityStates.ClaymanMonster.SwipeForward.baseDuration = 1f; EntityStates.ClaymanMonster.SwipeForward.damageCoefficient = 1.4f; orig(self); }; On.EntityStates.ClaymanMonster.Leap.OnEnter += (orig, self) => { EntityStates.ClaymanMonster.Leap.verticalJumpSpeed = 20f; EntityStates.ClaymanMonster.Leap.horizontalJumpSpeedCoefficient = 2.3f; orig(self); }; On.EntityStates.ClaymanMonster.SpawnState.OnEnter += (orig, self) => { EntityStates.ClaymanMonster.SpawnState.duration = 3.2f; orig(self); }; clayObject = PrefabAPI.InstantiateClone(Resources.Load <GameObject>("prefabs/characterbodies/ClayBody"), "MoffeinClayManBody", true); clayMaster = PrefabAPI.InstantiateClone(Resources.Load <GameObject>("prefabs/charactermasters/ClaymanMaster"), "MoffeinClayManMaster", true); CharacterSpawnCard beetleCSC = Resources.Load <CharacterSpawnCard>("SpawnCards/CharacterSpawnCards/cscBeetle"); //CharacterSpawnCard clayBossCSC = Resources.Load<CharacterSpawnCard>("SpawnCards/CharacterSpawnCards/cscClayBoss"); ModifyClayMan(); ItemDisplays.DisplayRules(clayObject); CharacterSpawnCard clayManCSC = ScriptableObject.CreateInstance <CharacterSpawnCard>(); clayManCSC.name = "cscClayMan"; clayManCSC.prefab = clayMaster; clayManCSC.sendOverNetwork = true; clayManCSC.hullSize = HullClassification.Human; clayManCSC.nodeGraphType = MapNodeGroup.GraphType.Ground; clayManCSC.requiredFlags = NodeFlags.None; clayManCSC.forbiddenFlags = NodeFlags.NoCharacterSpawn; clayManCSC.directorCreditCost = 16; clayManCSC.occupyPosition = false; clayManCSC.loadout = new SerializableLoadout(); clayManCSC.noElites = false; clayManCSC.forbiddenAsBoss = false; DirectorCard clayManDC = new DirectorCard { spawnCard = clayManCSC, selectionWeight = 1, allowAmbushSpawn = true, preventOverhead = false, minimumStageCompletions = 0, spawnDistance = DirectorCore.MonsterSpawnDistance.Close }; DirectorAPI.DirectorCardHolder clayManCard = new DirectorAPI.DirectorCardHolder { Card = clayManDC, MonsterCategory = DirectorAPI.MonsterCategory.BasicMonsters, InteractableCategory = DirectorAPI.InteractableCategory.None }; //This causes errors /*DirectorAPI.FamilyActions += delegate (List<DirectorAPI.MonsterFamilyHolder> list, DirectorAPI.StageInfo stage) * { * foreach (DirectorAPI.MonsterFamilyHolder holder in list) * { * foreach (DirectorCard dC in holder.FamilyChampions) * { * if (dC.spawnCard == clayBossCSC) * { * if (!holder.FamilyBasicMonsters.Contains(clayManDC)) * { * holder.FamilyBasicMonsters.Add(clayManDC); * } * } * } * } * };*/ DirectorAPI.MonsterActions += delegate(List <DirectorAPI.DirectorCardHolder> list, DirectorAPI.StageInfo stage) { bool addClayMan = false; switch (stage.stage) { case DirectorAPI.Stage.ArtifactReliquary: case DirectorAPI.Stage.VoidCell: case DirectorAPI.Stage.AbandonedAqueduct: case DirectorAPI.Stage.RallypointDelta: foreach (DirectorAPI.DirectorCardHolder dc in list) { if (dc.Card.spawnCard == beetleCSC) { dc.Card.selectionWeight = 1; } } addClayMan = true; break; case DirectorAPI.Stage.ScorchedAcres: addClayMan = true; foreach (DirectorAPI.DirectorCardHolder dc in list) { if (dc.Card.spawnCard == beetleCSC) { dc.Card.selectionWeight = 0; } } break; case DirectorAPI.Stage.Custom: if (stage.CustomStageName == "rootjungle") { addClayMan = true; } break; default: break; } if (addClayMan) { if (!list.Contains(clayManCard)) { list.Add(clayManCard); } } }; On.EntityStates.ClaymanMonster.SpawnState.OnEnter += (orig, self) => { orig(self); Util.PlayAttackSpeedSound("Play_clayBruiser_attack2_shoot", self.outer.gameObject, 1f); }; ContentManager.collectContentPackProviders += ContentManager_collectContentPackProviders; }
public void Start() { ItemDisplays.DisplayRules(clayObject); }