Skip to content
Snippets Groups Projects
Commit 01771eff authored by Pregmodder's avatar Pregmodder
Browse files

Merge branch 'fix2' into 'pregmod-master'

Prosthetics menu fixes

Closes #2528

See merge request pregmodfan/fc-pregmod!8487
parents 5d25c75d 4659498f
No related branches found
No related tags found
1 merge request!8487Prosthetics menu fixes
......@@ -24,15 +24,16 @@ div.eyeContainer {
grid-template-columns: 80px 50px 70px 50px;
}
div.buyProsthetics {
div.buy-prosthetics {
display: grid;
grid-template-columns: 300px 140px 150px 150px;
grid-template-columns: repeat(4, max-content);
grid-column-gap: 40px;
}
div.buyProsthetics div.full {
div.buy-prosthetics div.full {
grid-column-start: 2;
grid-column-end: 5;
}
div.buyProsthetics div.research {
div.buy-prosthetics div.research {
grid-column-start: 3;
grid-column-end: 5;
text-align: center;
......
......@@ -273,7 +273,7 @@ This room is lined with shelves and cabinets; it could be easily mistaken for a
<p class="choices">
//Fit prosthetics to $him://
<div class="buyProsthetics">
<div class="buy-prosthetics">
<div></div>
<div>''Buy and fit''</div>
<div>
......@@ -297,52 +297,56 @@ This room is lined with shelves and cabinets; it could be easily mistaken for a
<<if $adjustProsthetics.findIndex(function(p) {return p.id == _p && p.slaveID == getSlave($AS).ID}) != -1 || $researchLab.tasks.findIndex(function(p) {return p.type == "craftFit" && p.id == _p && p.slaveID == getSlave($AS).ID}) != -1>>
<div class="full">//Currently being fitted to $him.//</div>
<<elseif setup.prosthetics[_p].level > $prostheticsUpgrade>>
<div class="full">//Better contracts are needed to buy this.//</div>
<div class="full">//Better contracts are needed to buy these.//</div>
<<elseif isProstheticAvailable(getSlave($AS), _p)>>
<div class="full">//Completed.//</div>
<<else>>
<<capture _p>>
<div>
<<if $prosthetics[_p].amount > 0>>
<<link "From storage" "Prosthetics Configuration">>
<<set $adjustProsthetics.push({id: _p, workLeft: setup.prosthetics[_p].adjust, slaveID: getSlave($AS).ID}), $prosthetics[_p].amount -= 1>>
<</link>>
<<else>>
<<link "<<= cashFormat(setup.prosthetics[_p].costs)>>" "Prosthetics Configuration">>
<<set $adjustProsthetics.push({id: _p, workLeft: setup.prosthetics[_p].adjust, slaveID: getSlave($AS).ID}), cashX(forceNeg(setup.prosthetics[_p].costs), "slaveMod", getSlave($AS))>>
<</link>>
<</if>>
<<if $prosthetics[_p].amount > 0>>
<<link "From storage" "Prosthetics Configuration">>
<<set $adjustProsthetics.push({id: _p, workLeft: setup.prosthetics[_p].adjust, slaveID: getSlave($AS).ID}), $prosthetics[_p].amount -= 1>>
<</link>>
<<else>>
<<link "<<= cashFormat(setup.prosthetics[_p].costs)>>" "Prosthetics Configuration">>
<<set $adjustProsthetics.push({id: _p, workLeft: setup.prosthetics[_p].adjust, slaveID: getSlave($AS).ID}), cashX(forceNeg(setup.prosthetics[_p].costs), "slaveMod", getSlave($AS))>>
<</link>>
<</if>>
</div>
<<if $prosthetics[_p].research > 0>>
<div style="text-align:center">
<<if $researchLab.level > 0 && $prosthetics[_p].research > 0>>
<<link "Construct" "Prosthetics Configuration">>
<<set $researchLab.tasks.push({
type: "craftFit",
id: _p,
workLeft: (setup.prosthetics[_p].adjust + setup.prosthetics[_p].craft) / 1.5,
slaveID: $AS})>>
/* 1.5: longer than adjust, but faster than adjust+craft. */
<</link>>
<</if>>
</div>
<div style="text-align:right">
<<if $researchLab.speed >= 300 && $prosthetics[_p].research > 0>> /* max speed */
<<if $prosthetics[_p].amount > 0>>
<<link "From storage: <<= cashFormat(setup.prosthetics[_p].adjust * 50)>>" "Prosthetics Configuration">>
<<set cashX(forceNeg(setup.prosthetics[_p].costs * 1.5), "slaveMod", getSlave($AS)), addProsthetic(getSlave($AS), _p)>>
<</link>>
<<else>>
<<link "<<= cashFormat(setup.prosthetics[_p].costs + setup.prosthetics[_p].adjust * 100)>>" "Prosthetics Configuration">>
<<set cashX(forceNeg(setup.prosthetics[_p].costs + setup.prosthetics[_p].adjust * 100), "slaveMod", getSlave($AS)), addProsthetic(getSlave($AS), _p)>>
<</link>>
<</if>>
<</if>>
</div>
<div style="text-align:center">
<<if $researchLab.level > 0 && $prosthetics[_p].research > 0>>
<<link "Construct" "Prosthetics Configuration">>
<<set $researchLab.tasks.push({
type: "craftFit",
id: _p,
workLeft: (setup.prosthetics[_p].adjust + setup.prosthetics[_p].craft) / 1.5,
slaveID: $AS})>>
/* 1.5: longer than adjust, but faster than adjust+craft. */
<</link>>
<</if>>
</div>
<div style="text-align:right">
<<if $researchLab.speed >= 300 && $prosthetics[_p].research > 0>> /* max speed */
<<if $prosthetics[_p].amount > 0>>
<<link "From storage: <<= cashFormat(setup.prosthetics[_p].adjust * 50)>>" "Prosthetics Configuration">>
<<set cashX(forceNeg(setup.prosthetics[_p].costs * 1.5), "slaveMod", getSlave($AS)), addProsthetic(getSlave($AS), _p)>>
<</link>>
<<else>>
<<link "<<= cashFormat(setup.prosthetics[_p].costs + setup.prosthetics[_p].adjust * 100)>>" "Prosthetics Configuration">>
<<set cashX(forceNeg(setup.prosthetics[_p].costs + setup.prosthetics[_p].adjust * 100), "slaveMod", getSlave($AS)), addProsthetic(getSlave($AS), _p)>>
<</link>>
<</if>>
<</if>>
</div>
<<elseif $researchLab.level > 0>>
<div class="research">
//Not researched.//
</div>
<div class="research">
//Not researched.//
</div>
<<else>>
<div class="research">
//You need to construct a lab first.//
</div>
<</if>>
<</capture>>
<</if>>
......
......@@ -400,7 +400,7 @@
<span class="detail">
Costs <<print cashFormat(Math.trunc(150000*$upgradeMultiplierArcology))>>
<div class="indent">
Buying the equipment to construct prosthetics yourself is expensive but if you want to construct a lot of prosthetics it will pay out in the long run.
Buying the equipment to construct prosthetics yourself is expensive but if you plan to construct many prosthetics it will pay out in the long run.
</div>
</span>
<</if>>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment