Skip to content

Commit

Permalink
version 2.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
younggam committed Sep 18, 2020
1 parent f54c839 commit 88650e5
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 107 deletions.
2 changes: 1 addition & 1 deletion content/zones/DamlonShipyard.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ startingItems:[
stone/1000
]
launchPeriod:10
conditionWave:30
conditionWave:25
resources:[
stone
copper
Expand Down
2 changes: 1 addition & 1 deletion content/zones/DesertOutpost.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ startingItems:[
glass/300
]
launchPeriod:10
conditionWave:20
conditionWave:15
resources:[
stone
copper
Expand Down
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ name:steam-power
displayName:Steam Power
description:"[orange]Realistic power generation. \n\n[cyan]Developer : [green]younggam\n[yellow]Thanks to : sirius, 우파루파, Lily, sk7725\n\n[red]Need younggam/multi-lib2"
author: younggam
version: 2.1.2
version: 2.1.3
minGameVersion: 104
dependencies:["multi-lib2"]
109 changes: 59 additions & 50 deletions scripts/blocks/distribution/electric-conveyor.js
Original file line number Diff line number Diff line change
@@ -1,53 +1,62 @@
const electricConveyor=extendContent(Conveyor,"electric-conveyor",{
update(tile){
const e=tile.ent();
if(e.cons.valid()&&e.efficiency()>=0.9){
this.super$update(tile);
e.cons.trigger();
const electricConveyor = extendContent(Conveyor, "electric-conveyor", {
update(tile) {
const e = tile.ent();
if(e.cons.valid() && e.efficiency() >= 0.9) {
this.super$update(tile);
e.cons.trigger();
}
},
shouldIdleSound(tile) {
if(tile.entity.cons.valid() && tile.entity.efficiency() >= 0.9 && tile.entity.clogHeat <= 0.5) {
return false;
} else {
return true;;
}
},
draw(tile) {
if(tile.entity.cons.valid() && tile.entity.efficiency() >= 0.9 && !tile.entity.isSleeping()) {
this.super$draw(tile);
} else {
Draw.rect(this.stopRegions[Mathf.clamp(tile.entity.getBlend(0), 0, 3)], tile.drawx(), tile.drawy(), Vars.tilesize * tile.entity.getBlend(1), Vars.tilesize * tile.entity.getBlend(2), tile.rotation() * 90);
}
},
onProximityUpdate(tile) {
this.super$onProximityUpdate(tile);
const entity = tile.ent();
entity.setBlend(this.buildBlending(tile, tile.rotation(), null, true));
},
load() {
this.super$load();
this.stopRegions = [];
for(var i = 0; i < 4; i++) this.stopRegions[i] = Core.atlas.find(this.name + "-" + i + "-" + 0);
},
getPowerConnections(tile, out) {
out.clear();
if(tile == null || tile.entity == null || tile.entity.power == null) return out;
var iter = tile.entity.proximity().iterator();
while(iter.hasNext()) {
var other = iter.next();
if(other != null && other.entity != null && other.entity.power != null && other.block().name == "steam-power-electric-conveyor" || other.block().name == "steam-power-hyperloop-conveyor") out.add(other);
}
for(var i = 0, len = tile.entity.power.links.size; i < len; i++) {
var link = Vars.world.tile(tile.entity.power.links.get(i));
if(link != null && link.entity != null && link.entity.power != null) out.add(link);
}
return out;
}

},
shouldIdleSound(tile){
if(tile.entity.cons.valid()&&tile.entity.efficiency()>=0.9&&tile.entity.clogHeat<=0.5){
return false;
}else{
return true;;
}
},
draw(tile){
if(tile.entity.cons.valid()&&tile.entity.efficiency()>=0.9&&!tile.entity.isSleeping()){
this.super$draw(tile);
}else{
Draw.rect(
this.stopRegions[Mathf.clamp(tile.entity.getBlend(0),0,3)]
, tile.drawx(), tile.drawy()
, Vars.tilesize * tile.entity.getBlend(1)
, Vars.tilesize * tile.entity.getBlend(2), tile.rotation() * 90);
}
},
onProximityUpdate(tile){
this.super$onProximityUpdate(tile);
const entity=tile.ent();
entity.setBlend(this.buildBlending(tile,tile.rotation(),null,true));
},
load(){
this.super$load();
this.stopRegions=[];
for(var i=0;i<4;i++) this.stopRegions[i]=Core.atlas.find(this.name+"-"+i+"-"+0);
}
});
electricConveyor.entityType=prov(()=>extend(Conveyor.ConveyorEntity,{
setBlend(a){
this._blend0=a[0];
this._blend1=a[1];
this._blend2=a[2];
},
getBlend(b){
if (b==0)return this._blend0;
if (b==1)return this._blend1;
if (b==2)return this._blend2
},
_blend0:null,
_blend1:null,
_blend2:null,
electricConveyor.entityType = prov(() => extend(Conveyor.ConveyorEntity, {
setBlend(a) {
this._blend0 = a[0];
this._blend1 = a[1];
this._blend2 = a[2];
},
getBlend(b) {
if(b == 0) return this._blend0;
if(b == 1) return this._blend1;
if(b == 2) return this._blend2
},
_blend0: null,
_blend1: null,
_blend2: null,
}));
110 changes: 58 additions & 52 deletions scripts/blocks/distribution/hyperloop-conveyor.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,61 @@
const hyperloopConveyor=extendContent(ArmoredConveyor,"hyperloop-conveyor",{
update(tile){
const e=tile.ent();
if(e.cons.valid()&&e.efficiency()>=0.9){
this.super$update(tile);
e.cons.trigger();
const hyperloopConveyor = extendContent(ArmoredConveyor, "hyperloop-conveyor", {
update(tile) {
const e = tile.ent();
if(e.cons.valid() && e.efficiency() >= 0.9) {
this.super$update(tile);
e.cons.trigger();
}
else {
return;
}
},
shouldIdleSound(tile) {
if(tile.entity.cons.valid() && tile.entity.efficiency() >= 0.9 && tile.entity.clogHeat <= 0.5) {
return false;
} else {
return true;;
}
},
draw(tile) {
if(tile.entity.cons.valid() && tile.entity.efficiency() >= 0.9 && !tile.entity.isSleeping()) {
this.super$draw(tile);
} else {
Draw.rect(this.stopRegions[Mathf.clamp(tile.entity.getBlend(0), 0, 3)], tile.drawx(), tile.drawy(), Vars.tilesize * tile.entity.getBlend(1), Vars.tilesize * tile.entity.getBlend(2), tile.rotation() * 90);
}
},
onProximityUpdate(tile) {
this.super$onProximityUpdate(tile);
const entity = tile.ent();
entity.setBlend(this.buildBlending(tile, tile.rotation(), null, true));
},
load() {
this.super$load();
this.stopRegions = [];
for(var i = 0; i < 4; i++) this.stopRegions[i] = Core.atlas.find(this.name + "-" + i + "-" + 0);
},
getPowerConnections(tile, out) {
out.clear();
if(tile == null || tile.entity == null || tile.entity.power == null) return out;
var iter = tile.entity.proximity().iterator();
while(iter.hasNext()) {
var other = iter.next();
if(other != null && other.entity != null && other.entity.power != null && other.block().name == "steam-power-electric-conveyor" || other.block().name == "steam-power-hyperloop-conveyor") out.add(other);
}
return out;
}
else{
return;
}
},
shouldIdleSound(tile){
if(tile.entity.cons.valid()&&tile.entity.efficiency()>=0.9&&tile.entity.clogHeat<=0.5){
return false;
}else{
return true;;
}
},
draw(tile){
if(tile.entity.cons.valid()&&tile.entity.efficiency()>=0.9&&!tile.entity.isSleeping()){
this.super$draw(tile);
}else{
Draw.rect(
this.stopRegions[Mathf.clamp(tile.entity.getBlend(0),0,3)]
, tile.drawx(), tile.drawy()
, Vars.tilesize * tile.entity.getBlend(1)
, Vars.tilesize * tile.entity.getBlend(2), tile.rotation() * 90);
}
},
onProximityUpdate(tile){
this.super$onProximityUpdate(tile);
const entity=tile.ent();
entity.setBlend(this.buildBlending(tile,tile.rotation(),null,true));
},
load(){
this.super$load();
this.stopRegions=[];
for(var i=0;i<4;i++) this.stopRegions[i]=Core.atlas.find(this.name+"-"+i+"-"+0);
}
});
hyperloopConveyor.entityType=prov(()=>extend(Conveyor.ConveyorEntity,{
setBlend(a){
this._blend0=a[0];
this._blend1=a[1];
this._blend2=a[2];
},
getBlend(b){
if (b==0)return this._blend0;
if (b==1)return this._blend1;
if (b==2)return this._blend2
},
_blend0:null,
_blend1:null,
_blend2:null,
hyperloopConveyor.entityType = prov(() => extend(Conveyor.ConveyorEntity, {
setBlend(a) {
this._blend0 = a[0];
this._blend1 = a[1];
this._blend2 = a[2];
},
getBlend(b) {
if(b == 0) return this._blend0;
if(b == 1) return this._blend1;
if(b == 2) return this._blend2
},
_blend0: null,
_blend1: null,
_blend2: null,
}));
2 changes: 0 additions & 2 deletions scripts/blocks/production/blast-furnace.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ const blastFurnace = multiLib.extend(GenericCrafter, "blast-furnace", [{
this.super$setBars();
//initialize
this.bars.remove("liquid");
this.bars.remove("power")
//display every Liquids that can contain
var i = 0;
if(!this.liquidSet.isEmpty()) {
Expand All @@ -72,7 +71,6 @@ const blastFurnace = multiLib.extend(GenericCrafter, "blast-furnace", [{
//for dislpying info
setStats() {
this.super$setStats();
this.stats.remove(BlockStat.powerUse);
this.stats.remove(BlockStat.productionTime);
this.stats.add(BlockStat.booster, new ItemListValue(ItemStack(Items.coal, 1)))
this.stats.add(BlockStat.boostEffect, 2.5, StatUnit.timesSpeed);
Expand Down

0 comments on commit 88650e5

Please sign in to comment.