G_lander

ProtoDungeons in live mod

Jul 16th, 2020 (edited)
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Game.LoadMod("https://unpkg.com/[email protected]")
  2. if (!window.CPPKIES_ONLOAD) window.CPPKIES_ONLOAD = []
  3. window.CPPKIES_ONLOAD.push(() => {
  4.     const prefix = location.href.endsWith("cookieclicker/") ? "" : "../"
  5.     const style = document.createElement("style")
  6.     style.textContent = `.map
  7. {
  8.     position:absolute;
  9.     left:0px;
  10.     top:0px;
  11.     overflow:hidden;
  12.     background:#00061b;
  13. }
  14. .map:after{content:'';pointer-events:none;display:block;position:absolute;left:0px;top:0px;width:144px;height:144px;z-index:100000;background:url(img/dungeonOverlay.png);}
  15. .map .tile, .map .thing
  16. {
  17.     width:16px;
  18.     height:16px;
  19.     position:absolute;
  20.     left:0px;
  21.     top:0px;
  22. }
  23. .mapContainer
  24. {
  25.     /* meh. */
  26.     /*
  27.     -webkit-transition: top 0.1s ease-out, left 0.1s ease-out;
  28.     -moz-transition: top 0.1s ease-out, left 0.1s ease-out;
  29.     -ms-transition: top 0.1s ease-out, left 0.1s ease-out;
  30.     -o-transition: top 0.1s ease-out, left 0.1s ease-out;
  31.     transition: top 0.1s ease-out, left 0.1s ease-out;
  32.     */
  33. }
  34. .map .tile {background:url(img/dungeonTiles.png) no-repeat;z-index:100;}
  35. .map .thing {background:url(img/dungeonIcons.png) no-repeat;z-index:200;}
  36.  
  37. .dungeonName
  38. {
  39.     position:absolute;
  40.     top:24px;
  41.     left:-32px;
  42.     width:256px;
  43.     opacity:0.6;
  44. }
  45. .dungeonLog
  46. {
  47.     position:absolute;
  48.     right:0px;
  49.     top:0px;
  50.     width:200px;
  51.     height:100%;
  52.     overflow-y:scroll;
  53.     z-index:100;
  54. }
  55. .dungeonLog div
  56. {
  57.     font-size:10px;
  58.     padding:3px 2px;
  59.     opacity:0.6;
  60.     text-shadow:0px 1px 0px #000;
  61. }
  62. .dungeonLog div.new
  63. {
  64.     opacity:1;
  65. }
  66. .dungeonLog div b{font-weight:bold;}
  67.  
  68. .mobSlot
  69. {
  70.     width:96px;
  71.     height:100%;
  72.     position:absolute;
  73.     left:0px;
  74.     bottom:0px;
  75. }
  76. .mobPic
  77. {
  78.     width:96px;
  79.     height:96px;
  80.     background:transparent center bottom no-repeat;
  81.     position:absolute;
  82.     left:0px;
  83.     bottom:32px;
  84. }
  85. .mobName
  86. {
  87.     position:absolute;
  88.     width:200%;
  89.     left:-50%;
  90.     bottom:16px;
  91.     text-align:center;
  92.     font-size:12px;
  93. }
  94. .hpBar
  95. {
  96.     position:absolute;
  97.     width:100%;
  98.     left:0px;
  99.     top:0px;
  100.     height:100%;
  101.     background:url(${prefix}betadungeons/img/hpBar.png) repeat-x;
  102.     -webkit-transition: width 0.1s ease-out;
  103.     -moz-transition: width 0.1s ease-out;
  104.     -ms-transition: width 0.1s ease-out;
  105.     -o-transition: width 0.1s ease-out;
  106.     transition: width 0.1s ease-out;
  107. }
  108. .hpmBar
  109. {
  110.     position:absolute;
  111.     width:70%;
  112.     left:15%;
  113.     bottom:4px;
  114.     height:8px;
  115.     background:url(${prefix}betadungeons/img/hpmBar.png) repeat-x;
  116.     box-shadow:0px 0px 4px #000;
  117. }
  118.  
  119. .map .thing .mapInfo{display:none;position:absolute;left:0px;top:0px;z-index:1000000;background:#000;padding:4px 8px;}
  120. .map .thing:hover .mapInfo{display:block;}
  121. .special .fighter {position:absolute;width:96px;height:96px;}
  122. a.control
  123. {
  124.     position:absolute;
  125.     width:48px;
  126.     height:48px;
  127.     background:url(img/control.png) no-repeat;
  128.     opacity:0.8;
  129. }
  130. a.control:hover{opacity:1;}
  131. a.control.west{left:0px;top:48px;background-position:0px -48px;}
  132. a.control.east{left:96px;top:48px;background-position:-96px -48px;}
  133. a.control.north{left:48px;top:0px;background-position:-48px 0px;}
  134. a.control.south{left:48px;top:96px;background-position:-48px -96px;}
  135. a.control.middle{left:48px;top:48px;background-position:-48px -48px;}
  136. `
  137.     document.body.appendChild(style)
  138.     Game.LoadMod("//orteil.dashnet.org/cookieclicker/betadungeons/DungeonGen.js")
  139.     Game.LoadMod("//orteil.dashnet.org/cookieclicker/betadungeons/dungeons.js")
  140.     const intervalId = setInterval(() => {
  141.         if (!window.LaunchDungeons) return
  142.         clearInterval(intervalId)
  143.         LaunchDungeons()
  144.         Game.Objects.Factory.special()
  145.         Game.Objects.Factory.eachFrame = Game.Objects.Factory.EachFrame
  146.         Game.Objects.Factory.minigame = {
  147.             save: () => ""
  148.         }
  149.         Game.Objects.Factory.minigameLoaded = true
  150.         Game.Objects.Factory.minigameUrl = "kek"
  151.         Game.Objects.Factory.dungeon.Turn = Cppkies.injectCode(Game.Objects.Factory.dungeon.Turn, "img/'+Game.Monsters", `${prefix}betadungeons/`, "before").bind(Game.Objects.Factory.dungeon)
  152.         Game.Objects.Factory.dungeon.Draw = Cppkies.injectCode(Game.Objects.Factory.dungeon.Draw, /height:100%;(.+);position:absolute/, "height:144px;$1;position:static", "replace").bind(Game.Objects.Factory.dungeon)
  153.         Game.Objects.Factory.dungeon.Draw()
  154.         Game.Objects.Factory.minigameName = "Dungeons"
  155.         Game.Objects.Factory.refresh()
  156.         Game.LoadMinigames()
  157.     }, 100)
  158. })
Add Comment
Please, Sign In to add comment