JS: различия между версиями

Материал из PetruCHIO - Mindustry server
Перейти к навигации Перейти к поиску
[досмотренная версия][ожидает проверки]
м (router)
 
(не показано 5 промежуточных версий этого же участника)
Строка 5: Строка 5:
 
! Описание !! Команда
 
! Описание !! Команда
 
|-
 
|-
|Получить данные об игроках || js Vars.playerGroup.all()
+
|Получить данные об игроках || js Groups.player.all()
 
|-
 
|-
|Надпись в мире || js player = Vars.playerGroup.getByID(<font color="red">'''id'''</font>); Call.onLabel("<font color="green">'''Сообщение'''</font>",<font color="red">'''60'''</font>, player.getX(), player.getY());
+
|Надпись в мире || js player = Groups.player.getByID(<font color="red">'''id'''</font>); Call.label("<font color="green">'''Сообщение'''</font>",<font color="red">'''60'''</font>, player.getX(), player.getY());
 
|-
 
|-
|Диалоговое окно с кнопкой [ОК] || js Call.onInfoMessage("<font color="green">'''Сообщение'''</font>");
+
|Диалоговое окно с кнопкой [ОК] || js Call.sendMessage("<font color="green">'''Сообщение'''</font>");
 
|-
 
|-
|Надпись на экране, с привязкой по сторонам || js Call.onInfoPopup("<font color="green">'''Сообщение'''</font>",<font color="red">'''60'''</font>,<font color="red">'''500'''</font>,<font color="red">'''500'''</font>,<font color="red">'''500'''</font>,<font color="red">'''500'''</font>,<font color="red">'''500'''</font>);
+
|Надпись на экране, с привязкой по сторонам || js Call.infoPopup("<font color="green">'''Сообщение'''</font>",<font color="red">'''60'''</font>,<font color="red">'''500'''</font>,<font color="red">'''500'''</font>,<font color="red">'''500'''</font>,<font color="red">'''500'''</font>,<font color="red">'''500'''</font>);
 
|-
 
|-
|Спавн блока в мире || js block = Blocks.<font color="blue">'''coreShard'''</font>; player = Vars.playerGroup.getByID(<font color="red">'''id'''</font>); BuildBlock.onConstructFinish(Vars.world.tile(player.tileX(),player.tileY()),block,0,0,player.getTeam(),false);
+
|Спавн блока в мире || js block = Blocks.<font color="blue">'''coreShard'''</font>; player = Groups.player.getByID(<font color="red">'''id'''</font>); ConstructBlock.constructFinish(player.tileOn(),block,null,0,player.team(),null);
 
|-
 
|-
|Проверка на валидность установки блока в точке || js player = Vars.playerGroup.getByID(<font color="red">'''id'''</font>); Build.validPlace(player.getTeam(), player.tileX(), player.tileY(), Blocks.<font color="blue">'''rtgGenerator'''</font>, 0);
+
|Проверка на валидность установки блока в точке || js player = Groups.player.getByID(<font color="red">'''id'''</font>); Build.validPlace(player.team(), player.tileX(), player.tileY(), Blocks.<font color="blue">'''rtgGenerator'''</font>, 0);
 
|-
 
|-
|Спавн мобов и выдача им предметов || js player = Vars.playerGroup.getByID(<font color="red">'''id'''</font>); unit = UnitTypes.<font color="blue">'''reaper'''</font>.create(Team.<font color="orange">'''sharded'''</font>); unit.set(player.getX(), player.getY()); unit.add(); unit.addItem(Items.<font color="green">'''coal'''</font>,<font color="red">'''30'''</font>);
+
|Спавн мобов и выдача им предметов || js player = Groups.player.getByID(<font color="red">'''id'''</font>); unit = UnitTypes.<font color="blue">'''antumbra'''</font>.spawn(Team.<font color="orange">'''sharded'''</font>,player.x(), player.y()); unit.addItem(Items.<font color="green">'''coal'''</font>,<font color="red">'''30'''</font>);
 
|-
 
|-
|Смена ника || js Vars.playerGroup.getByID(<font color="red">'''id'''</font>).name = "<font color="green">'''Ник'''</font>"
+
|Смена ника || js Groups.player.getByID(<font color="red">'''id'''</font>).name = "<font color="green">'''Ник'''</font>"
 
|-
 
|-
|Выдача предметов игроку || js player = Vars.playerGroup.getByID(<font color="red">'''id'''</font>).addItem(Items.<font color="purple">'''coal'''</font>,<font color="red">'''30'''</font>);
+
|Выдача предметов игроку || js player = Groups.player.getByID(<font color="red">'''id'''</font>).addItem(Items.<font color="purple">'''coal'''</font>,<font color="red">'''30'''</font>);
 
|-
 
|-
 
|Убить последнего заспавненоготюнита || js unit.onDeath()
 
|Убить последнего заспавненоготюнита || js unit.onDeath()
 
|-
 
|-
|Помещение предметов в ядро || js Vars.state.teams.cores(Team.<font color="orange">'''sharded'''</font>).first().items.set(Items.<font color="purple">'''coal'''</font>,<font color="red">'''30'''</font>);
+
|Помещение предметов в ядро || js Team.<font color="orange">'''sharded'''</font>.cores().first().items.set(Items.<font color="purple">'''coal'''</font>,<font color="red">'''30'''</font>);
 
|-
 
|-
|Смена команды || js player = Vars.playerGroup.getByID(<font color="red">'''id'''</font>).setTeam(Team.<font color="orange">'''sharded'''</font>);
+
|Смена команды || js player = Groups.player.getByID(<font color="red">'''id'''</font>).team(Team.<font color="orange">'''sharded'''</font>);
 
|-
 
|-
|Спавн пули || player = Vars.playerGroup.getByID(<font color="red">'''id'''</font>); Calls.createBullet(Bullets.lancerLaser, player.getTeam(), player.getX(), player.getY(), Mathf.random(360), Mathf.random(0.5, 1.0), Mathf.random(0.2, 1.0))}
+
|Спавн пули || js player = Groups.player.getByID(<font color="red">'''id'''</font>); Calls.createBullet(Bullets.lancerLaser, player.getTeam(), player.getX(), player.getY(), Mathf.random(360), Mathf.random(0.5, 1.0), Mathf.random(0.2, 1.0))}
 
|}
 
|}
  
Строка 36: Строка 36:
 
! Категория !! Список
 
! Категория !! Список
 
|-
 
|-
|<font color="blue">'''Юниты'''</font> || <font color="blue">'''draug, spirit, phantom, wraith, ghoul, revenant, lich, reaper, dagger, crawler, titan, fortress, eruptor, chaosArray, eradicator'''</font>
+
|<font color="blue">'''Юниты'''</font> || <font color="blue">'''mace, dagger, crawler, fortress, scepter, reign'''
 +
'''vela, nova, pulsar, quasar, corvus'''
 +
 
 +
'''atrax, spiroct, arkyid, toxopid'''
 +
 
 +
'''flare, eclipse, horizon, zenith, antumbra'''
 +
 
 +
'''mono, poly, mega, quad, oct, alpha, beta, gamma'''
 +
 
 +
'''risso, minke, bryde, sei, omura, retusa, oxynoe, cyerce, aegires, navanax'''</font>
 
|-
 
|-
|<font color="purple">'''Предметы'''</font> || <font color="purple">'''scrap, copper, lead, graphite, coal, titanium, thorium, silicon, plastanium, phasefabric, surgealloy, sporePod, sand, blastCompound, pyratite, metaglass'''</font>
+
|<font color="purple">'''Предметы'''</font> || <font color="purple">'''scrap, copper, lead, graphite, coal, titanium, thorium, silicon, plastanium, phaseFabric, surgeAlloy, sporePod, sand, blastCompound, pyratite, metaglass'''</font>
 
|-
 
|-
 
|<font color="orange">'''Команды'''</font> || <font color="orange">'''derelict, sharded, crux, green, purple, blue'''</font>
 
|<font color="orange">'''Команды'''</font> || <font color="orange">'''derelict, sharded, crux, green, purple, blue'''</font>
 
|-
 
|-
 
|<font color="blue">'''Блоки'''</font> ||
 
|<font color="blue">'''Блоки'''</font> ||
  <font color="blue">'''siliconSmelter, kiln, graphitePress, plastaniumCompressor, multiPress, phaseWeaver, surgeSmelter, pyratiteMixer, blastMixer, cryofluidMixer, melter, separator, sporePress, pulverizer, incinerator, coalCentrifuge'''</font> </br>
+
  <font color="blue">'''siliconSmelter, siliconCrucible, kiln, graphitePress, plastaniumCompressor, multiPress, phaseWeaver, surgeSmelter, pyratiteMixer, blastMixer, cryofluidMixer, melter, separator, disassembler, sporePress, pulverizer, incinerator, coalCentrifuge'''</font> </br>
  <font color="blue">'''powerSource, powerVoid, itemSource, itemVoid, liquidSource, liquidVoid, message, illuminator'''</font> </br>
+
  <font color="blue">'''powerSource, powerVoid, itemSource, itemVoid, liquidSource, liquidVoid, payloadSource, payloadVoid, illuminator'''</font> </br>
  <font color="blue">'''copperWall, copperWallLarge, titaniumWall, titaniumWallLarge, plastaniumWall, plastaniumWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge, phaseWall, phaseWallLarge, surgeWall, surgeWallLarge, mender, mendProjector, overdriveProjector, forceProjector, shockMine, scrapWall, scrapWallLarge, scrapWallHuge, scrapWallGigantic, thruster'''</font> </br>
+
  <font color="blue">'''copperWall, copperWallLarge, titaniumWall, titaniumWallLarge, plastaniumWall, plastaniumWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge, phaseWall, phaseWallLarge, surgeWall, surgeWallLarge, mender, mendProjector, overdriveProjector, overdriveDome, forceProjector, shockMine, scrapWall, scrapWallLarge, scrapWallHuge, scrapWallGigantic, thruster'''</font> </br>
  <font color="blue">'''conveyor, titaniumConveyor, armoredConveyor, distributor, junction, itemBridge, phaseConveyor, sorter, invertedSorter, [[Роутер|router]], overflowGate, underflowGate, massDriver'''</font> </br>
+
  <font color="blue">'''conveyor, titaniumConveyor, plastaniumConveyor, armoredConveyor, distributor, junction, itemBridge, phaseConveyor, sorter, invertedSorter, [[Роутер|router]], overflowGate, underflowGate, massDriver, duct, ductRouter, ductBridge'''</font> </br>
  <font color="blue">'''mechanicalPump, rotaryPump, thermalPump, conduit, pulseConduit, platedConduit, liquidRouter, liquidTank, liquidJunction, bridgeConduit, phaseConduit'''</font> </br>
+
  <font color="blue">'''mechanicalPump, rotaryPump, thermalPump, conduit, pulseConduit, platedConduit, liquidRouter, liquidContainer, liquidTank, liquidJunction, bridgeConduit, phaseConduit'''</font> </br>
  <font color="blue">'''combustionGenerator, thermalGenerator, turbineGenerator, differentialGenerator, rtgGenerator, solarPanel, largeSolarPanel, thoriumReactor, impactReactor, battery, batteryLarge, powerNode, powerNodeLarge, surgeTower, diode'''</font> </br>
+
  <font color="blue">'''combustionGenerator, thermalGenerator, steamGenerator, differentialGenerator, rtgGenerator, solarPanel, largeSolarPanel, thoriumReactor, impactReactor, battery, batteryLarge, powerNode, powerNodeLarge, surgeTower, diode'''</font> </br>
 
  <font color="blue">'''mechanicalDrill, pneumaticDrill, laserDrill, blastDrill, waterExtractor, oilExtractor, cultivator'''</font> </br>
 
  <font color="blue">'''mechanicalDrill, pneumaticDrill, laserDrill, blastDrill, waterExtractor, oilExtractor, cultivator'''</font> </br>
  <font color="blue">'''coreShard, coreFoundation, coreNucleus, vault, container, unloader, launchPad, launchPadLarge'''</font> </br>
+
  <font color="blue">'''coreShard, coreFoundation, coreNucleus, vault, container, unloader'''</font> </br>
  <font color="blue">'''duo, scatter, scorch, hail, arc, wave, lancer, swarmer, salvo, fuse, ripple, cyclone, spectre, meltdown'''</font> </br>
+
  <font color="blue">'''duo, scatter, scorch, hail, arc, wave, lancer, swarmer, salvo, fuse, ripple, cyclone, foreshadow, spectre, meltdown, segment, parallax, tsunami'''</font> </br>
  <font color="blue">'''commandCenter, draugFactory, spiritFactory, phantomFactory, wraithFactory, ghoulFactory, revenantFactory, daggerFactory, crawlerFactory, titanFactory, fortressFactory, repairPoint'''</font> </br>
+
  <font color="blue">'''commandCenter, groundFactory, airFactory, navalFactory, additiveReconstructor, multiplicativeReconstructor, exponentialReconstructor, tetrativeReconstructor, repairPoint, repairTurret'''</font> </br>
  <font color="blue">'''dartPad, deltaPad, tauPad, omegaPad, javelinPad, tridentPad, glaivePad'''</font> </br>
+
<font color="blue">'''payloadConveyor, payloadRouter, payloadPropulsionTower, deconstructor, constructor, largeConstructor, payloadLoader, payloadUnloader'''</font> </br>
 +
  <font color="blue">'''message, switchBlock, microProcessor, logicProcessor, hyperProcessor, largeLogicDisplay, logicDisplay, memoryCell, memoryBank'''</font> </br>
 
|-
 
|-
 
| Зоны
 
| Зоны
Строка 61: Строка 71:
 
     desolateRift, nuclearComplex</code>
 
     desolateRift, nuclearComplex</code>
 
|}
 
|}
 +
 
== Также посмотрите ==
 
== Также посмотрите ==
 
[[Пользовательские правила]]
 
[[Пользовательские правила]]

Текущая версия на 15:01, 11 ноября 2021

Если вы хотите изменить харакетеристики Блока или Меха и чего угодно то смотрим всё здесь
Пример: js Mechs.tau.weapon.reload = 0.1 //Ну это лучше самому увидеть чем услышать

Пример использования

Описание Команда
Получить данные об игроках js Groups.player.all()
Надпись в мире js player = Groups.player.getByID(id); Call.label("Сообщение",60, player.getX(), player.getY());
Диалоговое окно с кнопкой [ОК] js Call.sendMessage("Сообщение");
Надпись на экране, с привязкой по сторонам js Call.infoPopup("Сообщение",60,500,500,500,500,500);
Спавн блока в мире js block = Blocks.coreShard; player = Groups.player.getByID(id); ConstructBlock.constructFinish(player.tileOn(),block,null,0,player.team(),null);
Проверка на валидность установки блока в точке js player = Groups.player.getByID(id); Build.validPlace(player.team(), player.tileX(), player.tileY(), Blocks.rtgGenerator, 0);
Спавн мобов и выдача им предметов js player = Groups.player.getByID(id); unit = UnitTypes.antumbra.spawn(Team.sharded,player.x(), player.y()); unit.addItem(Items.coal,30);
Смена ника js Groups.player.getByID(id).name = "Ник"
Выдача предметов игроку js player = Groups.player.getByID(id).addItem(Items.coal,30);
Убить последнего заспавненоготюнита js unit.onDeath()
Помещение предметов в ядро js Team.sharded.cores().first().items.set(Items.coal,30);
Смена команды js player = Groups.player.getByID(id).team(Team.sharded);
Спавн пули js player = Groups.player.getByID(id); Calls.createBullet(Bullets.lancerLaser, player.getTeam(), player.getX(), player.getY(), Mathf.random(360), Mathf.random(0.5, 1.0), Mathf.random(0.2, 1.0))}

Юниты, предметы, команды, блоки

Категория Список
Юниты mace, dagger, crawler, fortress, scepter, reign

vela, nova, pulsar, quasar, corvus

atrax, spiroct, arkyid, toxopid

flare, eclipse, horizon, zenith, antumbra

mono, poly, mega, quad, oct, alpha, beta, gamma

risso, minke, bryde, sei, omura, retusa, oxynoe, cyerce, aegires, navanax

Предметы scrap, copper, lead, graphite, coal, titanium, thorium, silicon, plastanium, phaseFabric, surgeAlloy, sporePod, sand, blastCompound, pyratite, metaglass
Команды derelict, sharded, crux, green, purple, blue
Блоки
siliconSmelter, siliconCrucible, kiln, graphitePress, plastaniumCompressor, multiPress, phaseWeaver, surgeSmelter, pyratiteMixer, blastMixer, cryofluidMixer, melter, separator, disassembler, sporePress, pulverizer, incinerator, coalCentrifuge 
powerSource, powerVoid, itemSource, itemVoid, liquidSource, liquidVoid, payloadSource, payloadVoid, illuminator
copperWall, copperWallLarge, titaniumWall, titaniumWallLarge, plastaniumWall, plastaniumWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge, phaseWall, phaseWallLarge, surgeWall, surgeWallLarge, mender, mendProjector, overdriveProjector, overdriveDome, forceProjector, shockMine, scrapWall, scrapWallLarge, scrapWallHuge, scrapWallGigantic, thruster
conveyor, titaniumConveyor, plastaniumConveyor, armoredConveyor, distributor, junction, itemBridge, phaseConveyor, sorter, invertedSorter, router, overflowGate, underflowGate, massDriver, duct, ductRouter, ductBridge
mechanicalPump, rotaryPump, thermalPump, conduit, pulseConduit, platedConduit, liquidRouter, liquidContainer, liquidTank, liquidJunction, bridgeConduit, phaseConduit
combustionGenerator, thermalGenerator, steamGenerator, differentialGenerator, rtgGenerator, solarPanel, largeSolarPanel, thoriumReactor, impactReactor, battery, batteryLarge, powerNode, powerNodeLarge, surgeTower, diode
mechanicalDrill, pneumaticDrill, laserDrill, blastDrill, waterExtractor, oilExtractor, cultivator
coreShard, coreFoundation, coreNucleus, vault, container, unloader
duo, scatter, scorch, hail, arc, wave, lancer, swarmer, salvo, fuse, ripple, cyclone, foreshadow, spectre, meltdown, segment, parallax, tsunami
commandCenter, groundFactory, airFactory, navalFactory, additiveReconstructor, multiplicativeReconstructor, exponentialReconstructor, tetrativeReconstructor, repairPoint, repairTurret
payloadConveyor, payloadRouter, payloadPropulsionTower, deconstructor, constructor, largeConstructor, payloadLoader, payloadUnloader
message, switchBlock, microProcessor, logicProcessor, hyperProcessor, largeLogicDisplay, logicDisplay, memoryCell, memoryBank
Зоны groundZero, desertWastes,
   craters, frozenForest, ruinousShores, stainedMountains, tarFields, fungalPass,
   saltFlats, overgrowth, impact0078, crags,
   desolateRift, nuclearComplex

Также посмотрите

Пользовательские правила