attack changes
dissolve platforms, mouse for attack, directional attack (i think), hold for attack
This commit is contained in:
@@ -114,6 +114,7 @@
|
||||
<option value="hazard">Hazard (red - damage)</option>
|
||||
<option value="moving">Moving (path)</option>
|
||||
<option value="trigger">Trigger (name)</option>
|
||||
<option value="dissolve">Dissolve (timed)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="muted" style="margin-top:8px;">
|
||||
@@ -361,7 +362,10 @@
|
||||
if(rect.quest_turned_in) out.quest_turned_in = String(rect.quest_turned_in);
|
||||
if(rect.lock_when_pass) out.lock_when_pass = true;
|
||||
if(rect.open_on_miniboss_dead) out.open_on_miniboss_dead = true;
|
||||
if(rect.open_on_boss_dead) out.open_on_boss_dead = true;
|
||||
if(Array.isArray(rect.respawn)) out.respawn = deepClone(rect.respawn);
|
||||
if(rect.stand_time !== undefined) out.stand_time = +rect.stand_time;
|
||||
if(rect.dissolve_time !== undefined) out.dissolve_time = +rect.dissolve_time;
|
||||
return out;
|
||||
}
|
||||
return null;
|
||||
@@ -1448,6 +1452,8 @@ Cancel = Choose whether to remove without saving`);
|
||||
save_point: { ring: "rgba(56,189,248,0.30)", fill: "rgba(56,189,248,0.9)", label: "Lantern" },
|
||||
butterfly_jar: { ring: "rgba(168,85,247,0.22)", fill: "rgba(168,85,247,0.9)", label: "Jar" },
|
||||
diary: { ring: "rgba(150,110,70,0.25)", fill: "rgba(150,110,70,0.95)", label: "Diary" },
|
||||
reward_chest: { ring: "rgba(180,120,60,0.30)", fill: "rgba(190,125,70,0.95)", label: "Chest" },
|
||||
ability_pickup:{ ring: "rgba(200,230,255,0.30)", fill: "rgba(200,230,255,0.95)", label: "Ability" },
|
||||
};
|
||||
const ptype = p.type || "light_source";
|
||||
const st = PROP_STYLES[ptype] || { ring: "rgba(148,163,184,0.25)", fill: "rgba(148,163,184,0.9)", label: ptype };
|
||||
@@ -1553,6 +1559,7 @@ Cancel = Choose whether to remove without saving`);
|
||||
if(p && (p.group === "moving")) layerable.push({ z: +(p.layer||0), cat: 1, kind: "moving", p });
|
||||
else if(p && (p.group === "trigger")) layerable.push({ z: +(p.layer||0), cat: 1, kind: "trigger", p });
|
||||
else if(p && (p.group === "hazard")) layerable.push({ z: +(p.layer||0), cat: 1, kind: "hazard", p });
|
||||
else if(p && (p.group === "dissolve")) layerable.push({ z: +(p.layer||0), cat: 1, kind: "dissolve", p });
|
||||
else layerable.push({ z: +(p.layer||0), cat: 1, kind: "platform", p });
|
||||
}
|
||||
for(const d of (room.ability_doors || [])) if(d) layerable.push({ z: +(d.layer||0), cat: 2, kind: "door", d });
|
||||
@@ -1655,6 +1662,18 @@ Cancel = Choose whether to remove without saving`);
|
||||
ctx.stroke();
|
||||
ctx.setLineDash([]);
|
||||
}
|
||||
} else if(it.kind === "dissolve"){
|
||||
const p = it.p;
|
||||
const [sx,sy] = worldToScreen(p.x, p.y, canvas);
|
||||
const [sx2,sy2] = worldToScreen(p.x+p.w, p.y+p.h, canvas);
|
||||
ctx.fillStyle = "rgba(96,165,250,0.15)";
|
||||
ctx.fillRect(sx,sy, sx2-sx, sy2-sy);
|
||||
ctx.strokeStyle = "rgba(150,210,255,0.9)";
|
||||
ctx.lineWidth = 2*dpr;
|
||||
ctx.strokeRect(sx,sy, sx2-sx, sy2-sy);
|
||||
ctx.fillStyle = "rgba(229,231,235,0.9)";
|
||||
ctx.font = `${11*dpr}px system-ui`;
|
||||
ctx.fillText("Dissolve", sx+4*dpr, sy-4*dpr);
|
||||
} else if(it.kind === "door"){
|
||||
const d = it.d;
|
||||
const [sx,sy] = worldToScreen(d.x, d.y, canvas);
|
||||
@@ -2162,6 +2181,7 @@ Cancel = Choose whether to remove without saving`);
|
||||
<option value="hazard" ${p.group==="hazard"?"selected":""}>Hazard (red - damage)</option>
|
||||
<option value="moving" ${p.group==="moving"?"selected":""}>Moving (path)</option>
|
||||
<option value="trigger" ${p.group==="trigger"?"selected":""}>Trigger (name)</option>
|
||||
<option value="dissolve" ${p.group==="dissolve"?"selected":""}>Dissolve (timed)</option>
|
||||
</select>
|
||||
</div>
|
||||
${(p.group||"ground") === "trigger" ? `
|
||||
@@ -2186,6 +2206,9 @@ Cancel = Choose whether to remove without saving`);
|
||||
</div>
|
||||
<div style="margin-top:8px;">
|
||||
<label><input id="ptminibossdead" type="checkbox" ${p.open_on_miniboss_dead?"checked":""}/> Present until the room's miniboss is slain</label>
|
||||
</div>
|
||||
<div style="margin-top:8px;">
|
||||
<label><input id="ptbossdead" type="checkbox" ${p.open_on_boss_dead?"checked":""}/> Present until the room's boss is slain</label>
|
||||
</div>` : ""}
|
||||
${(p.group||"ground") === "hazard" ? `
|
||||
<div style="margin-top:8px;">
|
||||
@@ -2204,7 +2227,16 @@ Cancel = Choose whether to remove without saving`);
|
||||
<div style="margin-top:8px;">
|
||||
<div class="mini">speed (px/s)</div>
|
||||
<input id="ptspeed" type="number" value="${p.speed||120}"/>
|
||||
</div>
|
||||
<div style="margin-top:8px;">
|
||||
<label><input id="pmbossdead" type="checkbox" ${p.open_on_boss_dead?"checked":""}/> Hidden until the room's boss is slain</label>
|
||||
</div>` : ""}
|
||||
${(p.group||"ground") === "dissolve" ? `
|
||||
<div class="grid2" style="margin-top:8px;">
|
||||
<div><div class="mini">stand time (s)</div><input id="ptstand" type="number" step="0.1" min="0.1" value="${p.stand_time!==undefined?p.stand_time:1.0}"/></div>
|
||||
<div><div class="mini">dissolve time (s)</div><input id="ptdissolve" type="number" step="0.1" min="0.1" value="${p.dissolve_time!==undefined?p.dissolve_time:2.0}"/></div>
|
||||
</div>
|
||||
<div class="muted" style="margin-top:6px;">While the player stands on it, after the stand time it becomes translucent (no hitbox) for the dissolve time, then reforms.</div>` : ""}
|
||||
<div class="row" style="margin-top:8px;">
|
||||
<button id="delSel" class="danger">Delete</button>
|
||||
</div>
|
||||
@@ -2431,6 +2463,10 @@ Cancel = Choose whether to remove without saving`);
|
||||
const pg=q("pg"); if(pg) pg.addEventListener("change", ()=>pushAnd(()=>{
|
||||
p.group = pg.value || "ground";
|
||||
if(p.group === "moving" && !Array.isArray(p.path)) p.path = [[p.x, p.y]];
|
||||
if(p.group === "dissolve"){
|
||||
if(p.stand_time === undefined) p.stand_time = 1.0;
|
||||
if(p.dissolve_time === undefined) p.dissolve_time = 2.0;
|
||||
}
|
||||
if(p.group !== "trigger" && p.name !== undefined && p.name !== "") delete p.name;
|
||||
}));
|
||||
const ptname=q("ptname"); if(ptname) ptname.addEventListener("change", ()=>pushAnd(()=>{
|
||||
@@ -2455,7 +2491,15 @@ Cancel = Choose whether to remove without saving`);
|
||||
const ptminibossdead=q("ptminibossdead"); if(ptminibossdead) ptminibossdead.addEventListener("change", ()=>pushAnd(()=>{
|
||||
if(ptminibossdead.checked){ p.open_on_miniboss_dead = true; } else { delete p.open_on_miniboss_dead; }
|
||||
}));
|
||||
const ptbossdead=q("ptbossdead"); if(ptbossdead) ptbossdead.addEventListener("change", ()=>pushAnd(()=>{
|
||||
if(ptbossdead.checked){ p.open_on_boss_dead = true; } else { delete p.open_on_boss_dead; }
|
||||
}));
|
||||
const ptspeed=q("ptspeed"); if(ptspeed) ptspeed.addEventListener("change", ()=>pushAnd(()=>{ p.speed = Math.max(1, num(ptspeed.value)); }));
|
||||
const pmbossdead=q("pmbossdead"); if(pmbossdead) pmbossdead.addEventListener("change", ()=>pushAnd(()=>{
|
||||
if(pmbossdead.checked){ p.open_on_boss_dead = true; } else { delete p.open_on_boss_dead; }
|
||||
}));
|
||||
const ptstand=q("ptstand"); if(ptstand) ptstand.addEventListener("change", ()=>pushAnd(()=>{ p.stand_time = Math.max(0.1, num(ptstand.value)); }));
|
||||
const ptdissolve=q("ptdissolve"); if(ptdissolve) ptdissolve.addEventListener("change", ()=>pushAnd(()=>{ p.dissolve_time = Math.max(0.1, num(ptdissolve.value)); }));
|
||||
const hzrespawn=q("hzrespawn");
|
||||
if(hzrespawn){
|
||||
// preselect current respawn if it matches an entry spawn
|
||||
@@ -3353,19 +3397,24 @@ Cancel = Choose whether to remove without saving`);
|
||||
for(const p of (d.platforms || [])){
|
||||
const group = p.group || "ground";
|
||||
if(!platforms[group]) platforms[group] = [];
|
||||
if(group === "moving" || group === "trigger" || group === "hazard"){
|
||||
if(group === "moving" || group === "trigger" || group === "hazard" || group === "dissolve"){
|
||||
const obj = { x: p.x, y: p.y, w: p.w, h: p.h };
|
||||
if(p.layer) obj.layer = p.layer;
|
||||
if(group === "moving"){
|
||||
if(Array.isArray(p.path)) obj.path = p.path;
|
||||
if(p.speed !== undefined) obj.speed = p.speed;
|
||||
}
|
||||
if(group === "dissolve"){
|
||||
if(p.stand_time !== undefined) obj.stand_time = p.stand_time;
|
||||
if(p.dissolve_time !== undefined) obj.dissolve_time = p.dissolve_time;
|
||||
}
|
||||
if(p.name) obj.name = p.name;
|
||||
if(p.quest) obj.quest = p.quest;
|
||||
if(p.quest_complete) obj.quest_complete = p.quest_complete;
|
||||
if(p.quest_turned_in) obj.quest_turned_in = p.quest_turned_in;
|
||||
if(p.lock_when_pass) obj.lock_when_pass = true;
|
||||
if(p.open_on_miniboss_dead) obj.open_on_miniboss_dead = true;
|
||||
if(p.open_on_boss_dead) obj.open_on_boss_dead = true;
|
||||
if(Array.isArray(p.respawn)) obj.respawn = p.respawn;
|
||||
platforms[group].push(obj);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user