-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMSCSpawnMenu.cs
522 lines (480 loc) · 24 KB
/
MSCSpawnMenu.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using HutongGames.PlayMaker;
using MSCLoader;
using UnityEngine;
using UnityEngine.UI;
using Object = UnityEngine.Object;
using Resources = MSCSpawnMenu.Properties.Resources;
namespace MSCSpawnMenu
{
public class MscSpawnMenu : Mod
{
public enum Categories
{
All,
Furniture,
Ragdolls,
Other
}
public static Dictionary<Dictionary<string, GameObject>, Categories> List;
public static Dictionary<string, GameObject> MscCharacters;
public static Dictionary<string, GameObject> MscFurniture;
//public string path = Path.GetFullPath("CustomSpawnMenuItems");
public static Dictionary<string, GameObject> MscItems;
public static Dictionary<string, Image> Icons;
public static GameObject IconGen;
public string[] Blacklist = { "Use", "Chop" };
public GameObject Grid;
public RectTransform GridTransform;
public GameObject Item;
public int ItemsSpawned;
public Keybind Open = new Keybind("openmenu", "Open the spawn menu", KeyCode.Y);
public FsmBool PlayerInMenu;
public int RagdollsSpawned;
public GameObject Tabs;
public GameObject Ui;
public override string ID => "MSCSpawnMenu";
public override string Name => "Spawn Menu";
public override string Author => "michu97736";
public override string Version => $"{Assembly.GetExecutingAssembly().GetName().Version.Major}.{Assembly.GetExecutingAssembly().GetName().Version.Minor}.{Assembly.GetExecutingAssembly().GetName().Version.Build}";
public override string Description => "";
public override void ModSetup()
{
SetupFunction(Setup.OnLoad, Mod_OnLoad);
SetupFunction(Setup.ModSettings, Mod_Settings);
SetupFunction(Setup.Update, Mod_Update);
SetupFunction(Setup.OnMenuLoad, Mod_OnMenuLoad);
SetupFunction(Setup.OnSave, Mod_OnSave);
}
private void Mod_Settings() => Keybind.Add(this, Open);
private void Mod_OnMenuLoad()
{
if (!ModLoader.IsModPresent("AchievementCore"))
{
return;
}
else
{
Achievement.CreateAchievement("MSCSpawnMenu_FirstSpawn", ID, "Achievement Get!",
"You spawned your first item!", null, false);
Achievement.CreateAchievement("MSCSpawnMenu_150Ragdolls", ID, "Achievement Get!",
"You spawned 150 ragdolls!", null, false);
Achievement.CreateAchievement("MSCSpawnMenu_500Ragdolls", ID, "Achievement Get!",
"You (somehow) spawned 500 ragdolls!", null, false);
Achievement.CreateAchievement("MSCSpawnMenu_150Items", ID, "Achievement Get!", "You spawned 150 items!",
null, false);
Achievement.CreateAchievement("MSCSpawnMenu_500Items", ID, "Achievement Get!",
"You (somehow)spawned 500 items!", null, false);
}
}
private void Search(string phrase)
{
ClearItems();
foreach (var category in List)
{
foreach (var item in category.Key)
{
if (item.Key.IndexOf(phrase, 0, StringComparison.CurrentCultureIgnoreCase) != -1)
{
AddToView(new Dictionary<string, GameObject> { { item.Key, item.Value } });
}
}
}
}
private void Mod_OnLoad()
{
var bundle = AssetBundle.CreateFromMemoryImmediate(Resources.spawnmenu);
Ui = Object.Instantiate(bundle.LoadAsset<GameObject>("SpawnMenuUI.prefab"));
Item = Object.Instantiate(bundle.LoadAsset<GameObject>("Item.prefab"));
IconGen = Object.Instantiate(bundle.LoadAsset<GameObject>("ThumbnailGen.prefab"));
IconGen.AddComponent<ThumbnailGenerator>();
Item.AddComponent<Item>();
List = new Dictionary<Dictionary<string, GameObject>, Categories>();
MscFurniture = new Dictionary<string, GameObject>();
MscCharacters = new Dictionary<string, GameObject>();
MscItems = new Dictionary<string, GameObject>();
ItemInit();
Add(MscFurniture, Categories.Furniture);
Add(MscCharacters, Categories.Ragdolls);
Add(MscItems, Categories.Other);
PlayerInMenu = FsmVariables.GlobalVariables.GetFsmBool("PlayerInMenu");
var transform = ModUI.CreateCanvas("SpawnMenu UI").transform;
transform.GetComponent<CanvasScaler>().screenMatchMode = CanvasScaler.ScreenMatchMode.Shrink;
Ui.transform.SetParent(transform, false);
Grid = Ui.transform.Find("Content/Grid").gameObject;
Tabs = Ui.transform.Find("Header/Categories").gameObject;
for (var i = 0; i < Tabs.transform.childCount; i++)
{
var transform1 = Tabs.transform.GetChild(i);
transform1.GetComponent<Toggle>().onValueChanged.AddListener(delegate
{
ChangeCategory((Categories)int.Parse(transform1.name));
});
}
//IconSetup();
Ui.transform.Find("Header/InputField").GetComponent<InputField>().onValueChange.AddListener(Search);
Ui.SetActive(false);
ItemsSpawned = SaveLoad.ReadValue<int>(this, "ItemsSpawned");
RagdollsSpawned = SaveLoad.ReadValue<int>(this, "RagdollsSpawned");
bundle.Unload(false);
}
public void EditRagdoll(GameObject thisRagdoll, SkinnedMeshRenderer yourRagdollBodyMesh, bool changesBodymesh,
bool usesGlasses, GameObject glassesPath)
{
thisRagdoll.transform.Find("bodymesh").GetComponent<SkinnedMeshRenderer>().materials[0].mainTexture =
yourRagdollBodyMesh.sharedMaterials[0].mainTexture;
thisRagdoll.transform.Find("bodymesh").GetComponent<SkinnedMeshRenderer>().materials[1].mainTexture =
yourRagdollBodyMesh.sharedMaterials[1].mainTexture;
thisRagdoll.transform.Find("bodymesh").GetComponent<SkinnedMeshRenderer>().materials[2].mainTexture =
yourRagdollBodyMesh.sharedMaterials[2].mainTexture;
if (changesBodymesh)
{
thisRagdoll.transform.Find("bodymesh").GetComponent<SkinnedMeshRenderer>().sharedMesh =
yourRagdollBodyMesh.sharedMesh;
}
if (usesGlasses && glassesPath != null)
{
var glasses = Object.Instantiate(glassesPath);
glasses.transform.SetParent(thisRagdoll.transform.Find("pelvis/spine_mid/shoulders(xxxxx)/head"));
glasses.transform.localPosition = glassesPath.transform.localPosition;
glasses.transform.localEulerAngles = glassesPath.transform.localEulerAngles;
glasses.name = "eye_glasses_regular";
}
thisRagdoll.name = "RagDoll";
thisRagdoll.SetActive(false);
}
private void SpawnItem(KeyValuePair<string, GameObject> pair)
{
var isRagdoll = false;
var item = Object.Instantiate(pair.Value);
item.name = pair.Key + "(itemx)";
item.SetActive(true);
item.tag = "PART";
item.layer = 19;
if (item.GetComponent<PlayMakerFSM>() != null && item.GetComponent<PlayMakerFSM>().name == "Save")
{
Object.Destroy(item.GetComponent<PlayMakerFSM>());
}
if (item.GetComponent<Joint>() != null)
{
Object.Destroy(item.GetComponent<Joint>());
}
item.GetComponent<Rigidbody>().isKinematic = false;
item.transform.localPosition = GameObject.Find("PLAYER").transform.localPosition;
if (!ModLoader.IsModPresent("AchievementCore"))
{
return;
}
if (item.transform.Find("bodymesh") != null)
{
RagdollsSpawned++;
switch (RagdollsSpawned)
{
case int n when (n >= 150):
Achievement.TriggerAchievement("MSCSpawnMenu_150Ragdolls");
break;
case int n when (n >= 500):
Achievement.TriggerAchievement("MSCSpawnMenu_500Ragdolls");
break;
}
}
else
{
ItemsSpawned++;
switch (ItemsSpawned)
{
case int n when(n >=150):
Achievement.TriggerAchievement("MSCSpawnMenu_150Items");
break;
case int n when (n >= 500):
Achievement.TriggerAchievement("MSCSpawnMenu_500Items");
break;
}
}
if (!Achievement.IsAchievementUnlocked("MSCSpawnMenu_FirstSpawn"))
{
Achievement.TriggerAchievement("MSCSpawnMenu_FirstSpawn");
}
}
public void ChangeCategory(Categories cat = default)
{
ClearItems();
switch (cat)
{
case Categories.All:
foreach (var item in List)
{
AddToView(item.Key);
}
break;
default:
foreach (var item in List.Where(item => item.Value == cat))
{
AddToView(item.Key);
}
break;
}
//AlignGrid();
}
public void ClearItems()
{
foreach (Transform child in Grid.transform)
{
Object.Destroy(child.gameObject);
}
}
public void OpenMenu()
{
if (!Ui.activeSelf)
{
Ui.SetActive(true);
PlayerInMenu.Value = true;
}
else
{
Ui.SetActive(false);
PlayerInMenu.Value = false;
}
}
private void AddToView(Dictionary<string, GameObject> dict)
{
foreach (var item in dict)
{
var gameobjectitem = Object.Instantiate(Item);
gameobjectitem.transform.Find("Button").GetComponent<Button>().onClick
.AddListener(() => SpawnItem(item));
gameobjectitem.GetComponent<Item>().Text = item.Key.ToUpper();
gameobjectitem.GetComponent<Item>().item = item.Value;
//gameobjectitem.transform.Find("ItemImage").GetComponent<Image>().sprite = Icons[item.Key].sprite;
gameobjectitem.transform.SetParent(Grid.transform);
gameobjectitem.transform.localScale = new Vector3(1, 1, 1);
}
}
public static void Add(Dictionary<string, GameObject> dict, Categories cat) => List.Add(dict, cat);
public static void Add(string itemName, GameObject gameObject, Categories cat)
{
switch (cat)
{
case Categories.Furniture:
MscFurniture.Add(itemName, gameObject);
break;
case Categories.Other:
MscItems.Add(itemName, gameObject);
break;
case Categories.Ragdolls:
MscCharacters.Add(itemName, gameObject);
break;
}
}
public void ItemInit()
{
var stuff = GameObject.Find("JOBS/HouseDrunk/").transform.Find("Moving/Stuff").gameObject;
var otherstuff = GameObject.Find("JOBS/HouseDrunk").transform.Find("Moving/Stuff/DestroyThese").gameObject;
MscFurniture.Add("TV table", stuff.transform.Find("table(Clo02)").gameObject);
ModConsole.Log(ID + ": Loading furniture");
MscFurniture.Add("kitchen table", stuff.transform.Find("table(Clo03)").gameObject);
MscFurniture.Add("bedside table", stuff.transform.Find("table(Clo04)").gameObject);
MscFurniture.Add("coffee table", stuff.transform.Find("table(Clo05)").gameObject);
MscFurniture.Add("chair", stuff.transform.Find("chair(Clo02)").gameObject);
MscFurniture.Add("bench", stuff.transform.Find("bench(Clo01)").gameObject);
MscFurniture.Add("arm chair", stuff.transform.Find("arm chair(Clo01)").gameObject);
MscFurniture.Add("tv", stuff.transform.Find("tv(Clo01)").gameObject);
MscFurniture.Add("desk", stuff.transform.Find("desk(Clo01)").gameObject);
MscFurniture.Add("mattress", otherstuff.transform.Find("mattress(Clo02)").gameObject);
MscFurniture.Add("box", otherstuff.transform.Find("box(Clo02)").gameObject);
ModConsole.Log(ID + ": Loading ragdolls");
var humans = GameObject.Find("HUMANS").transform.Find("Randomizer/Walkers").gameObject;
var jokke = GameObject.Find("KILJUGUY/HikerPivot").transform.Find("JokkeHiker2").gameObject;
var npccars = GameObject.Find("NPC_CARS");
var kylajani = npccars.GetPlayMaker("Amis Setup").FsmVariables.GetFsmGameObject("Amikset").Value.transform
.Find("CrashEvent").gameObject;
var petteri = npccars.GetPlayMaker("Amis2 Setup").FsmVariables.GetFsmGameObject("Amikset").Value.transform
.Find("CrashEvent").gameObject;
var latanen = npccars.GetPlayMaker("Bus Setup").FsmVariables.GetFsmGameObject("Bus").Value.transform
.Find("Latanen/Pivot").gameObject;
var pena = GameObject.Find("TRAFFIC").transform.Find("VehiclesDirtRoad/Rally/FITTAN/CrashEvent").gameObject;
var caravan = GameObject.Find("TRAFFIC").transform.Find("VehiclesHighway/POLSA/CARAVAN").gameObject;
MscCharacters.Add("Kale", humans.transform.Find("Kale/Pivot/RagDoll").gameObject);
MscCharacters.Add("Julli", humans.transform.Find("Julli/Pivot/RagDoll").gameObject);
MscCharacters.Add("Kristian", humans.transform.Find("Kristian/Pivot/RagDoll").gameObject);
MscCharacters.Add("Unto", humans.transform.Find("Unto/Pivot/RagDoll").gameObject);
MscCharacters.Add("Rauno", humans.transform.Find("Rauno/Pivot/RagDoll").gameObject);
MscCharacters.Add("Alpo", humans.transform.Find("Alpo/Pivot/RagDoll").gameObject);
MscCharacters.Add("Tohvakka", GameObject.Find("HUMANS/Farmer").transform.Find("Walker/RagDoll").gameObject);
MscCharacters.Add("Jokke", jokke.transform.Find("RagDoll").gameObject);
MscCharacters.Add("Suski", kylajani.transform.GetChild(1).gameObject);
MscCharacters.Add("Jani", kylajani.transform.GetChild(2).gameObject);
MscCharacters.Add("Petteri", petteri.transform.GetChild(1).gameObject);
MscCharacters.Add("Teimo", GameObject.Find("STORE/TeimoInBike/Bicycle").transform.Find("Functions/Teimo/RagDoll").gameObject);
MscCharacters.Add("Latanen", latanen.transform.GetChild(3).gameObject);
MscCharacters.Add("Grandma", GameObject.Find("ChurchGrandma/GrannyHiker").transform.Find("RagDoll2").gameObject);
MscCharacters.Add("Pena", pena.transform.Find("RagDoll").gameObject);
GameObject sausages = null;
GameObject moose = null;
GameObject foodTray = null;
GameObject Sausagesfries = null;
GameObject vodkaShot = null;
GameObject beerBottle = null;
ModConsole.Log(ID + ": Loading items");
var arrayItems = UnityEngine.Resources.FindObjectsOfTypeAll<Transform>();
foreach (var gameobject in arrayItems)
{
if (gameobject.name == "sausages")
{
sausages = gameobject.gameObject;
}
if (gameobject.name == "tray")
{
foodTray = gameobject.gameObject;
}
if (gameobject.name == "Sausage-Potatoes")
{
Sausagesfries = gameobject.gameObject;
}
if (gameobject.name == "VodkaShot" && gameobject.hideFlags == HideFlags.HideInHierarchy)
{
vodkaShot = gameobject.gameObject;
}
if (gameobject.name == "Beer" && gameobject.hideFlags == HideFlags.HideInHierarchy)
{
beerBottle = gameobject.gameObject;
}
if (ModLoader.IsModPresent("MooseHunter"))
{
if (gameobject.name == "dead moose(xxxxx)(Clone)")
{
moose = gameobject.gameObject;
}
}
else
{
if (gameobject.name == "dead moose(xxxxx)")
{
moose = gameobject.gameObject;
}
}
}
MscCharacters.Add("Moose", moose);
MscItems.Add("Sausages", sausages);
MscItems.Add("Food Tray", foodTray);
MscItems.Add("Sausage with fries", Sausagesfries);
MscItems.Add("Vodka shot", vodkaShot);
MscItems.Add("Beer bottle", beerBottle);
MscItems.Add("Caravan", caravan);
MscItems.Add("Garbage barrel", GameObject.Find("ITEMS/garbage barrel(itemx)"));
var bicycle = Object.Instantiate(GameObject.Find("STORE/TeimoInBike/Bicycle").transform
.Find("Functions/bicycle").gameObject);
var box = bicycle.AddComponent<BoxCollider>();
box.size = bicycle.transform.Find("coll").GetComponents<BoxCollider>()[0].size;
box.center = bicycle.transform.Find("coll").GetComponents<BoxCollider>()[0].center;
bicycle.SetActive(false);
MscItems.Add("Bicycle", bicycle);
//var flashlight = Object.Instantiate(GameObject.Find("flashlight(itemx)"));
//flashlight.name = "flashlight(spawnmenu)";
//flashlight.transform.Find("ChangeBatteries/Insert").GetPlayMaker("Assembly").FsmVariables
// .GetFsmInt("Batteries").Value = 4;
//Object.Destroy(flashlight.transform.Find("FlashLight").GetPlayMaker("Charge"));
//Object.Destroy(flashlight.transform.Find("Open"));
//flashlight.transform.Find("FlashLight").GetComponent<Light>().intensity = 8;
//flashlight.SetActive(false);
//MscItems.Add("Flashlight", flashlight);
MscItems.Add("Ax", GameObject.Find("ITEMS/ax(itemx)"));
MscItems.Add("Hammer", GameObject.Find("ITEMS/sledgehammer(itemx)"));
//Fleetari
var fleetariragdoll = Object.Instantiate(humans.transform.Find("Julli/Pivot/RagDoll").gameObject);
EditRagdoll(fleetariragdoll,
GameObject.Find("REPAIRSHOP").transform.Find("LOD/Office/Fleetari/Neighbour 2/bodymesh")
.GetComponent<SkinnedMeshRenderer>(), true, true, GameObject.Find("REPAIRSHOP").transform.Find(
"LOD/Office/Fleetari/Neighbour 2/skeleton/pelvis/spine_middle/spine_upper/HeadPivot/head/Shades/eye_glasses_regular")
.gameObject);
ModConsole.Print("Fleetari loaded");
//Servant
GameObject waterFacility;
GameObject servantRagdoll = null;
foreach (var transform in arrayItems)
{
if (transform.gameObject.name == "WATERFACILITY")
{
waterFacility = transform.gameObject;
servantRagdoll = Object.Instantiate(humans.transform.Find("Julli/Pivot/RagDoll").gameObject);
EditRagdoll(servantRagdoll,
waterFacility.transform.Find("LOD/Functions/Servant/Pivot/Shitman/bodymesh")
.GetComponent<SkinnedMeshRenderer>(), true, true,
waterFacility.transform
.Find(
"LOD/Functions/Servant/Pivot/Shitman/skeleton/pelvis/spine_middle/spine_upper/HeadPivot/head/eye_glasses_regular")
.gameObject);
}
}
ModConsole.Print("Servant loaded");
//Strawberrry guy
var berrymanragdoll = Object.Instantiate(humans.transform.Find("Julli/Pivot/RagDoll").gameObject);
EditRagdoll(berrymanragdoll,
GameObject.Find("JOBS").transform.Find("StrawberryField/LOD/Functions/Berryman/Pivot/Berryman/bodymesh")
.GetComponent<SkinnedMeshRenderer>(), true, true,
GameObject.Find("JOBS").transform
.Find(
"StrawberryField/LOD/Functions/Berryman/Pivot/Berryman/skeleton/pelvis/spine_middle/spine_upper/HeadPivot/head/Accessories 1")
.gameObject);
ModConsole.Print("Strawberry guy loaded");
//Lindell
var lindellRagdoll = Object.Instantiate(humans.transform.Find("Julli/Pivot/RagDoll").gameObject);
EditRagdoll(lindellRagdoll,
GameObject.Find("INSPECTION").transform.Find("LOD/Officer/Work/Char/bodymesh")
.GetComponent<SkinnedMeshRenderer>(), true, false, null);
//Kuski
var kuskiRagdoll =
Object.Instantiate(GameObject.Find("NPC_CARS").transform.Find("KUSKI/CrashEvent/RagDoll").gameObject);
ModConsole.Print("kuski loaded");
//Kuski's brother
var kuskiBrother = Object.Instantiate(humans.transform.Find("Julli/Pivot/RagDoll").gameObject);
EditRagdoll(kuskiBrother,
GameObject.Find("NPC_CARS").transform.Find("KUSKI/Passenger/bodymesh")
.GetComponent<SkinnedMeshRenderer>(), true, true,
GameObject.Find("NPC_CARS").transform.Find("KUSKI/Passenger/pelvis/spine_mid/shoulder/head/Cap 1")
.gameObject);
ModConsole.Print("kuski's brother loaded");
MscCharacters.Add("Kuski", kuskiRagdoll);
MscCharacters.Add("Fleetari", fleetariragdoll);
MscCharacters.Add("Kuski's brother", kuskiBrother);
MscCharacters.Add("Strawberry guy", berrymanragdoll);
MscCharacters.Add("Lindell", lindellRagdoll);
MscCharacters.Add("Servant", servantRagdoll);
//if (!Directory.Exists(path))
// Directory.CreateDirectory(path);
//string[] dirs = Directory.GetDirectories(path);
//for (int i = 0; i < dirs.Length; i++)
//{
// string[] models = Directory.GetFiles(dirs[i], "*.*").Where(file => file.ToLower().EndsWith(".obj", System.StringComparison.OrdinalIgnoreCase)).ToArray();
// string[] textures = Directory.GetFiles(dirs[i], "*.*").Where(file => file.ToLower().EndsWith(".png", System.StringComparison.OrdinalIgnoreCase)).ToArray();
//}
}
private void IconSetup()
{
foreach (var list in List)
{
foreach (var innerlist in list.Key)
{
GameObject gameObject = innerlist.Value;
Image image = IconGen.GetComponent<ThumbnailGenerator>().GenerateImage(gameObject);
Icons.Add(innerlist.Key,image);
}
}
}
private void Mod_Update()
{
if (Open.GetKeybindDown())
{
OpenMenu();
}
}
private void Mod_OnSave()
{
SaveLoad.WriteValue(this, "ItemsSpawned", ItemsSpawned);
SaveLoad.WriteValue(this, "RagdollsSpawned", RagdollsSpawned);
}
}
}