make changes
This commit is contained in:
parent
c800cf0ad3
commit
39b346d40a
23
mods/mobs.js
23
mods/mobs.js
|
|
@ -1,3 +1,7 @@
|
|||
var modName = "mods/mobs.js";
|
||||
var runAfterAutogenMod = "mods/runAfterAutogen and onload restructure.js";
|
||||
|
||||
if(enabledMods.includes(runAfterAutogenMod)) {
|
||||
//Prerequisite Functions and Variables
|
||||
|
||||
headBodyObject = {
|
||||
|
|
@ -1534,7 +1538,7 @@ elements.creeper_head = {
|
|||
break;
|
||||
};
|
||||
if(isEmpty(nX,nY)) {
|
||||
////console.log(`Skipping pixel (${nX},${nY}) (empty)`)
|
||||
//console.log(`Skipping pixel (${nX},${nY}) (empty)`)
|
||||
continue;
|
||||
};
|
||||
if(!isEmpty(nX,nY,true)) {
|
||||
|
|
@ -1573,7 +1577,7 @@ elements.creeper_head = {
|
|||
break;
|
||||
};
|
||||
if(isEmpty(nX,nY)) {
|
||||
////console.log(`Skipping pixel (${nX},${nY}) (empty)`)
|
||||
//console.log(`Skipping pixel (${nX},${nY}) (empty)`)
|
||||
continue;
|
||||
};
|
||||
if(!isEmpty(nX,nY,true)) {
|
||||
|
|
@ -4003,7 +4007,7 @@ if(urlParams.get('creeperIncludeRandom') !== null) { //if the variable exists at
|
|||
},
|
||||
};
|
||||
|
||||
runAfterLoad(function() {
|
||||
runAfterAutogen(function() {
|
||||
creeperElements = Object.keys(elements);
|
||||
creeperElements.push(["rock","sand"]);
|
||||
//creeperElements = ["water","steel","dirt",["dirt","sand"],"frostwind","antimatter,acid","fire,nonexist"]; //Test array
|
||||
|
|
@ -4067,10 +4071,13 @@ runAfterLoad(function() {
|
|||
};
|
||||
var preColor = rgbStringToHSL(startColor);
|
||||
var colorsArray = [preColor, preColor, preColor, preColor, preColor, preColor, preColor, preColor, preColor, preColor]
|
||||
var colorObjectArray = [];
|
||||
for(q = 0; q < hslOffsets.length; q++) {
|
||||
colorsArray[q] = addArraysInPairs(colorsArray[q],hslOffsets[q]);
|
||||
colorsArray[q] = hslToHex((colorsArray[q][0] % 360),slBound(colorsArray[q][1]),slBound(colorsArray[q][2]));
|
||||
|
||||
colorObjectArray[q] = hexToRGB(colorsArray[q]); //hex to RGB
|
||||
var coq = colorObjectArray[q]; //pull the object
|
||||
colorsArray[q] = `rgb(${coq.r},${coq.g},${coq.b})`; //and change to the RGB from its values
|
||||
};
|
||||
|
||||
//End color gen
|
||||
|
|
@ -4081,6 +4088,7 @@ runAfterLoad(function() {
|
|||
elements[placerName] = {
|
||||
creeperType: elementOfCreeper,
|
||||
color: colorsArray,
|
||||
colorObject: colorObjectArray,
|
||||
category: "auto creepers",
|
||||
properties: {
|
||||
dead: false,
|
||||
|
|
@ -4098,6 +4106,7 @@ runAfterLoad(function() {
|
|||
elements[bodyName] = {
|
||||
creeperType: elementOfCreeper,
|
||||
color: colorsArray,
|
||||
colorObject: colorObjectArray,
|
||||
category: "auto creepers",
|
||||
hidden: true,
|
||||
excludeRandom: true,
|
||||
|
|
@ -4133,6 +4142,7 @@ runAfterLoad(function() {
|
|||
elements[headName] = {
|
||||
creeperType: elementOfCreeper,
|
||||
color: colorsArray,
|
||||
colorObject: colorObjectArray,
|
||||
category: "auto creepers",
|
||||
hidden: true,
|
||||
excludeRandom: true,
|
||||
|
|
@ -4376,3 +4386,8 @@ function generateCreeper(creeperElements,isAfterScriptLoading=false) {//it can b
|
|||
};
|
||||
};
|
||||
};
|
||||
} else {
|
||||
alert(`The ${runAfterAutogenMod} mod is required and has been automatically inserted (reload for this to take effect).`)
|
||||
enabledMods.splice(enabledMods.indexOf(modName),0,runAfterAutogenMod)
|
||||
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue