Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.60 KB | None | 0 0
  1. public void PreLoad()
  2. {
  3. HarmonyPatcher.GetInstance().PatchAll();
  4. SaveRegistry.RegisterDataParticipant<PlortUndisappearifier>();
  5.  
  6. LookupRegistry.RegisterUpgradeEntry(Id.MOCHI_HACK_INITIAL, Bundle.LoadAsset<Sprite>("upgrade_initial"), 10000);
  7. LookupRegistry.RegisterUpgradeEntry(Id.MOCHI_HACK_ENABLE, Bundle.LoadAsset<Sprite>("upgrade_enable"), 0);
  8. LookupRegistry.RegisterUpgradeEntry(Id.MOCHI_HACK_DISABLE, Bundle.LoadAsset<Sprite>("upgrade_disable"), 0);
  9.  
  10. MailRegistry.RegisterMailEntry("quicksilver_stolen_mail").SetFromTranslation("Mochi Miles").SetBodyTranslation("My name is Mochi Miles, you took my quicksilvers, prepare to die.");
  11.  
  12. Id.MOCHI_HACK_INITIAL.GetTranslation().SetDescriptionTranslation("Hack the gate at Mochi's Manor to render it ineffective").SetNameTranslation("Gate Hack");
  13. Id.MOCHI_HACK_ENABLE.GetTranslation().SetDescriptionTranslation("Enable your Gate Hack").SetNameTranslation("Enable Gate Hack");
  14. Id.MOCHI_HACK_DISABLE.GetTranslation().SetDescriptionTranslation("Disable your Gate Hack").SetNameTranslation("Disable Gate Hack");
  15.  
  16. PersonalUpgradeRegistry.RegisterUpgradeLock(Id.MOCHI_HACK_INITIAL, (x) =>
  17. {
  18. return x.CreateBasicLock(null, () => SceneContext.Instance.ProgressDirector.model?.HasProgress(ProgressDirector.ProgressType.ENTER_ZONE_MOCHI_RANCH) ?? false, 1);
  19. });
  20. PersonalUpgradeRegistry.RegisterUpgradeCallback(Id.MOCHI_HACK_INITIAL, (x, y) =>
  21. {
  22. if (y) SceneContext.Instance.PlayerState.AddUpgrade(Id.MOCHI_HACK_ENABLE, true);
  23.  
  24. });
  25.  
  26. PersonalUpgradeRegistry.RegisterUpgradeCallback(Id.MOCHI_HACK_DISABLE, (x, y) =>
  27. {
  28. if (y) SetHackState(x, false);
  29. if (y) SceneContext.Instance.PlayerState.onAmmoModeChanged(PlayerState.AmmoMode.DEFAULT);
  30. });
  31.  
  32. PersonalUpgradeRegistry.RegisterUpgradeCallback(Id.MOCHI_HACK_ENABLE, (x, y) =>
  33. {
  34. if (y) SetHackState(x, true);
  35. if (y) SceneContext.Instance.PlayerState.onAmmoModeChanged(PlayerState.AmmoMode.NIMBLE_VALLEY);
  36. });
  37.  
  38.  
  39. GameObject generatorPrefab = LoadGadget();
  40. PrefabUtils.ReplaceFieldsWith(generatorPrefab, Gadget.Id.EXTRACTOR_DRILL_NOVICE, Id.GENERATOR_GADGET);
  41.  
  42. generatorPrefab.AddComponent<ElectricStorage>();
  43.  
  44.  
  45. generatorPrefab.transform.Find("pole/sphere/trigger").gameObject.AddComponent<ElectricStorageTrigger>();
  46.  
  47. LookupRegistry.RegisterGadget(new GadgetDefinition()
  48. {
  49. prefab = generatorPrefab,
  50. id = Id.GENERATOR_GADGET,
  51. pediaLink = PediaDirector.Id.UTILITIES,
  52. blueprintCost = 1000,
  53. buyCountLimit = 10,
  54. craftCosts = new GadgetDefinition.CraftCost[] { new GadgetDefinition.CraftCost() { amount = 10, id = Identifiable.Id.QUICKSILVER_PLORT } }
  55. });
  56.  
  57. Id.GENERATOR_GADGET.GetTranslation().SetNameTranslation("Static Generator").SetDescriptionTranslation("This machine can generate and store static charge");
  58.  
  59. SaveRegistry.RegisterSerializableGadgetModel<GeneratorModel>(0);
  60. DataModelRegistry.RegisterCustomGadgetModel(Id.GENERATOR_GADGET, typeof(GeneratorModel));
  61.  
  62. GadgetRegistry.RegisterBlueprintLock(Id.GENERATOR_GADGET, (x) => x.CreateBasicLock(Id.GENERATOR_GADGET, Gadget.Id.NONE, ProgressDirector.ProgressType.ENTER_ZONE_MOCHI_RANCH, 3));
  63.  
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement