repo_name
stringlengths 4
116
| path
stringlengths 4
379
| size
stringlengths 1
7
| content
stringlengths 3
1.05M
| license
stringclasses 15
values |
---|---|---|---|---|
CrushAndRun/Cloudbot-Fluke
|
plugins/core_misc.py
|
3636
|
import asyncio
import socket
from cloudbot import hook
socket.setdefaulttimeout(10)
# Auto-join on Invite (Configurable, defaults to True)
@asyncio.coroutine
@hook.irc_raw('INVITE', permissions=["botcontrol"])
def invite(irc_paramlist, conn):
"""
:type irc_paramlist: list[str]
:type conn: cloudbot.client.Client
"""
invite_join = conn.config.get('invite_join', True)
if invite_join:
mode = "mode {}".format(irc_paramlist[-1])
conn.send(mode)
conn.join(irc_paramlist[-1])
@hook.irc_raw('324')
def check_mode(irc_paramlist, conn, message):
#message(", ".join(irc_paramlist), "bloodygonzo")
mode = irc_paramlist[2]
require_reg = conn.config.get('require_registered_channels', False)
if not "r" in mode and conn.name == "snoonet" and require_reg:
message("I do not stay in unregistered channels", irc_paramlist[1])
out = "PART {}".format(irc_paramlist[1])
conn.send(out)
# Identify to NickServ (or other service)
@asyncio.coroutine
@hook.irc_raw('004')
def onjoin(conn, bot):
"""
:type conn: cloudbot.clients.clients.IrcClient
:type bot: cloudbot.bot.CloudBot
"""
bot.logger.info("[{}|misc] Bot is sending join commands for network.".format(conn.name))
nickserv = conn.config.get('nickserv')
if nickserv and nickserv.get("enabled", True):
bot.logger.info("[{}|misc] Bot is authenticating with NickServ.".format(conn.name))
nickserv_password = nickserv.get('nickserv_password', '')
nickserv_name = nickserv.get('nickserv_name', 'nickserv')
nickserv_account_name = nickserv.get('nickserv_user', '')
nickserv_command = nickserv.get('nickserv_command', 'IDENTIFY')
if nickserv_password:
if "censored_strings" in bot.config and nickserv_password in bot.config['censored_strings']:
bot.config['censored_strings'].remove(nickserv_password)
if nickserv_account_name:
conn.message(nickserv_name, "{} {} {}".format(nickserv_command,
nickserv_account_name, nickserv_password))
else:
conn.message(nickserv_name, "{} {}".format(nickserv_command, nickserv_password))
if "censored_strings" in bot.config:
bot.config['censored_strings'].append(nickserv_password)
yield from asyncio.sleep(1)
# Should we oper up?
oper_pw = conn.config.get('oper_pw', False)
oper_user = conn.config.get('oper_user', False)
if oper_pw and oper_user:
out = "oper {} {}".format(oper_user, oper_pw)
conn.send(out)
# Set bot modes
mode = conn.config.get('mode')
if mode:
bot.logger.info("[{}|misc] Bot is setting mode on itself: {}".format(conn.name, mode))
conn.cmd('MODE', conn.nick, mode)
# Join config-defined channels
bot.logger.info("[{}|misc] Bot is joining channels for network.".format(conn.name))
for channel in conn.channels:
conn.join(channel)
yield from asyncio.sleep(0.4)
if conn.name == "snoonet":
mode = "mode {}".format(channel)
conn.send(mode)
conn.ready = True
bot.logger.info("[{}|misc] Bot has finished sending join commands for network.".format(conn.name))
@asyncio.coroutine
@hook.irc_raw('004')
def keep_alive(conn):
"""
:type conn: cloudbot.clients.clients.IrcClient
"""
keepalive = conn.config.get('keep_alive', False)
if keepalive:
while True:
conn.cmd('PING', conn.nick)
yield from asyncio.sleep(60)
|
gpl-3.0
|
leoetlino/ratp-next-stops
|
src/app/app.js
|
1226
|
var app = angular.module("prochainsTrains", [
"templates",
"ngRoute",
"ngSanitize",
"ngStorage",
"mgcrea.ngStrap",
"picardy.fontawesome",
]);
app.config(function ($routeProvider) {
$routeProvider.when("/", {
templateUrl: "/app/home/stops.html",
controller: "StopsCtrl",
controllerAs: "ctrl",
});
$routeProvider.when("/lines", {
templateUrl: "/app/lines/lines.html",
controller: "LinesCtrl",
controllerAs: "ctrl",
});
$routeProvider.when("/lines/:line", {
templateUrl: "/app/lines/lines.html",
controller: "LinesCtrl",
controllerAs: "ctrl",
});
$routeProvider.when("/lines/:line/:direction", {
templateUrl: "/app/lines/lines.html",
controller: "LinesCtrl",
controllerAs: "ctrl",
});
$routeProvider.when("/stations/line-:line/:station", {
templateUrl: "/app/station/station.html",
controller: "StationCtrl",
controllerAs: "ctrl",
resolve: {
lineDetails: (RatpService, $route) => {
return RatpService.getLineDetails($route.current.params.line);
},
},
});
$routeProvider.when("/settings", {
templateUrl: "/app/settings/settings.html",
controller: "SettingsCtrl",
controllerAs: "ctrl",
});
});
|
gpl-3.0
|
CraftedCart/smblevelworkshop2
|
ws2common/src/ws2common/scene/BackgroundGroupSceneNode.cpp
|
210
|
#include "ws2common/scene/BackgroundGroupSceneNode.hpp"
namespace WS2Common {
namespace Scene {
BackgroundGroupSceneNode::BackgroundGroupSceneNode(const QString name) : SceneNode(name) {}
}
}
|
gpl-3.0
|
ZeuJS/Apollo
|
bags/formValidators.js
|
324
|
"use strict";
var AbstractBag = require('zeujsChaos/bags/abstract.js');
var FormValidatorsBag = function FormValidatorsBag() {
AbstractBag.call(this);
};
FormValidatorsBag.prototype = Object.create(AbstractBag.prototype);
FormValidatorsBag.prototype.constructor = FormValidatorsBag;
module.exports = FormValidatorsBag;
|
gpl-3.0
|
cSploit/android.MSF
|
lib/metasploit/framework/login_scanner/gitlab.rb
|
3777
|
require 'metasploit/framework/login_scanner/http'
module Metasploit
module Framework
module LoginScanner
# GitLab login scanner
class GitLab < HTTP
# Inherit LIKELY_PORTS,LIKELY_SERVICE_NAMES, and REALM_KEY from HTTP
CAN_GET_SESSION = false
DEFAULT_PORT = 80
PRIVATE_TYPES = [ :password ]
# (see Base#set_sane_defaults)
def set_sane_defaults
self.uri = '/users/sign_in' if uri.nil?
self.method = 'POST' if method.nil?
super
end
def attempt_login(credential)
result_opts = {
credential: credential,
host: host,
port: port,
protocol: 'tcp',
service_name: ssl ? 'https' : 'http'
}
begin
cli = Rex::Proto::Http::Client.new(host,
port,
{
'Msf' => framework,
'MsfExploit' => framework_module
},
ssl,
ssl_version,
proxies)
configure_http_client(cli)
cli.connect
# Get a valid session cookie and authenticity_token for the next step
req = cli.request_cgi(
'method' => 'GET',
'cookie' => 'request_method=GET',
'uri' => uri
)
res = cli.send_recv(req)
if res.body.include? 'user[email]'
user_field = 'user[email]'
elsif res.body.include? 'user[login]'
user_field = 'user[login]'
else
fail RuntimeError, 'Not a valid GitLab login page'
end
local_session_cookie = res.get_cookies.scan(/(_gitlab_session=[A-Za-z0-9%-]+)/).flatten[0]
auth_token = res.body.scan(/<input name="authenticity_token" type="hidden" value="(.*?)"/).flatten[0]
fail RuntimeError, 'Unable to get Session Cookie' unless local_session_cookie
fail RuntimeError, 'Unable to get Authentication Token' unless auth_token
# Perform the actual login
req = cli.request_cgi(
'method' => 'POST',
'cookie' => local_session_cookie,
'uri' => uri,
'vars_post' =>
{
'utf8' => "\xE2\x9C\x93",
'authenticity_token' => auth_token,
"#{user_field}" => credential.public,
'user[password]' => credential.private,
'user[remember_me]' => 0
}
)
res = cli.send_recv(req)
if res && res.code == 302
result_opts.merge!(status: Metasploit::Model::Login::Status::SUCCESSFUL, proof: res.headers)
else
result_opts.merge!(status: Metasploit::Model::Login::Status::INCORRECT, proof: res)
end
rescue ::EOFError, Errno::ETIMEDOUT ,Errno::ECONNRESET, Rex::ConnectionError, OpenSSL::SSL::SSLError, ::Timeout::Error => e
result_opts.merge!(status: Metasploit::Model::Login::Status::UNABLE_TO_CONNECT, proof: e)
ensure
cli.close
end
Result.new(result_opts)
end
end
end
end
end
|
gpl-3.0
|
Marccspro/LudumDare32
|
Weapon/src/fr/veridiangames/main/game/level/tiles/items/weapons/WeaponItem.java
|
784
|
package fr.veridiangames.main.game.level.tiles.items.weapons;
import fr.veridiangames.main.game.Game;
import fr.veridiangames.main.game.entities.Player;
import fr.veridiangames.main.game.entities.weapons.Weapon;
import fr.veridiangames.main.game.level.tiles.items.Item;
public abstract class WeaponItem extends Item {
protected Weapon weapon;
public WeaponItem(float x, float y) {
super(x, y);
}
int time = (int) (Math.random() * 360);
public void update() {
if (removed) return;
time++;
h = (float) Math.sin(time * 0.1f) * 0.1f;
Player player = Game.getGame().getPlayer();
if (player.x > x - 0.5f && player.y > y - 0.5f && player.x < x + 1.5f && player.y < y + 1.5f) {
player.add(weapon);
removed = true;
}
}
}
|
gpl-3.0
|
Niky4000/UsefulUtils
|
projects/tutorials-master/tutorials-master/libraries/src/test/java/com/baeldung/eclipsecollections/DetectPatternUnitTest.java
|
674
|
package com.baeldung.eclipsecollections;
import org.assertj.core.api.Assertions;
import org.eclipse.collections.api.list.MutableList;
import org.eclipse.collections.impl.block.factory.Predicates;
import org.eclipse.collections.impl.list.mutable.FastList;
import org.junit.Before;
import org.junit.Test;
public class DetectPatternUnitTest {
MutableList<Integer> list;
@Before
public void getList() {
this.list = FastList.newListWith(1, 8, 5, 41, 31, 17, 23, 38);
}
@Test
public void whenDetect_thenCorrect() {
Integer result = list.detect(Predicates.greaterThan(30));
Assertions.assertThat(result).isEqualTo(41);
}
}
|
gpl-3.0
|
cachirulop/PhotoViewer
|
mapview.cpp
|
572
|
#include "mapview.h"
MapView::MapView() :
QQuickView()
{
setSource(QUrl("qrc:///qml/MapViewer.qml"));
_mapItem = rootObject()->findChild<QQuickItem *>("map");
setModality(Qt::ApplicationModal);
}
MapView::~MapView()
{
}
void MapView::setPosition(double latitude, double longitude, double altitude)
{
Q_UNUSED(altitude);
QMetaObject::invokeMethod(_mapItem,
"setPosition",
Q_ARG(QVariant, latitude),
Q_ARG(QVariant, longitude));
}
|
gpl-3.0
|
geminy/aidear
|
oss/qt/qt-everywhere-opensource-src-5.9.0/qtbase/examples/widgets/painting/composition/composition.cpp
|
20486
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the demonstration applications of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "composition.h"
#include <QBoxLayout>
#include <QRadioButton>
#include <QTimer>
#include <QDateTime>
#include <QSlider>
#include <QMouseEvent>
#include <qmath.h>
const int animationInterval = 15; // update every 16 ms = ~60FPS
CompositionWidget::CompositionWidget(QWidget *parent)
: QWidget(parent)
{
CompositionRenderer *view = new CompositionRenderer(this);
QGroupBox *mainGroup = new QGroupBox(parent);
mainGroup->setTitle(tr("Composition Modes"));
QGroupBox *modesGroup = new QGroupBox(mainGroup);
modesGroup->setTitle(tr("Mode"));
rbClear = new QRadioButton(tr("Clear"), modesGroup);
connect(rbClear, SIGNAL(clicked()), view, SLOT(setClearMode()));
rbSource = new QRadioButton(tr("Source"), modesGroup);
connect(rbSource, SIGNAL(clicked()), view, SLOT(setSourceMode()));
rbDest = new QRadioButton(tr("Destination"), modesGroup);
connect(rbDest, SIGNAL(clicked()), view, SLOT(setDestMode()));
rbSourceOver = new QRadioButton(tr("Source Over"), modesGroup);
connect(rbSourceOver, SIGNAL(clicked()), view, SLOT(setSourceOverMode()));
rbDestOver = new QRadioButton(tr("Destination Over"), modesGroup);
connect(rbDestOver, SIGNAL(clicked()), view, SLOT(setDestOverMode()));
rbSourceIn = new QRadioButton(tr("Source In"), modesGroup);
connect(rbSourceIn, SIGNAL(clicked()), view, SLOT(setSourceInMode()));
rbDestIn = new QRadioButton(tr("Dest In"), modesGroup);
connect(rbDestIn, SIGNAL(clicked()), view, SLOT(setDestInMode()));
rbSourceOut = new QRadioButton(tr("Source Out"), modesGroup);
connect(rbSourceOut, SIGNAL(clicked()), view, SLOT(setSourceOutMode()));
rbDestOut = new QRadioButton(tr("Dest Out"), modesGroup);
connect(rbDestOut, SIGNAL(clicked()), view, SLOT(setDestOutMode()));
rbSourceAtop = new QRadioButton(tr("Source Atop"), modesGroup);
connect(rbSourceAtop, SIGNAL(clicked()), view, SLOT(setSourceAtopMode()));
rbDestAtop = new QRadioButton(tr("Dest Atop"), modesGroup);
connect(rbDestAtop, SIGNAL(clicked()), view, SLOT(setDestAtopMode()));
rbXor = new QRadioButton(tr("Xor"), modesGroup);
connect(rbXor, SIGNAL(clicked()), view, SLOT(setXorMode()));
rbPlus = new QRadioButton(tr("Plus"), modesGroup);
connect(rbPlus, SIGNAL(clicked()), view, SLOT(setPlusMode()));
rbMultiply = new QRadioButton(tr("Multiply"), modesGroup);
connect(rbMultiply, SIGNAL(clicked()), view, SLOT(setMultiplyMode()));
rbScreen = new QRadioButton(tr("Screen"), modesGroup);
connect(rbScreen, SIGNAL(clicked()), view, SLOT(setScreenMode()));
rbOverlay = new QRadioButton(tr("Overlay"), modesGroup);
connect(rbOverlay, SIGNAL(clicked()), view, SLOT(setOverlayMode()));
rbDarken = new QRadioButton(tr("Darken"), modesGroup);
connect(rbDarken, SIGNAL(clicked()), view, SLOT(setDarkenMode()));
rbLighten = new QRadioButton(tr("Lighten"), modesGroup);
connect(rbLighten, SIGNAL(clicked()), view, SLOT(setLightenMode()));
rbColorDodge = new QRadioButton(tr("Color Dodge"), modesGroup);
connect(rbColorDodge, SIGNAL(clicked()), view, SLOT(setColorDodgeMode()));
rbColorBurn = new QRadioButton(tr("Color Burn"), modesGroup);
connect(rbColorBurn, SIGNAL(clicked()), view, SLOT(setColorBurnMode()));
rbHardLight = new QRadioButton(tr("Hard Light"), modesGroup);
connect(rbHardLight, SIGNAL(clicked()), view, SLOT(setHardLightMode()));
rbSoftLight = new QRadioButton(tr("Soft Light"), modesGroup);
connect(rbSoftLight, SIGNAL(clicked()), view, SLOT(setSoftLightMode()));
rbDifference = new QRadioButton(tr("Difference"), modesGroup);
connect(rbDifference, SIGNAL(clicked()), view, SLOT(setDifferenceMode()));
rbExclusion = new QRadioButton(tr("Exclusion"), modesGroup);
connect(rbExclusion, SIGNAL(clicked()), view, SLOT(setExclusionMode()));
QGroupBox *circleColorGroup = new QGroupBox(mainGroup);
circleColorGroup->setTitle(tr("Circle color"));
QSlider *circleColorSlider = new QSlider(Qt::Horizontal, circleColorGroup);
circleColorSlider->setRange(0, 359);
circleColorSlider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
connect(circleColorSlider, SIGNAL(valueChanged(int)), view, SLOT(setCircleColor(int)));
QGroupBox *circleAlphaGroup = new QGroupBox(mainGroup);
circleAlphaGroup->setTitle(tr("Circle alpha"));
QSlider *circleAlphaSlider = new QSlider(Qt::Horizontal, circleAlphaGroup);
circleAlphaSlider->setRange(0, 255);
circleAlphaSlider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
connect(circleAlphaSlider, SIGNAL(valueChanged(int)), view, SLOT(setCircleAlpha(int)));
QPushButton *showSourceButton = new QPushButton(mainGroup);
showSourceButton->setText(tr("Show Source"));
#if defined(USE_OPENGL) && !defined(QT_OPENGL_ES)
QPushButton *enableOpenGLButton = new QPushButton(mainGroup);
enableOpenGLButton->setText(tr("Use OpenGL"));
enableOpenGLButton->setCheckable(true);
enableOpenGLButton->setChecked(view->usesOpenGL());
if (!QGLFormat::hasOpenGL() || !QGLPixelBuffer::hasOpenGLPbuffers())
enableOpenGLButton->hide();
#endif
QPushButton *whatsThisButton = new QPushButton(mainGroup);
whatsThisButton->setText(tr("What's This?"));
whatsThisButton->setCheckable(true);
QPushButton *animateButton = new QPushButton(mainGroup);
animateButton->setText(tr("Animated"));
animateButton->setCheckable(true);
animateButton->setChecked(true);
QHBoxLayout *viewLayout = new QHBoxLayout(this);
viewLayout->addWidget(view);
viewLayout->addWidget(mainGroup);
QVBoxLayout *mainGroupLayout = new QVBoxLayout(mainGroup);
mainGroupLayout->addWidget(circleColorGroup);
mainGroupLayout->addWidget(circleAlphaGroup);
mainGroupLayout->addWidget(modesGroup);
mainGroupLayout->addStretch();
mainGroupLayout->addWidget(animateButton);
mainGroupLayout->addWidget(whatsThisButton);
mainGroupLayout->addWidget(showSourceButton);
#if defined(USE_OPENGL) && !defined(QT_OPENGL_ES)
mainGroupLayout->addWidget(enableOpenGLButton);
#endif
QGridLayout *modesLayout = new QGridLayout(modesGroup);
modesLayout->addWidget(rbClear, 0, 0);
modesLayout->addWidget(rbSource, 1, 0);
modesLayout->addWidget(rbDest, 2, 0);
modesLayout->addWidget(rbSourceOver, 3, 0);
modesLayout->addWidget(rbDestOver, 4, 0);
modesLayout->addWidget(rbSourceIn, 5, 0);
modesLayout->addWidget(rbDestIn, 6, 0);
modesLayout->addWidget(rbSourceOut, 7, 0);
modesLayout->addWidget(rbDestOut, 8, 0);
modesLayout->addWidget(rbSourceAtop, 9, 0);
modesLayout->addWidget(rbDestAtop, 10, 0);
modesLayout->addWidget(rbXor, 11, 0);
modesLayout->addWidget(rbPlus, 0, 1);
modesLayout->addWidget(rbMultiply, 1, 1);
modesLayout->addWidget(rbScreen, 2, 1);
modesLayout->addWidget(rbOverlay, 3, 1);
modesLayout->addWidget(rbDarken, 4, 1);
modesLayout->addWidget(rbLighten, 5, 1);
modesLayout->addWidget(rbColorDodge, 6, 1);
modesLayout->addWidget(rbColorBurn, 7, 1);
modesLayout->addWidget(rbHardLight, 8, 1);
modesLayout->addWidget(rbSoftLight, 9, 1);
modesLayout->addWidget(rbDifference, 10, 1);
modesLayout->addWidget(rbExclusion, 11, 1);
QVBoxLayout *circleColorLayout = new QVBoxLayout(circleColorGroup);
circleColorLayout->addWidget(circleColorSlider);
QVBoxLayout *circleAlphaLayout = new QVBoxLayout(circleAlphaGroup);
circleAlphaLayout->addWidget(circleAlphaSlider);
view->loadDescription(":res/composition/composition.html");
view->loadSourceFile(":res/composition/composition.cpp");
connect(whatsThisButton, SIGNAL(clicked(bool)), view, SLOT(setDescriptionEnabled(bool)));
connect(view, SIGNAL(descriptionEnabledChanged(bool)), whatsThisButton, SLOT(setChecked(bool)));
connect(showSourceButton, SIGNAL(clicked()), view, SLOT(showSource()));
#if defined(USE_OPENGL) && !defined(QT_OPENGL_ES)
connect(enableOpenGLButton, SIGNAL(clicked(bool)), view, SLOT(enableOpenGL(bool)));
#endif
connect(animateButton, SIGNAL(toggled(bool)), view, SLOT(setAnimationEnabled(bool)));
circleColorSlider->setValue(270);
circleAlphaSlider->setValue(200);
rbSourceOut->animateClick();
setWindowTitle(tr("Composition Modes"));
}
void CompositionWidget::nextMode()
{
/*
if (!m_animation_enabled)
return;
if (rbClear->isChecked()) rbSource->animateClick();
if (rbSource->isChecked()) rbDest->animateClick();
if (rbDest->isChecked()) rbSourceOver->animateClick();
if (rbSourceOver->isChecked()) rbDestOver->animateClick();
if (rbDestOver->isChecked()) rbSourceIn->animateClick();
if (rbSourceIn->isChecked()) rbDestIn->animateClick();
if (rbDestIn->isChecked()) rbSourceOut->animateClick();
if (rbSourceOut->isChecked()) rbDestOut->animateClick();
if (rbDestOut->isChecked()) rbSourceAtop->animateClick();
if (rbSourceAtop->isChecked()) rbDestAtop->animateClick();
if (rbDestAtop->isChecked()) rbXor->animateClick();
if (rbXor->isChecked()) rbClear->animateClick();
*/
}
CompositionRenderer::CompositionRenderer(QWidget *parent)
: ArthurFrame(parent)
{
m_animation_enabled = true;
m_animationTimer = startTimer(animationInterval);
m_image = QImage(":res/composition/flower.jpg");
m_image.setAlphaChannel(QImage(":res/composition/flower_alpha.jpg"));
m_circle_alpha = 127;
m_circle_hue = 255;
m_current_object = NoObject;
m_composition_mode = QPainter::CompositionMode_SourceOut;
m_circle_pos = QPoint(200, 100);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
#ifdef USE_OPENGL
m_pbuffer = 0;
m_pbuffer_size = 1024;
#endif
}
QRectF rectangle_around(const QPointF &p, const QSizeF &size = QSize(250, 200))
{
QRectF rect(p, size);
rect.translate(-size.width()/2, -size.height()/2);
return rect;
}
void CompositionRenderer::setAnimationEnabled(bool enabled)
{
if (m_animation_enabled == enabled)
return;
m_animation_enabled = enabled;
if (enabled) {
Q_ASSERT(!m_animationTimer);
m_animationTimer = startTimer(animationInterval);
} else {
killTimer(m_animationTimer);
m_animationTimer = 0;
}
}
void CompositionRenderer::updateCirclePos()
{
if (m_current_object != NoObject)
return;
QDateTime dt = QDateTime::currentDateTime();
qreal t = dt.toMSecsSinceEpoch() / 1000.0;
qreal x = width() / qreal(2) + (qCos(t*8/11) + qSin(-t)) * width() / qreal(4);
qreal y = height() / qreal(2) + (qSin(t*6/7) + qCos(t * qreal(1.5))) * height() / qreal(4);
setCirclePos(QLineF(m_circle_pos, QPointF(x, y)).pointAt(0.02));
}
void CompositionRenderer::drawBase(QPainter &p)
{
p.setPen(Qt::NoPen);
QLinearGradient rect_gradient(0, 0, 0, height());
rect_gradient.setColorAt(0, Qt::red);
rect_gradient.setColorAt(.17, Qt::yellow);
rect_gradient.setColorAt(.33, Qt::green);
rect_gradient.setColorAt(.50, Qt::cyan);
rect_gradient.setColorAt(.66, Qt::blue);
rect_gradient.setColorAt(.81, Qt::magenta);
rect_gradient.setColorAt(1, Qt::red);
p.setBrush(rect_gradient);
p.drawRect(width() / 2, 0, width() / 2, height());
QLinearGradient alpha_gradient(0, 0, width(), 0);
alpha_gradient.setColorAt(0, Qt::white);
alpha_gradient.setColorAt(0.2, Qt::white);
alpha_gradient.setColorAt(0.5, Qt::transparent);
alpha_gradient.setColorAt(0.8, Qt::white);
alpha_gradient.setColorAt(1, Qt::white);
p.setCompositionMode(QPainter::CompositionMode_DestinationIn);
p.setBrush(alpha_gradient);
p.drawRect(0, 0, width(), height());
p.setCompositionMode(QPainter::CompositionMode_DestinationOver);
p.setPen(Qt::NoPen);
p.setRenderHint(QPainter::SmoothPixmapTransform);
p.drawImage(rect(), m_image);
}
void CompositionRenderer::drawSource(QPainter &p)
{
p.setPen(Qt::NoPen);
p.setRenderHint(QPainter::Antialiasing);
p.setCompositionMode(m_composition_mode);
QRectF circle_rect = rectangle_around(m_circle_pos);
QColor color = QColor::fromHsvF(m_circle_hue / 360.0, 1, 1, m_circle_alpha / 255.0);
QLinearGradient circle_gradient(circle_rect.topLeft(), circle_rect.bottomRight());
circle_gradient.setColorAt(0, color.light());
circle_gradient.setColorAt(0.5, color);
circle_gradient.setColorAt(1, color.dark());
p.setBrush(circle_gradient);
p.drawEllipse(circle_rect);
}
void CompositionRenderer::paint(QPainter *painter)
{
#if defined(USE_OPENGL) && !defined(QT_OPENGL_ES)
if (usesOpenGL()) {
int new_pbuf_size = m_pbuffer_size;
if (size().width() > m_pbuffer_size || size().height() > m_pbuffer_size)
new_pbuf_size *= 2;
if (size().width() < m_pbuffer_size/2 && size().height() < m_pbuffer_size/2)
new_pbuf_size /= 2;
if (!m_pbuffer || new_pbuf_size != m_pbuffer_size) {
if (m_pbuffer) {
m_pbuffer->deleteTexture(m_base_tex);
m_pbuffer->deleteTexture(m_compositing_tex);
delete m_pbuffer;
}
m_pbuffer = new QGLPixelBuffer(QSize(new_pbuf_size, new_pbuf_size), QGLFormat::defaultFormat(), glWidget());
m_pbuffer->makeCurrent();
m_base_tex = m_pbuffer->generateDynamicTexture();
m_compositing_tex = m_pbuffer->generateDynamicTexture();
m_pbuffer_size = new_pbuf_size;
}
if (size() != m_previous_size) {
m_previous_size = size();
QPainter p(m_pbuffer);
p.setCompositionMode(QPainter::CompositionMode_Source);
p.fillRect(QRect(0, 0, m_pbuffer->width(), m_pbuffer->height()), Qt::transparent);
drawBase(p);
p.end();
m_pbuffer->updateDynamicTexture(m_base_tex);
}
qreal x_fraction = width()/float(m_pbuffer->width());
qreal y_fraction = height()/float(m_pbuffer->height());
{
QPainter p(m_pbuffer);
p.setCompositionMode(QPainter::CompositionMode_Source);
p.fillRect(QRect(0, 0, m_pbuffer->width(), m_pbuffer->height()), Qt::transparent);
p.save(); // Needed when using the GL1 engine
p.beginNativePainting(); // Needed when using the GL2 engine
glBindTexture(GL_TEXTURE_2D, m_base_tex);
glEnable(GL_TEXTURE_2D);
glColor4f(1.,1.,1.,1.);
glBegin(GL_QUADS);
{
glTexCoord2f(0, 1.0);
glVertex2f(0, 0);
glTexCoord2f(x_fraction, 1.0);
glVertex2f(width(), 0);
glTexCoord2f(x_fraction, 1.0-y_fraction);
glVertex2f(width(), height());
glTexCoord2f(0, 1.0-y_fraction);
glVertex2f(0, height());
}
glEnd();
glDisable(GL_TEXTURE_2D);
p.endNativePainting(); // Needed when using the GL2 engine
p.restore(); // Needed when using the GL1 engine
drawSource(p);
p.end();
m_pbuffer->updateDynamicTexture(m_compositing_tex);
}
painter->beginNativePainting(); // Needed when using the GL2 engine
glWidget()->makeCurrent(); // Needed when using the GL1 engine
glBindTexture(GL_TEXTURE_2D, m_compositing_tex);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(1.,1.,1.,1.);
glBegin(GL_QUADS);
{
glTexCoord2f(0, 1.0);
glVertex2f(0, 0);
glTexCoord2f(x_fraction, 1.0);
glVertex2f(width(), 0);
glTexCoord2f(x_fraction, 1.0-y_fraction);
glVertex2f(width(), height());
glTexCoord2f(0, 1.0-y_fraction);
glVertex2f(0, height());
}
glEnd();
glDisable(GL_TEXTURE_2D);
painter->endNativePainting(); // Needed when using the GL2 engine
} else
#endif
{
// using a QImage
if (m_buffer.size() != size()) {
m_buffer = QImage(size(), QImage::Format_ARGB32_Premultiplied);
m_base_buffer = QImage(size(), QImage::Format_ARGB32_Premultiplied);
m_base_buffer.fill(0);
QPainter p(&m_base_buffer);
drawBase(p);
}
memcpy(m_buffer.bits(), m_base_buffer.bits(), m_buffer.byteCount());
{
QPainter p(&m_buffer);
drawSource(p);
}
painter->drawImage(0, 0, m_buffer);
}
}
void CompositionRenderer::mousePressEvent(QMouseEvent *e)
{
setDescriptionEnabled(false);
QRectF circle = rectangle_around(m_circle_pos);
if (circle.contains(e->pos())) {
m_current_object = Circle;
m_offset = circle.center() - e->pos();
} else {
m_current_object = NoObject;
}
if (m_animation_enabled) {
killTimer(m_animationTimer);
m_animationTimer = 0;
}
}
void CompositionRenderer::mouseMoveEvent(QMouseEvent *e)
{
if (m_current_object == Circle)
setCirclePos(e->pos() + m_offset);
}
void CompositionRenderer::mouseReleaseEvent(QMouseEvent *)
{
m_current_object = NoObject;
if (m_animation_enabled) {
Q_ASSERT(!m_animationTimer);
m_animationTimer = startTimer(animationInterval);
}
}
void CompositionRenderer::timerEvent(QTimerEvent *event)
{
if (event->timerId() == m_animationTimer)
updateCirclePos();
}
void CompositionRenderer::setCirclePos(const QPointF &pos)
{
const QRect oldRect = rectangle_around(m_circle_pos).toAlignedRect();
m_circle_pos = pos;
const QRect newRect = rectangle_around(m_circle_pos).toAlignedRect();
#if defined(USE_OPENGL) && !defined(QT_OPENGL_ES)
if (usesOpenGL()) {
update();
return;
}
#endif
update(oldRect | newRect);
}
|
gpl-3.0
|
otavanopisto/pyramus
|
framework/src/main/java/fi/otavanopisto/pyramus/koski/model/lukio/ops2019/LukionOpintojaksonTunnisteVierasKieli2019.java
|
1125
|
package fi.otavanopisto.pyramus.koski.model.lukio.ops2019;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import fi.otavanopisto.pyramus.koski.KoodistoViite;
import fi.otavanopisto.pyramus.koski.koodisto.ModuuliKoodistoLOPS2021;
import fi.otavanopisto.pyramus.koski.model.Laajuus;
/**
* Käytetään vieraan kielen aineille A, B1, B2, B3, AOM
*/
@JsonDeserialize(using = JsonDeserializer.None.class)
@JsonIgnoreProperties(ignoreUnknown = true)
public class LukionOpintojaksonTunnisteVierasKieli2019 extends LukionOpintojaksonTunniste2019 {
public LukionOpintojaksonTunnisteVierasKieli2019() {
}
public LukionOpintojaksonTunnisteVierasKieli2019(ModuuliKoodistoLOPS2021 tunniste, Laajuus laajuus, boolean pakollinen) {
super(laajuus, pakollinen);
this.tunniste.setValue(tunniste);
}
public KoodistoViite<ModuuliKoodistoLOPS2021> getTunniste() {
return tunniste;
}
private final KoodistoViite<ModuuliKoodistoLOPS2021> tunniste = new KoodistoViite<>();
}
|
gpl-3.0
|
niuware/MSBandViewer
|
MSBandViewer/AppShell.xaml.cs
|
11155
|
using System.Collections.Generic;
using System.Linq;
using Windows.Foundation;
using Windows.UI.Xaml.Automation;
using Windows.UI.Core;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
using Niuware.MSBandViewer.Controls;
using Niuware.MSBandViewer.Views;
using Niuware.MSBandViewer.DataModels;
namespace Niuware.MSBandViewer
{
public sealed partial class AppShell : Page
{
private List<NavMenuItem> navlist = new List<NavMenuItem>(
new[]
{
new NavMenuItem()
{
Symbol = Symbol.Home,
Label = "Dashboard",
DestPage = typeof(DashboardPage)
},
new NavMenuItem()
{
Symbol = Symbol.Setting,
Label = "Settings",
DestPage = typeof(SettingsPage)
}
});
public static AppShell Current = null;
public string LastView { get; set; }
public AppShell()
{
this.InitializeComponent();
this.Loaded += (sender, args) =>
{
Current = this;
this.TogglePaneButton.Focus(FocusState.Programmatic);
};
this.RootSplitView.RegisterPropertyChangedCallback(
SplitView.DisplayModeProperty,
(s, a) =>
{
// Ensure that we update the reported size of the TogglePaneButton when the SplitView's
// DisplayMode changes.
this.CheckTogglePaneButtonSizeChanged();
});
this.RootSplitView.RegisterPropertyChangedCallback(SplitView.IsPaneOpenProperty, IsPaneOpenPropertyChanged);
SystemNavigationManager.GetForCurrentView().BackRequested += SystemNavigationManager_BackRequested;
NavMenuList.ItemsSource = navlist;
NavMenuList.SelectedItem = navlist[0];
}
public Frame AppFrame { get { return this.frame; } }
#region BackRequested Handlers
private void SystemNavigationManager_BackRequested(object sender, BackRequestedEventArgs e)
{
if (!e.Handled && this.AppFrame.CanGoBack)
{
e.Handled = true;
// We prevent going back if async operations of the band are still
// in process
if (AppFrame.Content.GetType() == typeof(DashboardPage))
{
if (!(this.AppFrame.Content as DashboardPage).IsUnloadActive())
{
UpdateNavMenuList();
return;
}
}
this.AppFrame.GoBack();
}
}
#endregion
#region Navigation
/// <summary>
/// Navigate to the Page for the selected <paramref name="listViewItem"/>.
/// </summary>
/// <param name="sender"></param>
/// <param name="listViewItem"></param>
private void NavMenuList_ItemInvoked(object sender, ListViewItem listViewItem)
{
var item = (NavMenuItem)((NavMenuListView)sender).ItemFromContainer(listViewItem);
if (item != null)
{
if (item.DestPage != null &&
item.DestPage != this.AppFrame.CurrentSourcePageType)
{
this.AppFrame.Navigate(item.DestPage, item.Arguments);
}
}
}
/// <summary>
/// Ensures the nav menu reflects reality when navigation is triggered outside of
/// the nav menu buttons.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnNavigatingToPage(object sender, NavigatingCancelEventArgs e)
{
if (e.NavigationMode == NavigationMode.Back)
{
var item = (from p in this.navlist where p.DestPage == e.SourcePageType select p).SingleOrDefault();
if (item == null && this.AppFrame.BackStackDepth > 0)
{
// In cases where a page drills into sub-pages then we'll highlight the most recent
// navigation menu item that appears in the BackStack
foreach (var entry in this.AppFrame.BackStack.Reverse())
{
item = (from p in this.navlist where p.DestPage == entry.SourcePageType select p).SingleOrDefault();
if (item != null)
break;
}
}
var container = (ListViewItem)NavMenuList.ContainerFromItem(item);
// While updating the selection state of the item prevent it from taking keyboard focus. If a
// user is invoking the back button via the keyboard causing the selected nav menu item to change
// then focus will remain on the back button.
if (container != null) container.IsTabStop = false;
NavMenuList.SetSelectedItem(container);
if (container != null) container.IsTabStop = true;
}
}
private void OnNavigatedToPage(object sender, NavigationEventArgs e)
{
// After a successful navigation set keyboard focus to the loaded page
if (e.Content is Page && e.Content != null)
{
var control = (Page)e.Content;
control.Loaded += Page_Loaded;
}
/** Uncomment the following lines for enabling the use of the SystemNavigation Back button **/
// Update the Back button depending on whether we can go Back.
//SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
// AppFrame.CanGoBack ?
// AppViewBackButtonVisibility.Visible :
// AppViewBackButtonVisibility.Collapsed;
}
private void Page_Loaded(object sender, RoutedEventArgs e)
{
((Page)sender).Focus(FocusState.Programmatic);
((Page)sender).Loaded -= Page_Loaded;
this.CheckTogglePaneButtonSizeChanged();
}
#endregion
public Rect TogglePaneButtonRect
{
get;
private set;
}
/// <summary>
/// An event to notify listeners when the hamburger button may occlude other content in the app.
/// The custom "PageHeader" user control is using this.
/// </summary>
public event TypedEventHandler<AppShell, Rect> TogglePaneButtonRectChanged;
/// <summary>
/// Callback when the SplitView's Pane is toggled open or close. When the Pane is not visible
/// then the floating hamburger may be occluding other content in the app unless it is aware.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void TogglePaneButton_Checked(object sender, RoutedEventArgs e)
{
this.CheckTogglePaneButtonSizeChanged();
}
/// <summary>
/// Check for the conditions where the navigation pane does not occupy the space under the floating
/// hamburger button and trigger the event.
/// </summary>
private void CheckTogglePaneButtonSizeChanged()
{
if (this.RootSplitView.DisplayMode == SplitViewDisplayMode.Inline ||
this.RootSplitView.DisplayMode == SplitViewDisplayMode.Overlay)
{
var transform = this.TogglePaneButton.TransformToVisual(this);
var rect = transform.TransformBounds(new Rect(0, 0, this.TogglePaneButton.ActualWidth, this.TogglePaneButton.ActualHeight));
this.TogglePaneButtonRect = rect;
}
else
{
this.TogglePaneButtonRect = new Rect();
}
var handler = this.TogglePaneButtonRectChanged;
if (handler != null)
{
// handler(this, this.TogglePaneButtonRect);
handler.DynamicInvoke(this, this.TogglePaneButtonRect);
}
}
/// <summary>
/// Enable accessibility on each nav menu item by setting the AutomationProperties.Name on each container
/// using the associated Label of each item.
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
private void NavMenuItemContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
{
if (!args.InRecycleQueue && args.Item != null && args.Item is NavMenuItem)
{
args.ItemContainer.SetValue(AutomationProperties.NameProperty, ((NavMenuItem)args.Item).Label);
}
else
{
args.ItemContainer.ClearValue(AutomationProperties.NameProperty);
}
UpdateNavMenuList();
}
private void IsPaneOpenPropertyChanged(DependencyObject sender, DependencyProperty dp)
{
UpdateNavMenuList();
}
/// <summary>
/// If the Band object has async operations we cannot dispose it, so we disable the option to change the current page
/// until all async operations are done
/// </summary>
private void UpdateNavMenuList()
{
if (AppFrame.Content.GetType() == typeof(DashboardPage))
{
var items = (from p in this.navlist where p.DestPage != typeof(DashboardPage) select p);
if (!(AppFrame.Content as DashboardPage).IsUnloadActive())
{
EnableNavMenuItem(items, false);
}
else
{
EnableNavMenuItem(navlist, true);
}
}
else
{
EnableNavMenuItem(navlist, true);
}
}
/// <summary>
/// Enable or disable the selected items from the navigation ListView
/// </summary>
/// <param name="collection">Collection of items to update</param>
/// <param name="enable">Enable or disable</param>
private void EnableNavMenuItem(IEnumerable<NavMenuItem> collection, bool enable)
{
foreach (NavMenuItem it in collection)
{
ListViewItem container = (ListViewItem)NavMenuList.ContainerFromItem(it);
if (container != null)
{
container.IsEnabled = enable;
}
}
}
}
}
|
gpl-3.0
|
goncalomb/CustomItemsAPI
|
src/main/java/com/goncalomb/bukkit/customitemsapi/api/CustomItemListener.java
|
8801
|
/*
* Copyright (C) 2013 - Gonçalo Baltazar <http://goncalomb.com>
*
* This file is part of CustomItemsAPI.
*
* CustomItemsAPI is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CustomItemsAPI is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CustomItemsAPI. If not, see <http://www.gnu.org/licenses/>.
*/
package com.goncalomb.bukkit.customitemsapi.api;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.command.defaults.GameRuleCommand;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockDispenseEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityShootBowEvent;
import org.bukkit.event.entity.ItemDespawnEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.inventory.InventoryPickupItemEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.metadata.FixedMetadataValue;
import com.goncalomb.bukkit.bkglib.Lang;
final class CustomItemListener implements Listener {
private static final HashSet<Material> _interationMaterials = new HashSet<Material>(Arrays.asList(new Material[] { Material.WORKBENCH, Material.CHEST, Material.ENDER_CHEST, Material.BREWING_STAND, Material.ENCHANTMENT_TABLE }));
private static boolean verifyCustomItem(CustomItem customItem, World world) {
return (customItem != null && customItem.isEnabled() && customItem.isValidWorld(world));
}
private static boolean verifyCustomItem(CustomItem customItem, Player player, boolean silent) {
if (customItem != null) {
if (!customItem.isEnabled()) {
if (!silent) player.sendMessage(Lang._(null, "customitemsapi.disabled"));
} else if (player != null && !player.hasPermission("customitemsapi.use." + customItem.getSlug())) {
if (!silent) player.sendMessage(Lang._(null, "customitemsapi.no-perm"));
} else if (!customItem.isValidWorld(player.getWorld()) && !player.hasPermission("customitemsapi.world-override." + customItem.getSlug())) {
if (!silent) player.sendMessage(Lang._(null, "customitemsapi.invalid-world"));
} else {
return true;
}
}
return false;
}
@EventHandler
private void playerInteract(PlayerInteractEvent event) {
Action action = event.getAction();
if (action != Action.PHYSICAL) {
if (action == Action.RIGHT_CLICK_BLOCK && _interationMaterials.contains(event.getClickedBlock().getType())) {
return;
}
CustomItem customItem = CustomItemManager.getCustomItem(event.getItem());
if (customItem != null) {
if (verifyCustomItem(customItem, event.getPlayer(), false)) {
if (action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK) {
customItem.onRightClick(event, new PlayerDetails(event));
} else if (action == Action.LEFT_CLICK_AIR || action == Action.LEFT_CLICK_BLOCK) {
customItem.onLeftClick(event, new PlayerDetails(event));
}
} else {
event.setCancelled(true);
}
}
}
}
@EventHandler
private void playerInteract(BlockBreakEvent event) {
ItemStack item = event.getPlayer().getItemInHand();
CustomItem customItem = CustomItemManager.getCustomItem(item);
if (customItem != null) {
if (verifyCustomItem(customItem, event.getPlayer(), false)) {
customItem.onBlockBreak(event, new PlayerDetails(event));
} else {
event.setCancelled(true);
}
}
}
@EventHandler
private void playerInteractEntity(PlayerInteractEntityEvent event) {
Player player = event.getPlayer();
ItemStack item = player.getItemInHand();
CustomItem customItem = CustomItemManager.getCustomItem(item);
if (customItem != null) {
if (verifyCustomItem(customItem, event.getPlayer(), false)) {
event.setCancelled(true);
customItem.onInteractEntity(event, new PlayerDetails(item, event.getPlayer()));
}
}
}
@EventHandler
private void entityDamageByEntity(EntityDamageByEntityEvent event) {
Entity damager = event.getDamager();
if (damager instanceof Player) {
Player player = (Player) damager;
ItemStack item = player.getItemInHand();
CustomItem customItem = CustomItemManager.getCustomItem(item);
if (customItem != null) {
if (verifyCustomItem(customItem, player, true)) {
customItem.onAttack(event, new PlayerDetails(item, player));
}
}
} else {
if (damager.hasMetadata("CustomItem-bow")) {
Object[] data = (Object[]) damager.getMetadata("CustomItem-bow").get(0).value();
((CustomBow) data[0]).onProjectileDamageEntity(event, (DelayedPlayerDetails) data[1]);
}
}
}
@EventHandler
private void playerPickupItem(PlayerPickupItemEvent event) {
CustomItem customItem = CustomItemManager.getCustomItem(event.getItem().getItemStack());
if (verifyCustomItem(customItem, event.getPlayer(), true)) {
customItem.onPickup(event);
}
}
@EventHandler
private void playerDropItem(PlayerDropItemEvent event) {
CustomItem customItem = CustomItemManager.getCustomItem(event.getItemDrop().getItemStack());
if (verifyCustomItem(customItem, event.getPlayer(), true)) {
customItem.onDrop(event);
}
}
@EventHandler
private void itemDespawnItem(ItemDespawnEvent event) {
CustomItem customItem = CustomItemManager.getCustomItem(event.getEntity().getItemStack());
if (verifyCustomItem(customItem, event.getEntity().getWorld())) {
customItem.onDespawn(event);
}
}
@EventHandler
private void inventoryPickupItemItem(InventoryPickupItemEvent event) {
CustomItem customItem = CustomItemManager.getCustomItem(event.getItem().getItemStack());
if (verifyCustomItem(customItem, event.getItem().getWorld())) {
customItem.onDropperPickup(event);
}
}
@EventHandler
private void entityShootBow(EntityShootBowEvent event) {
if (event.getEntity() instanceof Player) {
Player player = (Player) event.getEntity();
CustomItem customItem = CustomItemManager.getCustomItem(event.getBow());
if (verifyCustomItem(customItem, player, false)) {
DelayedPlayerDetails details = new DelayedPlayerDetails(event.getBow(), player);
((CustomBow) customItem).onShootBow(event, details);
if (!event.isCancelled() && event.getProjectile() instanceof Projectile) {
details.lock();
event.getProjectile().setMetadata("CustomItem-bow", new FixedMetadataValue(CustomItemManager._plugin, new Object[] { customItem, details }));
}
}
}
}
@EventHandler
private void projectileHit(ProjectileHitEvent event) {
Projectile projectile = event.getEntity();
if (projectile.hasMetadata("CustomItem-bow")) {
Object[] data = (Object[]) projectile.getMetadata("CustomItem-bow").get(0).value();
((CustomBow) data[0]).onProjectileHit(event, (DelayedPlayerDetails) data[1]);
}
}
@EventHandler
private void blockDispense(BlockDispenseEvent event) {
if (event.getBlock().getType() != Material.DISPENSER) {
return;
}
CustomItem customItem = CustomItemManager.getCustomItem(event.getItem());
if (customItem != null) {
if (verifyCustomItem(customItem, event.getBlock().getWorld())) {
customItem.onDispense(event, new DispenserDetails(event, customItem._owner));
} else {
event.setCancelled(true);
}
}
}
@EventHandler
private void playerDeath(PlayerDeathEvent event) {
Player player = event.getEntity();
for (ItemStack item : event.getDrops()) {
CustomItem customItem = CustomItemManager.getCustomItem(item);
if (verifyCustomItem(customItem, player, true)) {
// This is very dirty, all "Details" classes need to be refactored.
customItem.onPlayerDeath(event, new PlayerDetails(item, player) {
@Override
public void consumeItem() {
if (_player.getGameMode() == GameMode.CREATIVE) return;
_item.setAmount(_item.getAmount() - 1);
}
});
}
}
}
}
|
gpl-3.0
|
manterd/myPhyloDB
|
functions/__init__.py
|
2310
|
### analysis folder
#TODO remove entries only analysis class is complete
from analysis.anova_graphs import getCatUnivData, getQuantUnivData
from analysis.corr_graphs import getCorr
from analysis.diffabund_graphs import getDiffAbund
from analysis.gage_graphs import getGAGE
from analysis.norm_graphs import getNorm, getTab, getBiom
from analysis.pca_graphs import getPCA
from analysis.pcoa_graphs import getPCoA
from analysis.pybake import statusPyBake, geneParse, koParse, nzParse
from analysis.rf_graphs import getRF
from analysis.soil_index_graphs import getsoil_index
from analysis.spac_graphs import getSpAC
from analysis.spls_graphs import getSPLS
from analysis.wgcna_graphs import getWGCNA
### queues folder
from queues.queue import funcCall, getBase, process, setBase, stop, getAnalysisQueue, getAnalysisHistory
from queues.dataqueue import datstop, dataprocess, datfuncCall, datstat, getDataQueue
### utils folder
from utils.parsers import parse_project, parse_reference, parse_sample, parse_taxonomy, parse_biom, parse_profile, \
mothur, dada2, reanalyze, status, termP, projectid, validateSamples
from utils.trees import getProjectTree, getProjectTreeChildren, \
getSampleCatTree, getSampleCatTreeChildren, \
getSampleQuantTree, getSampleQuantTreeChildren, \
getTaxaTree, getTaxaTreeChildren, \
getKEGGTree, getKEGGTreeChildren, \
getNZTree, getNZTreeChildren, \
getDownloadTree, getDownloadTreeChildren, \
getKEGGTree2, \
getPermissionTree, getFilePermTree, makeReproTree, makeUpdateTree, makeFilesTree, getLocationSamplesTree,\
getFilterSamplesTree
from utils.utils_df import cleanup, handle_uploaded_file, multidict, remove_proj, remove_list, analysisThreads, \
getMetaDF, transformDF, taxaProfileDF, exploding_panda, exploding_panda2, imploding_panda, \
wOdum, getRawDataTab, getRawDataBiom, getCoreBiom, removeFiles, excel_to_dict, startLogger, log, securityLog, errorLog, stoppableThread, \
getConsoleLog, getSecurityLog, getErrorLog, getServerMetrics, categorize, mergePDF, rewrite_biom, write_taxa_summary
from utils.utils_kegg import getFullKO, getFullNZ, getFullTaxonomy, getFullTaxaFromID, \
getTaxaDF, getKeggDF, getNZDF, filterDF
from utils.debug import debug
from utils.file_handler import fileUploadChunk, fileUploadComplete
|
gpl-3.0
|
open-ecommerce/dropin
|
htdocs/views/attendance/_form-today-attendance.php
|
3532
|
<?php
use kartik\form\ActiveForm;
use yii\helpers\ArrayHelper;
use kartik\datecontrol\DateControl;
use kartik\helpers\Html;
use app\models\Dropin;
$iconsDoctor = [
0 => Html::icon('remove') . ' No need for Doctor',
1 => Html::icon('hourglass') . ' Waiting for Doctor',
2 => Html::icon('ok') . ' Already seen Doctor',
];
$iconsLawyer = [
0 => Html::icon('remove') . ' No need for Lawyer',
1 => Html::icon('hourglass') . ' Waiting for Lawyer',
2 => Html::icon('ok') . ' Already seen Lawyer',
];
?>
<br>
<div class="today-dropin container">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Today Dropin</h3>
</div>
<div class="panel-body">
<?php $form = ActiveForm::begin(); ?>
<div class="col-md-8"><?= $form->field($modelCustomers, 'Name')->textInput(['readonly' => true]) ?></div>
<div class="col-md-4">
<?php
// echo $form->field($model, 'DropinDate')->widget(DateControl::classname(), [
// 'type' => DateControl::FORMAT_DATE,
// 'displayFormat' => 'php:d M Y',
// 'saveFormat' => 'php:Y-m-d',
// //'disabled' => true,
// ]);
$time = new \DateTime('now');
$today = $time->format('Y-m-d');
echo $form->field($model, 'DropinDate')
->dropDownList(ArrayHelper::map(Dropin::find()
->where(['<=', 'DropinDate' ,$today])
->orderBy(['DropinDate' => SORT_DESC])
->all(),
'DropinDate','DropinDateFormated'));
?>
</div>
<hr>
<div class="row col-md-12">
<div class="attendance-form">
<?= $form->field($model, 'Dropin', ['template' => "Dropin and recived the voucher{input}\n{hint}\n{error}"])->checkbox() ?>
<div class="row col-md-offset-0">
<div class="col-md-6 col-md-offset-0" id="doctor-selection"><?= $form->field($model, 'Doctor')->multiselect($iconsDoctor, ['selector' => 'radio']); ?></div>
<div class="col-md-6 col-md-offset-0" id="lawyer-selection"><?= $form->field($model, 'Lawyer')->multiselect($iconsLawyer, ['selector' => 'radio']); ?></div>
</div>
<?= $form->field($model, 'Observation', ['template' => "Comments\n\n{input}\n{hint}\n{error}"])->textArea(array('rows' => 5, 'placeholder' => 'Comments about this specific dropin...')); ?>
<div class="form-group">
<?= Html::a('Cancel and Close', ['customers/index'], ['class' => 'btn btn-warning']) ?>
<?= Html::submitButton($model->isNewRecord ? 'Confirm Entry and Close' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-success']) ?>
</div>
</div>
<?php ActiveForm::end(); ?>
</div>
</div>
</div>
</div>
</div>
|
gpl-3.0
|
diegowald/mksHBOPdf
|
mksHBOPDF/documenttemplate.cpp
|
106
|
#include "documenttemplate.h"
DocumentTemplate::DocumentTemplate(QObject *parent) : QObject(parent)
{
}
|
gpl-3.0
|
GenerationOfWorlds/GOW
|
Scripts/Core/Mondains Legacy/Mobiles/Sanctuary/Chiikkaha.cs
|
1740
|
namespace Server.Mobiles
{
[CorpseName("a Chiikkaha the Toothed corpse")]
public class Chiikkaha : RatmanMage
{
[Constructable]
public Chiikkaha()
{
Name = "Chiikkaha";
Title = "the Toothed";
SetStr(450, 476);
SetDex(157, 179);
SetInt(251, 275);
SetHits(400, 425);
SetDamage(10, 17);
SetDamageType(ResistanceType.Physical, 100);
SetResistance(ResistanceType.Physical, 40, 45);
SetResistance(ResistanceType.Fire, 10, 20);
SetResistance(ResistanceType.Cold, 10, 20);
SetResistance(ResistanceType.Poison, 10, 20);
SetResistance(ResistanceType.Energy, 100);
SetSkill(SkillName.EvalInt, 70.1, 80.0);
SetSkill(SkillName.Magery, 70.1, 90.0);
SetSkill(SkillName.MagicResist, 65.1, 96.0);
SetSkill(SkillName.Tactics, 50.1, 75.0);
SetSkill(SkillName.Wrestling, 50.1, 75.0);
}
public Chiikkaha(Serial serial)
: base(serial)
{
}
public override void GenerateLoot()
{
AddLoot(LootPack.Rich, 2);
AddLoot(LootPack.LowScrolls);
}
public override bool AllureImmune
{
get
{
return true;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
|
gpl-3.0
|
manfer/ivozprovider
|
library/Ivoz/Cgr/Domain/Model/TpRatingProfile/TpRatingProfileDtoAbstract.php
|
10152
|
<?php
namespace Ivoz\Cgr\Domain\Model\TpRatingProfile;
use Ivoz\Core\Application\DataTransferObjectInterface;
use Ivoz\Core\Application\ForeignKeyTransformerInterface;
use Ivoz\Core\Application\CollectionTransformerInterface;
use Ivoz\Core\Application\Model\DtoNormalizer;
/**
* @codeCoverageIgnore
*/
abstract class TpRatingProfileDtoAbstract implements DataTransferObjectInterface
{
/**
* @var string
*/
private $tpid = 'ivozprovider';
/**
* @var string
*/
private $loadid = 'DATABASE';
/**
* @var string
*/
private $direction = '*out';
/**
* @var string
*/
private $tenant;
/**
* @var string
*/
private $category = 'call';
/**
* @var string
*/
private $subject;
/**
* @var \DateTime
*/
private $activationTime = 'CURRENT_TIMESTAMP';
/**
* @var string
*/
private $ratingPlanTag;
/**
* @var string
*/
private $fallbackSubjects;
/**
* @var string
*/
private $cdrStatQueueIds;
/**
* @var \DateTime
*/
private $createdAt = 'CURRENT_TIMESTAMP';
/**
* @var integer
*/
private $id;
/**
* @var \Ivoz\Provider\Domain\Model\RatingProfile\RatingProfileDto | null
*/
private $ratingProfile;
/**
* @var \Ivoz\Provider\Domain\Model\OutgoingRoutingRelCarrier\OutgoingRoutingRelCarrierDto | null
*/
private $outgoingRoutingRelCarrier;
use DtoNormalizer;
public function __construct($id = null)
{
$this->setId($id);
}
/**
* @inheritdoc
*/
public static function getPropertyMap(string $context = '')
{
if ($context === self::CONTEXT_COLLECTION) {
return ['id' => 'id'];
}
return [
'tpid' => 'tpid',
'loadid' => 'loadid',
'direction' => 'direction',
'tenant' => 'tenant',
'category' => 'category',
'subject' => 'subject',
'activationTime' => 'activationTime',
'ratingPlanTag' => 'ratingPlanTag',
'fallbackSubjects' => 'fallbackSubjects',
'cdrStatQueueIds' => 'cdrStatQueueIds',
'createdAt' => 'createdAt',
'id' => 'id',
'ratingProfileId' => 'ratingProfile',
'outgoingRoutingRelCarrierId' => 'outgoingRoutingRelCarrier'
];
}
/**
* @return array
*/
public function toArray($hideSensitiveData = false)
{
return [
'tpid' => $this->getTpid(),
'loadid' => $this->getLoadid(),
'direction' => $this->getDirection(),
'tenant' => $this->getTenant(),
'category' => $this->getCategory(),
'subject' => $this->getSubject(),
'activationTime' => $this->getActivationTime(),
'ratingPlanTag' => $this->getRatingPlanTag(),
'fallbackSubjects' => $this->getFallbackSubjects(),
'cdrStatQueueIds' => $this->getCdrStatQueueIds(),
'createdAt' => $this->getCreatedAt(),
'id' => $this->getId(),
'ratingProfile' => $this->getRatingProfile(),
'outgoingRoutingRelCarrier' => $this->getOutgoingRoutingRelCarrier()
];
}
/**
* {@inheritDoc}
*/
public function transformForeignKeys(ForeignKeyTransformerInterface $transformer)
{
$this->ratingProfile = $transformer->transform('Ivoz\\Provider\\Domain\\Model\\RatingProfile\\RatingProfile', $this->getRatingProfileId());
$this->outgoingRoutingRelCarrier = $transformer->transform('Ivoz\\Provider\\Domain\\Model\\OutgoingRoutingRelCarrier\\OutgoingRoutingRelCarrier', $this->getOutgoingRoutingRelCarrierId());
}
/**
* {@inheritDoc}
*/
public function transformCollections(CollectionTransformerInterface $transformer)
{
}
/**
* @param string $tpid
*
* @return static
*/
public function setTpid($tpid = null)
{
$this->tpid = $tpid;
return $this;
}
/**
* @return string
*/
public function getTpid()
{
return $this->tpid;
}
/**
* @param string $loadid
*
* @return static
*/
public function setLoadid($loadid = null)
{
$this->loadid = $loadid;
return $this;
}
/**
* @return string
*/
public function getLoadid()
{
return $this->loadid;
}
/**
* @param string $direction
*
* @return static
*/
public function setDirection($direction = null)
{
$this->direction = $direction;
return $this;
}
/**
* @return string
*/
public function getDirection()
{
return $this->direction;
}
/**
* @param string $tenant
*
* @return static
*/
public function setTenant($tenant = null)
{
$this->tenant = $tenant;
return $this;
}
/**
* @return string
*/
public function getTenant()
{
return $this->tenant;
}
/**
* @param string $category
*
* @return static
*/
public function setCategory($category = null)
{
$this->category = $category;
return $this;
}
/**
* @return string
*/
public function getCategory()
{
return $this->category;
}
/**
* @param string $subject
*
* @return static
*/
public function setSubject($subject = null)
{
$this->subject = $subject;
return $this;
}
/**
* @return string
*/
public function getSubject()
{
return $this->subject;
}
/**
* @param \DateTime $activationTime
*
* @return static
*/
public function setActivationTime($activationTime = null)
{
$this->activationTime = $activationTime;
return $this;
}
/**
* @return \DateTime
*/
public function getActivationTime()
{
return $this->activationTime;
}
/**
* @param string $ratingPlanTag
*
* @return static
*/
public function setRatingPlanTag($ratingPlanTag = null)
{
$this->ratingPlanTag = $ratingPlanTag;
return $this;
}
/**
* @return string
*/
public function getRatingPlanTag()
{
return $this->ratingPlanTag;
}
/**
* @param string $fallbackSubjects
*
* @return static
*/
public function setFallbackSubjects($fallbackSubjects = null)
{
$this->fallbackSubjects = $fallbackSubjects;
return $this;
}
/**
* @return string
*/
public function getFallbackSubjects()
{
return $this->fallbackSubjects;
}
/**
* @param string $cdrStatQueueIds
*
* @return static
*/
public function setCdrStatQueueIds($cdrStatQueueIds = null)
{
$this->cdrStatQueueIds = $cdrStatQueueIds;
return $this;
}
/**
* @return string
*/
public function getCdrStatQueueIds()
{
return $this->cdrStatQueueIds;
}
/**
* @param \DateTime $createdAt
*
* @return static
*/
public function setCreatedAt($createdAt = null)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* @param integer $id
*
* @return static
*/
public function setId($id = null)
{
$this->id = $id;
return $this;
}
/**
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* @param \Ivoz\Provider\Domain\Model\RatingProfile\RatingProfileDto $ratingProfile
*
* @return static
*/
public function setRatingProfile(\Ivoz\Provider\Domain\Model\RatingProfile\RatingProfileDto $ratingProfile = null)
{
$this->ratingProfile = $ratingProfile;
return $this;
}
/**
* @return \Ivoz\Provider\Domain\Model\RatingProfile\RatingProfileDto
*/
public function getRatingProfile()
{
return $this->ratingProfile;
}
/**
* @param integer $id | null
*
* @return static
*/
public function setRatingProfileId($id)
{
$value = !is_null($id)
? new \Ivoz\Provider\Domain\Model\RatingProfile\RatingProfileDto($id)
: null;
return $this->setRatingProfile($value);
}
/**
* @return integer | null
*/
public function getRatingProfileId()
{
if ($dto = $this->getRatingProfile()) {
return $dto->getId();
}
return null;
}
/**
* @param \Ivoz\Provider\Domain\Model\OutgoingRoutingRelCarrier\OutgoingRoutingRelCarrierDto $outgoingRoutingRelCarrier
*
* @return static
*/
public function setOutgoingRoutingRelCarrier(\Ivoz\Provider\Domain\Model\OutgoingRoutingRelCarrier\OutgoingRoutingRelCarrierDto $outgoingRoutingRelCarrier = null)
{
$this->outgoingRoutingRelCarrier = $outgoingRoutingRelCarrier;
return $this;
}
/**
* @return \Ivoz\Provider\Domain\Model\OutgoingRoutingRelCarrier\OutgoingRoutingRelCarrierDto
*/
public function getOutgoingRoutingRelCarrier()
{
return $this->outgoingRoutingRelCarrier;
}
/**
* @param integer $id | null
*
* @return static
*/
public function setOutgoingRoutingRelCarrierId($id)
{
$value = !is_null($id)
? new \Ivoz\Provider\Domain\Model\OutgoingRoutingRelCarrier\OutgoingRoutingRelCarrierDto($id)
: null;
return $this->setOutgoingRoutingRelCarrier($value);
}
/**
* @return integer | null
*/
public function getOutgoingRoutingRelCarrierId()
{
if ($dto = $this->getOutgoingRoutingRelCarrier()) {
return $dto->getId();
}
return null;
}
}
|
gpl-3.0
|
lynnchae/group-common
|
daoke-mileage-server/src/main/java/me/daoke/mileage/util/HttpRespons.java
|
2630
|
package me.daoke.mileage.util;
import java.util.Vector;
/**
* @author chenlong
* @Email chenlong@ddmap.com
* @version 1.0.1
* @time 创建时间:Dec 2, 2011
*
*
* 响应对象
*
*/
public class HttpRespons {
String urlString;
int defaultPort;
String file;
String host;
String path;
int port;
String protocol;
String query;
String ref;
String userInfo;
String contentEncoding;
String content;
String contentType;
int code;
String message;
String method;
int connectTimeout;
int readTimeout;
Vector<String> contentCollection;
public String getContent() {
return content;
}
public String getContentType() {
return contentType;
}
public int getCode() {
return code;
}
public String getMessage() {
return message;
}
public Vector<String> getContentCollection() {
return contentCollection;
}
public String getContentEncoding() {
return contentEncoding;
}
public String getMethod() {
return method;
}
public int getConnectTimeout() {
return connectTimeout;
}
public int getReadTimeout() {
return readTimeout;
}
public String getUrlString() {
return urlString;
}
public int getDefaultPort() {
return defaultPort;
}
public String getFile() {
return file;
}
public String getHost() {
return host;
}
public String getPath() {
return path;
}
public int getPort() {
return port;
}
public String getProtocol() {
return protocol;
}
public String getQuery() {
return query;
}
public String getRef() {
return ref;
}
public String getUserInfo() {
return userInfo;
}
@Override
public String toString() {
return "HttpRespons{" +
"urlString='" + urlString + '\'' +
", defaultPort=" + defaultPort +
", file='" + file + '\'' +
", host='" + host + '\'' +
", path='" + path + '\'' +
", protocol='" + protocol + '\'' +
", port=" + port +
", query='" + query + '\'' +
", ref='" + ref + '\'' +
", userInfo='" + userInfo + '\'' +
", contentEncoding='" + contentEncoding + '\'' +
", content='" + content + '\'' +
", contentType='" + contentType + '\'' +
", code=" + code +
", message='" + message + '\'' +
", method='" + method + '\'' +
", connectTimeout=" + connectTimeout +
", readTimeout=" + readTimeout +
", contentCollection=" + contentCollection +
'}';
}
}
|
gpl-3.0
|
xmjiao/octave-debian
|
libinterp/octave-value/ov-uint64.cc
|
1931
|
/*
Copyright (C) 2004-2017 John W. Eaton
This file is part of Octave.
Octave is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
Octave is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with Octave; see the file COPYING. If not, see
<http://www.gnu.org/licenses/>.
*/
#if defined (HAVE_CONFIG_H)
# include "config.h"
#endif
#include <iostream>
#include <limits>
#include "lo-ieee.h"
#include "lo-utils.h"
#include "mx-base.h"
#include "quit.h"
#include "errwarn.h"
#include "oct-lvalue.h"
#include "oct-hdf5.h"
#include "ops.h"
#include "ov-base.h"
#if defined (HAVE_HDF5)
# define HDF5_SAVE_TYPE H5T_NATIVE_UINT64
#endif
#include "ov-base-int.h"
#include "ov-base-int.cc"
#include "ov-uint64.h"
#include "pr-output.h"
#include "variables.h"
#include "byte-swap.h"
#include "ls-oct-text.h"
#include "ls-utils.h"
#include "ls-hdf5.h"
// Prevent implicit instantiations on some systems (Windows, others?)
// that can lead to duplicate definitions of static data members.
extern template class OCTINTERP_API octave_base_scalar<double>;
template class octave_base_matrix<uint64NDArray>;
template class octave_base_int_matrix<uint64NDArray>;
DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_uint64_matrix,
"uint64 matrix", "uint64");
template class octave_base_scalar<octave_uint64>;
template class octave_base_int_scalar<octave_uint64>;
DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_uint64_scalar,
"uint64 scalar", "uint64");
|
gpl-3.0
|
316181444/Hxms
|
src/main/java/net/sf/odinms/server/MapleItemInventryType.java
|
671
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package net.sf.odinms.server;
import net.sf.odinms.client.MapleInventoryType;
/**
*
* @author Admin
*/
public class MapleItemInventryType {
private int id;
private MapleInventoryType type;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public MapleInventoryType getType() {
return type;
}
public byte getTypevalue() {
return type.getType();
}
public void setTypevalue(byte value) {
this.type = MapleInventoryType.getByType(value);
}
public void setType(MapleInventoryType type) {
this.type = type;
}
}
|
gpl-3.0
|
gohdan/DFC
|
known_files/hashes/bitrix/modules/sale/lib/internals/product2product.php
|
61
|
Bitrix 16.5 Business Demo = d247a47d96f2f4313362616368c8c041
|
gpl-3.0
|
scheckmedia/CottBooth
|
CottBooth/settingswindow.cpp
|
11060
|
#include "settingswindow.h"
#include "ui_settingswindow.h"
#include "mainwindow.h"
#include "settings.h"
#include "globals.h"
#include <QDebug>
#include <QCryptographicHash>
#include <QDir>
#include <QFileDialog>
#include <QMessageBox>
#include <QStorageInfo>
SettingsWindow::SettingsWindow(QWidget *parent) :
QWidget(parent),
ui(new Ui::SettingsWindow)
{
ui->setupUi(this);
ui->btnBack->setFont(MainWindow::instance()->m_pAwesome->font(32));
ui->btnBack->setText( QString( fa::backward ) );
QListWidgetItem *general = new QListWidgetItem(ui->listTopics);
QListWidgetItem *camera = new QListWidgetItem(ui->listTopics);
QListWidgetItem *security = new QListWidgetItem(ui->listTopics);
QListWidgetItem *design = new QListWidgetItem(ui->listTopics);
general->setSizeHint(QSize(0,64));
general->setIcon(MainWindow::instance()->m_pAwesome->icon(fa::wrench));
general->setText(tr("Main"));
general->setSelected(true);
camera->setSizeHint(QSize(0, 64));
camera->setIcon(MainWindow::instance()->m_pAwesome->icon(fa::cameraretro));
camera->setText(tr("Camera"));
security->setSizeHint(QSize(0, 64));
security->setIcon(MainWindow::instance()->m_pAwesome->icon(fa::key));
security->setText(tr("Security"));
design->setSizeHint(QSize(0, 64));
design->setIcon(MainWindow::instance()->m_pAwesome->icon(fa::desktop));
design->setText(tr("Design"));
ui->listTopics->insertItem(0, general);
ui->listTopics->insertItem(1, security);
ui->listTopics->insertItem(2, camera);
ui->listTopics->insertItem(3, design);
ui->listTopics->setIconSize(QSize(32,32));
ui->listTopics->setAttribute(Qt::WA_MacShowFocusRect, 0);
ui->sbFontSize->findChild<QLineEdit*>()->setReadOnly(true);
ui->sbFontSize->setAttribute(Qt::WA_MacShowFocusRect, 0);
ui->sbCredentialLength->setAttribute(Qt::WA_MacShowFocusRect, 0);
QVector<QString> themes = scanThemeFolder(QApplication::applicationDirPath() + "/themes");
ui->cbTheme->addItems(themes.toList());
qDebug() << "drives: " << QDir::drives().size();
ui->btnBrowse->setFont(MainWindow::instance()->m_pAwesome->font(28));
ui->btnBrowse->setText( QString( fa::folderopeno ) );
this->loadSettings();
this->initEventHandling();
/*
for (auto volume : QStorageInfo::mountedVolumes()) {
qDebug() << "Name:" << volume.name();
qDebug() << "Display name:" << volume.displayName();
qDebug() << "Device:" << volume.device();
qDebug() << "Root path:" << volume.rootPath();
qDebug() << "File system type:" << volume.fileSystemType();
qDebug() << "Is valid?" << (volume.isValid() ? "yes" : "no");
qDebug() << "Is root?" << (volume.isRoot() ? "yes" : "no");
qDebug() << "Is ready?" << (volume.isReady() ? "yes" : "no");
qDebug() << "Is read only?" << (volume.isReadOnly() ? "yes" : "no");
qDebug() << "Bytes available:" << volume.bytesAvailable();
qDebug() << "Bytes free:" << volume.bytesFree();
qDebug() << "Bytes total:" << volume.bytesTotal() << endl;
} */
}
SettingsWindow::~SettingsWindow()
{
delete ui;
}
void SettingsWindow::initEventHandling()
{
connect(ui->listTopics, &QListWidget::itemClicked,[=](QListWidgetItem *item){
ui->settingsStack->setCurrentIndex(ui->listTopics->row(item));
});
connect(ui->btnBack,&QToolButton::clicked, [=](){
MainWindow::instance()->closeSettingsWindow();
});
connect(ui->btnBrowse, &QToolButton::clicked, [=](){
MainWindow::instance()->toggleBackgroundMode(true, 1);
QFileDialog fileDialog(this, DIALOG_MASK);
fileDialog.setOptions(QFileDialog::ShowDirsOnly|QFileDialog::ReadOnly|QFileDialog::DontUseNativeDialog);
fileDialog.setFileMode(QFileDialog::DirectoryOnly);
if ( fileDialog.exec() )
{
QString path = fileDialog.selectedFiles().first();
ui->lblPath->setText(path);
Settings::instance()->setStringValue(Settings::SAVE_PATH, path);
}
MainWindow::instance()->toggleBackgroundMode(false, 1);
});
connect(ui->cbAskSavePath, &QCheckBox::stateChanged, this, &SettingsWindow::handleCheckBoxEvent);
connect(ui->cbSelectLastPicture, &QCheckBox::stateChanged, this, &SettingsWindow::handleCheckBoxEvent);
connect(ui->cbLiveView, &QCheckBox::stateChanged, this, &SettingsWindow::handleCheckBoxEvent);
connect(ui->sbCredentialLength, SIGNAL(valueChanged(int)), this, SLOT(handleSpinBoxEvent(int)));
connect(ui->cbAperture, &QComboBox::currentTextChanged, this, &SettingsWindow::handleComboBoxEvent);
connect(ui->cbShutterSpeed, &QComboBox::currentTextChanged, this, &SettingsWindow::handleComboBoxEvent);
connect(ui->cbWhiteBalance, &QComboBox::currentTextChanged, this, &SettingsWindow::handleComboBoxEvent);
connect(ui->cbKeepImagesOnCamera, &QCheckBox::stateChanged, this, &SettingsWindow::handleCheckBoxEvent);
connect(ui->tbMasterPassword, &QLineEdit::returnPressed, this, &SettingsWindow::handleTextBoxEnter);
connect(ui->tbRespawnToken, &QLineEdit::returnPressed, this, &SettingsWindow::handleTextBoxEnter);
connect(ui->cbTheme, &QComboBox::currentTextChanged, this, &SettingsWindow::handleComboBoxEvent);
connect(ui->cbFont, &QFontComboBox::currentTextChanged, this, &SettingsWindow::handleComboBoxEvent);
connect(ui->sbFontSize, SIGNAL(valueChanged(int)), this, SLOT(handleSpinBoxEvent(int)));
//TODO: find out whats wrong with this line
//connect(ui->sbFontSize, &QSpinBox::valueChanged, this, &SettingsWindow::handleSpinBoxEvent);
}
void SettingsWindow::loadSettings()
{
Settings *s = Settings::instance();
ui->lblPath->setText(s->stringValue(Settings::SAVE_PATH));
ui->cbAskSavePath->setChecked(s->boolValue(Settings::ASK_FOR_SAVE_PATH, true));
ui->cbSelectLastPicture->setChecked(s->boolValue(Settings::SELECT_LAST_PIC, true));
ui->sbCredentialLength->setValue(s->intValue(Settings::CREDENTIAL_LENGTH, 6));
ui->cbLiveView->setChecked(s->boolValue(Settings::LIVE_VIEW, false));
ui->cbAperture->setCurrentIndex( ui->cbAperture->findText(s->stringValue(Settings::APERTURE)) );
ui->cbShutterSpeed->setCurrentIndex( ui->cbShutterSpeed->findText(s->stringValue(Settings::SHUTTER_SPEED)) );
ui->cbWhiteBalance->setCurrentIndex( ui->cbWhiteBalance->findText(s->stringValue(Settings::WHITE_BALANCE)) );
ui->cbKeepImagesOnCamera->setChecked(s->boolValue(Settings::KEEP_IMAGE_ON_CAMERA, true));
ui->cbTheme->setCurrentIndex( ui->cbTheme->findText(s->stringValue(Settings::THEME, "Default")) );
ui->cbFont->setCurrentIndex( ui->cbFont->findText(s->stringValue(Settings::THEME_FONT, "Ubuntu")) );
ui->sbFontSize->setValue( s->intValue(Settings::THEME_FONT_SIZE, 16));
}
void SettingsWindow::saveEncryptedPassword(QString passwd)
{
QString hash = QString(QCryptographicHash::hash(passwd.toUtf8(), QCryptographicHash::Sha256).toHex());
Settings::instance()->setStringValue(Settings::MASTER_PASSWORD, hash);
Settings::instance()->setBoolValue(Settings::FIRST_RUN, false);
}
QVector<QString> SettingsWindow::scanThemeFolder(QString folder)
{
QVector<QString> themes = QVector<QString>();
QDir dir(folder);
QFileInfoList list = dir.entryInfoList(QDir::NoDotAndDotDot|QDir::Dirs);
for(int i = 0; i < list.count(); i++)
{
QFileInfo info = list[i];
if(info.isDir())
{
QDir themeDir(info.filePath());
QFileInfoList themeList = themeDir.entryInfoList(QDir::NoDotAndDotDot|QDir::Files);
for(int j = 0; j < themeList.count(); j++)
{
QFileInfo themeInfo = themeList[j];
if(themeInfo.isFile() && themeInfo.fileName().contains(".css")
&& themeInfo.baseName().compare(info.baseName()) == 0)
{
themes.append(info.fileName());
}
}
}
}
return themes;
}
void SettingsWindow::handleCheckBoxEvent(int state)
{
Settings *s = Settings::instance();
QString objName = qobject_cast<QCheckBox *>(sender())->objectName();
if(objName == "cbAskSavePath")
{
s->setBoolValue(Settings::ASK_FOR_SAVE_PATH, static_cast<bool>(state));
}
else if (objName == "cbSelectLastPicture")
{
s->setBoolValue(Settings::SELECT_LAST_PIC, static_cast<bool>(state));
}
else if (objName == "cbLiveView")
{
s->setBoolValue(Settings::LIVE_VIEW, static_cast<bool>(state));
}
else if(objName == "cbKeepImagesOnCamera")
{
s->setBoolValue(Settings::KEEP_IMAGE_ON_CAMERA, static_cast<bool>(state));
}
}
void SettingsWindow::handleComboBoxEvent(QString val)
{
Settings *s = Settings::instance();
QComboBox *cb = qobject_cast<QComboBox *>(sender());
QString objName = cb->objectName();
if(objName == "cbAperture")
{
s->setStringValue(Settings::APERTURE, val);
}
else if (objName == "cbShutterSpeed")
{
s->setStringValue(Settings::SHUTTER_SPEED, val);
}
else if (objName == "cbWhiteBalance")
{
s->setStringValue(Settings::WHITE_BALANCE, val);
}
else if (objName == "cbTheme")
{
s->setStringValue(Settings::THEME, val);
}
else if (objName == "cbFont")
{
s->setStringValue(Settings::THEME_FONT, val);
}
}
void SettingsWindow::handleTextBoxEnter()
{
Settings *s = Settings::instance();
QLineEdit *tb = qobject_cast<QLineEdit *>(sender());
QString objName = tb->objectName();
if (tb->text().isEmpty())
{
MainWindow::instance()->toggleBackgroundMode(true, 1);
QMessageBox alert(QMessageBox::Critical, tr("Error"), tr("Empty values are not allowed"), QMessageBox::Ok, this, DIALOG_MASK);
alert.exec();
MainWindow::instance()->toggleBackgroundMode(false, 1);
return;
}
tb->clearFocus();
if(objName == "tbSavePath")
{
s->setStringValue(Settings::SAVE_PATH, tb->text());
}
else if (objName == "tbMasterPassword")
{
QString hash = QString(QCryptographicHash::hash(tb->text().toUtf8(), QCryptographicHash::Sha256).toHex());
s->setStringValue(Settings::MASTER_PASSWORD, hash);
tb->clear();
}
else if (objName == "tbRespawnToken")
{
QString hash = QString(QCryptographicHash::hash(tb->text().toUtf8(), QCryptographicHash::Sha256).toHex());
s->setStringValue(Settings::RESPAWN_TOKEN, hash);
tb->clear();
}
}
void SettingsWindow::handleSpinBoxEvent(int val)
{
Settings *s = Settings::instance();
QString objName = qobject_cast<QSpinBox *>(sender())->objectName();
if(objName == "sbFontSize")
{
s->setIntValue(Settings::THEME_FONT_SIZE, val);
}
else if(objName == "sbCredentialLength")
{
s->setIntValue(Settings::CREDENTIAL_LENGTH, val);
}
}
|
gpl-3.0
|
alexaulbach/FactorioLoaderLib
|
tmpdata/factorio-data-0.10.12.lua
|
832706
|
{
raw = {
corpse = {
["acid-splash-purple"] = {
flags = { "not-on-map" },
type = "corpse",
name = "acid-splash-purple",
splash = { {
frame_width = 199,
filename = "__base__/graphics/entity/acid-splash-purple/splash-1.png",
line_length = 5,
shift = { 0.484375, -0.171875 },
frame_count = 20,
frame_height = 159
}, {
frame_width = 238,
filename = "__base__/graphics/entity/acid-splash-purple/splash-2.png",
line_length = 5,
shift = { 0.8125, -0.15625 },
frame_count = 20,
frame_height = 157
}, {
frame_width = 240,
filename = "__base__/graphics/entity/acid-splash-purple/splash-3.png",
line_length = 5,
shift = { 0.71875, -0.09375 },
frame_count = 20,
frame_height = 162
}, {
frame_width = 241,
filename = "__base__/graphics/entity/acid-splash-purple/splash-4.png",
line_length = 5,
shift = { 0.703125, -0.375 },
frame_count = 20,
frame_height = 146
} },
splash_speed = 0.03,
time_before_removed = 1800,
final_render_layer = "corpse"
},
["small-worm-corpse"] = {
type = "corpse",
name = "small-worm-corpse",
animation = {
filename = "__base__/graphics/entity/small-worm-turret/die.png",
frame_width = 226,
axially_symetric = false,
shift = { -0.05625, 0.23125 },
line_length = 6,
direction_count = 1,
frame_count = 29,
frame_height = 200
},
subgroup = "corpses",
dying_speed = 0.01,
final_render_layer = "corpse"
},
["medium-remnants"] = {
type = "corpse",
subgroup = "remnants",
animation = { {
frame_width = 94,
filename = "__base__/graphics/entity/remnants/medium-remnants.png",
direction_count = 1,
frame_count = 1,
frame_height = 82
}, {
frame_width = 94,
filename = "__base__/graphics/entity/remnants/medium-remnants.png",
x = 94,
direction_count = 1,
frame_count = 1,
frame_height = 82
}, {
frame_width = 94,
filename = "__base__/graphics/entity/remnants/medium-remnants.png",
x = 188,
direction_count = 1,
frame_count = 1,
frame_height = 82
}, {
frame_width = 94,
filename = "__base__/graphics/entity/remnants/medium-remnants.png",
x = 282,
direction_count = 1,
frame_count = 1,
frame_height = 82
} },
order = "d[remnants]-a[generic]-b[medium]",
selectable_in_game = false,
final_render_layer = "remnants",
flags = { "placeable-neutral", "building-direction-8-way", "not-on-map" },
selection_box = { { -1, -1 }, { 1, 1 } },
name = "medium-remnants",
time_before_removed = 54000,
tile_width = 2,
icon = "__base__/graphics/icons/remnants.png",
tile_height = 2
},
["medium-biter-corpse"] = {
type = "corpse",
subgroup = "corpses",
animation = {
frame_width = 204,
axially_symetric = false,
stripes = { {
height_in_frames = 8,
width_in_frames = 9,
filename = "__base__/graphics/entity/medium-biter/medium-biter-die-1.png"
}, {
height_in_frames = 8,
width_in_frames = 8,
filename = "__base__/graphics/entity/medium-biter/medium-biter-die-2.png"
}, {
height_in_frames = 8,
width_in_frames = 9,
filename = "__base__/graphics/entity/medium-biter/medium-biter-die-3.png"
}, {
height_in_frames = 8,
width_in_frames = 8,
filename = "__base__/graphics/entity/medium-biter/medium-biter-die-4.png"
} },
shift = { 0.4725, -0.118125 },
direction_count = 16,
frame_count = 17,
frame_height = 138
},
order = "c[corpse]-a[biter]-b[medium]",
selectable_in_game = false,
final_render_layer = "corpse",
flags = { "placeable-neutral", "placeable-off-grid", "building-direction-8-way" },
selection_box = { { -1, -1 }, { 1, 1 } },
name = "medium-biter-corpse",
icon = "__base__/graphics/icons/medium-biter-corpse.png",
dying_speed = 0.04
},
["big-worm-corpse"] = {
type = "corpse",
name = "big-worm-corpse",
animation = {
axially_symmetrical = false,
frame_width = 323,
filename = "__base__/graphics/entity/big-worm-turret/die.png",
shift = { -0.1375, 0.3875 },
line_length = 6,
direction_count = 1,
frame_count = 29,
frame_height = 287
},
order = "b-c-f",
subgroup = "corpses",
dying_speed = 0.01,
final_render_layer = "corpse"
},
["medium-worm-corpse"] = {
type = "corpse",
name = "medium-worm-corpse",
animation = {
filename = "__base__/graphics/entity/medium-worm-turret/die.png",
frame_width = 274,
axially_symetric = false,
shift = { -0.096875, 0.309375 },
line_length = 6,
direction_count = 1,
frame_count = 29,
frame_height = 243
},
order = "b-c-e",
subgroup = "corpses",
dying_speed = 0.01,
final_render_layer = "corpse"
},
["wall-remnants"] = {
type = "corpse",
subgroup = "remnants",
animation = { {
frame_width = 36,
filename = "__base__/graphics/entity/wall/remains/wall-remain-01.png",
direction_count = 1,
frame_count = 1,
frame_height = 36
}, {
frame_width = 38,
filename = "__base__/graphics/entity/wall/remains/wall-remain-02.png",
direction_count = 1,
frame_count = 1,
frame_height = 35
}, {
frame_width = 35,
filename = "__base__/graphics/entity/wall/remains/wall-remain-03.png",
direction_count = 1,
frame_count = 1,
frame_height = 36
}, {
frame_width = 41,
filename = "__base__/graphics/entity/wall/remains/wall-remain-04.png",
direction_count = 1,
frame_count = 1,
frame_height = 36
}, {
frame_width = 35,
filename = "__base__/graphics/entity/wall/remains/wall-remain-05.png",
direction_count = 1,
frame_count = 1,
frame_height = 35
}, {
frame_width = 50,
filename = "__base__/graphics/entity/wall/remains/wall-remain-06.png",
direction_count = 1,
frame_count = 1,
frame_height = 37
}, {
frame_width = 54,
filename = "__base__/graphics/entity/wall/remains/wall-remain-07.png",
direction_count = 1,
frame_count = 1,
frame_height = 40
}, {
frame_width = 43,
filename = "__base__/graphics/entity/wall/remains/wall-remain-08.png",
direction_count = 1,
frame_count = 1,
frame_height = 45
} },
order = "d[remnants]-c[wall]",
selectable_in_game = false,
final_render_layer = "remnants",
flags = { "placeable-neutral", "not-on-map" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "wall-remnants",
icon = "__base__/graphics/icons/wall-remnants.png",
time_before_removed = 54000
},
["small-biter-corpse"] = {
type = "corpse",
subgroup = "corpses",
animation = {
frame_width = 142,
axially_symetric = false,
stripes = { {
filename = "__base__/graphics/entity/small-biter/small-biter-die-1.png",
width_in_frames = 9
}, {
filename = "__base__/graphics/entity/small-biter/small-biter-die-2.png",
width_in_frames = 8
} },
shift = { 0.328125, -0.09375 },
direction_count = 16,
frame_count = 17,
frame_height = 97
},
order = "c[corpse]-a[biter]-a[small]",
selectable_in_game = false,
final_render_layer = "corpse",
flags = { "placeable-neutral", "placeable-off-grid", "building-direction-8-way", "not-repairable", "not-on-map" },
selection_box = { { -0.8, -0.8 }, { 0.8, 0.8 } },
name = "small-biter-corpse",
icon = "__base__/graphics/icons/small-biter-corpse.png",
dying_speed = 0.04
},
["big-biter-corpse"] = {
type = "corpse",
subgroup = "corpses",
animation = {
axially_symmetrical = false,
frame_width = 284,
stripes = { {
height_in_frames = 8,
width_in_frames = 6,
filename = "__base__/graphics/entity/big-biter/big-biter-die-1.png"
}, {
height_in_frames = 8,
width_in_frames = 6,
filename = "__base__/graphics/entity/big-biter/big-biter-die-2.png"
}, {
height_in_frames = 8,
width_in_frames = 5,
filename = "__base__/graphics/entity/big-biter/big-biter-die-3.png"
}, {
height_in_frames = 8,
width_in_frames = 6,
filename = "__base__/graphics/entity/big-biter/big-biter-die-4.png"
}, {
height_in_frames = 8,
width_in_frames = 6,
filename = "__base__/graphics/entity/big-biter/big-biter-die-5.png"
}, {
height_in_frames = 8,
width_in_frames = 5,
filename = "__base__/graphics/entity/big-biter/big-biter-die-6.png"
} },
shift = { 0.65625, -0.164062 },
direction_count = 16,
frame_count = 17,
frame_height = 192
},
order = "c[corpse]-a[biter]-c[big]",
selectable_in_game = false,
final_render_layer = "corpse",
flags = { "placeable-neutral", "placeable-off-grid", "building-direction-8-way" },
selection_box = { { -1, -1 }, { 1, 1 } },
name = "big-biter-corpse",
icon = "__base__/graphics/icons/big-biter-corpse.png",
dying_speed = 0.04
},
["small-remnants"] = {
type = "corpse",
subgroup = "remnants",
animation = { {
frame_width = 56,
filename = "__base__/graphics/entity/remnants/small-remnants.png",
direction_count = 1,
frame_count = 1,
frame_height = 42
}, {
frame_width = 56,
filename = "__base__/graphics/entity/remnants/small-remnants.png",
x = 56,
direction_count = 1,
frame_count = 1,
frame_height = 42
}, {
frame_width = 56,
filename = "__base__/graphics/entity/remnants/small-remnants.png",
x = 112,
direction_count = 1,
frame_count = 1,
frame_height = 42
}, {
frame_width = 56,
filename = "__base__/graphics/entity/remnants/small-remnants.png",
x = 168,
direction_count = 1,
frame_count = 1,
frame_height = 42
} },
order = "d[remnants]-a[generic]-a[small]",
selectable_in_game = false,
final_render_layer = "remnants",
flags = { "placeable-neutral", "not-on-map" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "small-remnants",
time_before_removed = 54000,
tile_width = 1,
icon = "__base__/graphics/icons/remnants.png",
tile_height = 1
},
["biter-spawner-corpse"] = {
type = "corpse",
subgroup = "corpses",
animation = { {
axially_symmetrical = false,
frame_width = 320,
stripes = { {
height_in_frames = 4,
width_in_frames = 5,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-corpse-1.png",
y = 0
}, {
height_in_frames = 4,
width_in_frames = 5,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-corpse-2.png",
y = 0
}, {
height_in_frames = 4,
width_in_frames = 5,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-corpse-3.png",
y = 0
}, {
height_in_frames = 4,
width_in_frames = 5,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-corpse-4.png",
y = 0
} },
shift = { 0, 0 },
direction_count = 1,
frame_count = 20,
frame_height = 320
}, {
axially_symmetrical = false,
frame_width = 320,
stripes = { {
height_in_frames = 4,
width_in_frames = 5,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-corpse-1.png",
y = 320
}, {
height_in_frames = 4,
width_in_frames = 5,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-corpse-2.png",
y = 320
}, {
height_in_frames = 4,
width_in_frames = 5,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-corpse-3.png",
y = 320
}, {
height_in_frames = 4,
width_in_frames = 5,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-corpse-4.png",
y = 320
} },
shift = { 0, 0 },
direction_count = 1,
frame_count = 20,
frame_height = 320
}, {
axially_symmetrical = false,
frame_width = 320,
stripes = { {
height_in_frames = 4,
width_in_frames = 5,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-corpse-1.png",
y = 640
}, {
height_in_frames = 4,
width_in_frames = 5,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-corpse-2.png",
y = 640
}, {
height_in_frames = 4,
width_in_frames = 5,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-corpse-3.png",
y = 640
}, {
height_in_frames = 4,
width_in_frames = 5,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-corpse-4.png",
y = 640
} },
shift = { 0, 0 },
direction_count = 1,
frame_count = 20,
frame_height = 320
}, {
axially_symmetrical = false,
frame_width = 320,
stripes = { {
height_in_frames = 4,
width_in_frames = 5,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-corpse-1.png",
y = 960
}, {
height_in_frames = 4,
width_in_frames = 5,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-corpse-2.png",
y = 960
}, {
height_in_frames = 4,
width_in_frames = 5,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-corpse-3.png",
y = 960
}, {
height_in_frames = 4,
width_in_frames = 5,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-corpse-4.png",
y = 960
} },
shift = { 0, 0 },
direction_count = 1,
frame_count = 20,
frame_height = 320
} },
order = "c[corpse]-b[biter-spawner]",
collision_box = { { -2, -2 }, { 2, 2 } },
selectable_in_game = false,
final_render_layer = "corpse",
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -2, -2 }, { 2, 2 } },
name = "biter-spawner-corpse",
icon = "__base__/graphics/icons/biter-spawner-corpse.png",
dying_speed = 0.04
},
["big-remnants"] = {
type = "corpse",
subgroup = "remnants",
animation = { {
frame_width = 109,
filename = "__base__/graphics/entity/remnants/big-remnants.png",
direction_count = 1,
frame_count = 1,
frame_height = 102
}, {
frame_width = 109,
filename = "__base__/graphics/entity/remnants/big-remnants.png",
x = 109,
direction_count = 1,
frame_count = 1,
frame_height = 102
}, {
frame_width = 109,
filename = "__base__/graphics/entity/remnants/big-remnants.png",
x = 218,
direction_count = 1,
frame_count = 1,
frame_height = 102
}, {
frame_width = 109,
filename = "__base__/graphics/entity/remnants/big-remnants.png",
x = 327,
direction_count = 1,
frame_count = 1,
frame_height = 102
} },
order = "d[remnants]-a[generic]-c[big]",
collision_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
selectable_in_game = false,
final_render_layer = "remnants",
flags = { "placeable-neutral", "not-on-map" },
selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
name = "big-remnants",
time_before_removed = 54000,
tile_width = 3,
icon = "__base__/graphics/icons/remnants.png",
tile_height = 3
}
},
arrow = {
["orange-arrow-with-circle"] = {
flags = { "placeable-off-grid", "not-on-map" },
type = "arrow",
name = "orange-arrow-with-circle",
circle_picture = {
height = "50",
priority = "low",
filename = "__core__/graphics/arrows/gui-arrow-circle.png",
width = "50"
},
blinking = true,
arrow_picture = {
height = "62",
priority = "low",
filename = "__core__/graphics/arrows/gui-arrow-medium.png",
width = "58"
}
}
},
["generator-equipment"] = {
["fusion-reactor-equipment"] = {
sprite = {
height = 128,
priority = "medium",
filename = "__base__/graphics/equipment/fusion-reactor-equipment.png",
width = 128
},
type = "generator-equipment",
name = "fusion-reactor-equipment",
power = "750W",
shape = {
height = 4,
type = "full",
width = 4
},
energy_source = {
usage_priority = "primary-output",
type = "electric"
}
}
},
["pipe-to-ground"] = {
["pipe-to-ground"] = {
corpse = "small-remnants",
type = "pipe-to-ground",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 4,
offset_deviation = { { -0.29, -0.29 }, { 0.29, 0.2 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
collision_box = { { -0.29, -0.29 }, { 0.29, 0.2 } },
pictures = {
left = {
height = 42,
priority = "high",
filename = "__base__/graphics/entity/pipe-to-ground/pipe-to-ground-left.png",
width = 32
},
right = {
height = 40,
priority = "high",
filename = "__base__/graphics/entity/pipe-to-ground/pipe-to-ground-right.png",
width = 32
},
down = {
height = 32,
priority = "high",
filename = "__base__/graphics/entity/pipe-to-ground/pipe-to-ground-down.png",
width = 40
},
up = {
height = 32,
priority = "high",
filename = "__base__/graphics/entity/pipe-to-ground/pipe-to-ground-up.png",
width = 44
}
},
minable = {
result = "pipe-to-ground",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "player-creation" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "pipe-to-ground",
resistances = { {
percent = 80,
type = "fire"
} },
underground_sprite = {
height = 32,
priority = "high",
filename = "__core__/graphics/arrows/underground-lines.png",
width = 32
},
max_health = 50,
icon = "__base__/graphics/icons/pipe-to-ground.png",
fluid_box = {
pipe_connections = { {
position = { 0, -1 }
}, {
max_underground_distance = 10,
position = { 0, 1 }
} },
base_area = 1,
pipe_covers = {
west = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-west.png",
width = 32
},
south = {
height = 52,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-south.png",
width = 46
},
east = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-east.png",
width = 32
},
north = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-north.png",
width = 44
}
}
}
}
},
["train-stop"] = {
["train-stop"] = {
corpse = "medium-remnants",
type = "train-stop",
animations = {
west = {
frame_width = 173,
filename = "__base__/graphics/entity/train-stop/train-stop-west.png",
shift = { 2, -0.8 },
priority = "high",
frame_count = 2,
frame_height = 126
},
south = {
frame_width = 155,
filename = "__base__/graphics/entity/train-stop/train-stop-south.png",
shift = { 1.7, -1.4 },
priority = "high",
frame_count = 2,
frame_height = 132
},
east = {
frame_width = 173,
filename = "__base__/graphics/entity/train-stop/train-stop-east.png",
shift = { 1.7, -1.5 },
priority = "high",
frame_count = 2,
frame_height = 128
},
north = {
frame_width = 180,
filename = "__base__/graphics/entity/train-stop/train-stop-north.png",
shift = { 1.65, -0.9 },
priority = "high",
frame_count = 2,
frame_height = 136
}
},
collision_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
drawing_box = { { -0.5, -3 }, { 0.5, 0.5 } },
minable = {
mining_time = 1,
result = "train-stop"
},
flags = { "placeable-neutral", "player-creation", "filter-directions" },
selection_box = { { -0.6, -0.6 }, { 0.6, 0.6 } },
name = "train-stop",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 15,
offset_deviation = { { -0.5, -0.5 }, { 0.5, 0.5 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
working_sound = {
sound = {
filename = "__base__/sound/train-stop.ogg",
volume = 0.8
}
},
max_health = 150,
icon = "__base__/graphics/icons/train-stop.png",
animation_ticks_per_frame = 20
}
},
["land-mine"] = {
["land-mine"] = {
corpse = "small-remnants",
type = "land-mine",
action = {
action_delivery = {
source_effects = { {
type = "nested-result",
affects_target = true,
action = {
action_delivery = {
target_effects = {
damage = {
type = "explosion",
amount = 40
},
type = "damage"
},
type = "instant"
},
type = "area",
perimeter = 6,
collision_mask = { "player-layer" }
}
}, {
entity_name = "explosion",
type = "create-entity"
}, {
damage = {
type = "explosion",
amount = 1000
},
type = "damage"
} },
type = "instant"
},
type = "direct"
},
picture_set = {
height = 32,
priority = "medium",
filename = "__base__/graphics/entity/land-mine/land-mine-set.png",
width = 32
},
collision_box = { { -0.4, -0.4 }, { 0.4, 0.4 } },
trigger_radius = 2.5,
minable = {
mining_time = 1,
result = "land-mine"
},
flags = { "placeable-player", "placeable-enemy", "player-creation", "placeable-off-grid" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "land-mine",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 9,
offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
picture_safe = {
height = 32,
priority = "medium",
filename = "__base__/graphics/entity/land-mine/land-mine.png",
width = 32
},
max_health = 15,
icon = "__base__/graphics/icons/land-mine.png",
dying_explosion = "explosion-gunshot"
}
},
splitter = {
["basic-splitter"] = {
corpse = "medium-remnants",
fast_replaceable_group = "splitter",
collision_box = { { -0.9, -0.1 }, { 0.9, 0.1 } },
ending_patch = {
height = 40,
priority = "extra-high",
width = 40,
sheet = "__base__/graphics/entity/basic-transport-belt/start-end-integration-patches.png"
},
selection_box = { { -0.9, -0.5 }, { 0.9, 0.5 } },
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 5,
offset_deviation = { { -0.9, -0.1 }, { 0.9, 0.1 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
speed = 0.03125,
structure = {
west = {
frame_count = 32,
filename = "__base__/graphics/entity/basic-splitter/basic-splitter-west.png",
shift = { 0.25, 0.05 },
line_length = 16,
priority = "extra-high",
frame_height = 79,
frame_width = 47
},
south = {
frame_count = 32,
filename = "__base__/graphics/entity/basic-splitter/basic-splitter-south.png",
shift = { 0.075, 0 },
line_length = 16,
priority = "extra-high",
frame_height = 36,
frame_width = 82
},
east = {
frame_count = 32,
filename = "__base__/graphics/entity/basic-splitter/basic-splitter-east.png",
shift = { 0.075, 0 },
line_length = 16,
priority = "extra-high",
frame_height = 81,
frame_width = 46
},
north = {
frame_count = 32,
filename = "__base__/graphics/entity/basic-splitter/basic-splitter-north.png",
shift = { 0.225, 0 },
line_length = 16,
priority = "extra-high",
frame_height = 35,
frame_width = 80
}
},
icon = "__base__/graphics/icons/basic-splitter.png",
belt_vertical = {
y = 40,
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
ending_bottom = {
y = 120,
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
type = "splitter",
starting_side = {
y = 280,
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
starting_bottom = {
y = 240,
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
structure_animation_speed_coefficient = 0.7,
structure_animation_movement_cooldown = 10,
ending_side = {
y = 160,
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
minable = {
result = "basic-splitter",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "player-creation" },
ending_top = {
y = 80,
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
name = "basic-splitter",
resistances = { {
percent = 60,
type = "fire"
} },
belt_horizontal = {
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
max_health = 80,
starting_top = {
y = 200,
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
animation_speed_coefficient = 32
},
["express-splitter"] = {
corpse = "medium-remnants",
fast_replaceable_group = "splitter",
collision_box = { { -0.9, -0.1 }, { 0.9, 0.1 } },
ending_patch = {
height = 40,
priority = "extra-high",
width = 40,
sheet = "__base__/graphics/entity/basic-transport-belt/start-end-integration-patches.png"
},
selection_box = { { -0.9, -0.5 }, { 0.9, 0.5 } },
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 5,
offset_deviation = { { -0.9, -0.1 }, { 0.9, 0.1 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
speed = 0.09375,
structure = {
west = {
frame_count = 32,
filename = "__base__/graphics/entity/express-splitter/express-splitter-west.png",
shift = { 0.25, 0.05 },
line_length = 16,
priority = "extra-high",
frame_height = 79,
frame_width = 47
},
south = {
frame_count = 32,
filename = "__base__/graphics/entity/express-splitter/express-splitter-south.png",
shift = { 0.075, 0 },
line_length = 16,
priority = "extra-high",
frame_height = 36,
frame_width = 82
},
east = {
frame_count = 32,
filename = "__base__/graphics/entity/express-splitter/express-splitter-east.png",
shift = { 0.075, 0 },
line_length = 16,
priority = "extra-high",
frame_height = 81,
frame_width = 46
},
north = {
frame_count = 32,
filename = "__base__/graphics/entity/express-splitter/express-splitter-north.png",
shift = { 0.225, 0 },
line_length = 16,
priority = "extra-high",
frame_height = 35,
frame_width = 80
}
},
icon = "__base__/graphics/icons/express-splitter.png",
belt_vertical = {
y = 40,
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
ending_bottom = {
y = 120,
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
type = "splitter",
starting_side = {
y = 280,
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
starting_bottom = {
y = 240,
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
structure_animation_speed_coefficient = 1.2,
structure_animation_movement_cooldown = 10,
ending_side = {
y = 160,
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
minable = {
result = "express-splitter",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "player-creation" },
ending_top = {
y = 80,
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
name = "express-splitter",
resistances = { {
percent = 60,
type = "fire"
} },
belt_horizontal = {
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
max_health = 80,
starting_top = {
y = 200,
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
animation_speed_coefficient = 32
},
["fast-splitter"] = {
corpse = "medium-remnants",
fast_replaceable_group = "splitter",
collision_box = { { -0.9, -0.1 }, { 0.9, 0.1 } },
ending_patch = {
height = 40,
priority = "extra-high",
width = 40,
sheet = "__base__/graphics/entity/basic-transport-belt/start-end-integration-patches.png"
},
selection_box = { { -0.9, -0.5 }, { 0.9, 0.5 } },
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 5,
offset_deviation = { { -0.9, -0.1 }, { 0.9, 0.1 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
speed = 0.0625,
structure = {
west = {
frame_count = 32,
filename = "__base__/graphics/entity/fast-splitter/fast-splitter-west.png",
shift = { 0.25, 0.05 },
line_length = 16,
priority = "extra-high",
frame_height = 79,
frame_width = 47
},
south = {
frame_count = 32,
filename = "__base__/graphics/entity/fast-splitter/fast-splitter-south.png",
shift = { 0.075, 0 },
line_length = 16,
priority = "extra-high",
frame_height = 36,
frame_width = 82
},
east = {
frame_count = 32,
filename = "__base__/graphics/entity/fast-splitter/fast-splitter-east.png",
shift = { 0.075, 0 },
line_length = 16,
priority = "extra-high",
frame_height = 81,
frame_width = 46
},
north = {
frame_count = 32,
filename = "__base__/graphics/entity/fast-splitter/fast-splitter-north.png",
shift = { 0.225, 0 },
line_length = 16,
priority = "extra-high",
frame_height = 35,
frame_width = 80
}
},
icon = "__base__/graphics/icons/fast-splitter.png",
belt_vertical = {
y = 40,
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
ending_bottom = {
y = 120,
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
type = "splitter",
starting_side = {
y = 280,
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
starting_bottom = {
y = 240,
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
structure_animation_speed_coefficient = 1.2,
structure_animation_movement_cooldown = 10,
ending_side = {
y = 160,
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
minable = {
result = "fast-splitter",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "player-creation" },
ending_top = {
y = 80,
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
name = "fast-splitter",
resistances = { {
percent = 60,
type = "fire"
} },
belt_horizontal = {
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
max_health = 80,
starting_top = {
y = 200,
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
animation_speed_coefficient = 32
}
},
turret = {
["medium-worm-turret"] = {
corpse = "medium-worm-corpse",
starting_attack_speed = 0.03,
folded_animation = {
frame_height = 88,
line_length = 5,
axially_symmetrical = false,
frame_width = 120,
filename = "__base__/graphics/entity/medium-worm-turret/folded.png",
shift = { -0.0835938, 0.1101563 },
priority = "medium",
direction_count = 1,
frame_count = 15
},
order = "b-b-e",
collision_box = { { -1.1, -1 }, { 1.1, 1 } },
attack_parameters = {
damage_modifier = 3,
ammo_type = {
action = {
action_delivery = {
projectile = "acid-projectile-purple",
type = "projectile",
starting_speed = 0.5
},
type = "direct"
},
category = "biological"
},
projectile_creation_distance = 1.9,
range = 20,
cooldown = 100,
ammo_category = "rocket"
},
autoplace = {
control = "enemy-base",
order = "b[enemy]-a[base]",
force = "enemy",
sharpness = 0.3,
peaks = { {
starting_area_weight_max_range = 2,
starting_area_weight_range = 0,
influence = -10,
starting_area_weight_optimal = 1
}, {
noise_octaves_difference = -1.8,
noise_persistence = 0.5,
influence = 0.22,
noise_layer = "enemy-base"
}, {
noise_octaves_difference = -1.8,
tier_from_start_max_range = 20,
influence = 0.3,
tier_from_start_optimal = 10,
noise_persistence = 0.5,
tier_from_start_top_property_limit = 10,
noise_layer = "enemy-base"
} }
},
selection_box = { { -1.1, -1 }, { 1.1, 1 } },
shooting_cursor_size = 3.5,
prepared_speed = 0.01,
prepare_range = 30,
ending_attack_animation = {
direction_count = 16,
stripes = { {
height_in_frames = 8,
width_in_frames = 8,
filename = "__base__/graphics/entity/medium-worm-turret/starting-attack-1.png"
}, {
height_in_frames = 8,
width_in_frames = 8,
filename = "__base__/graphics/entity/medium-worm-turret/starting-attack-2.png"
} },
line_length = 1,
run_mode = "backward",
axially_symmetrical = false,
frame_width = 229,
shift = { 0.527344, -0.4875 },
priority = "medium",
frame_count = 8,
frame_height = 175
},
icon = "__base__/graphics/icons/medium-worm.png",
starting_attack_animation = {
frame_height = 175,
stripes = { {
height_in_frames = 8,
width_in_frames = 8,
filename = "__base__/graphics/entity/medium-worm-turret/starting-attack-1.png"
}, {
height_in_frames = 8,
width_in_frames = 8,
filename = "__base__/graphics/entity/medium-worm-turret/starting-attack-2.png"
} },
line_length = 1,
axially_symmetrical = false,
frame_width = 229,
shift = { 0.527344, -0.4875 },
priority = "medium",
direction_count = 16,
frame_count = 8
},
folding_speed = 0.015,
type = "turret",
subgroup = "enemies",
folding_animation = {
frame_height = 125,
line_length = 7,
run_mode = "backward",
axially_symmetrical = false,
frame_width = 175,
filename = "__base__/graphics/entity/medium-worm-turret/preparing.png",
shift = { 0.779688, -0.474219 },
priority = "medium",
frame_count = 27,
direction_count = 1
},
ending_attack_speed = 0.03,
folded_speed = 0.01,
prepared_animation = {
frame_height = 133,
line_length = 4,
run_mode = "forward-then-backward",
axially_symmetrical = false,
frame_width = 164,
filename = "__base__/graphics/entity/medium-worm-turret/prepared.png",
shift = { 0.607031, -0.620312 },
priority = "medium",
direction_count = 1,
frame_count = 11
},
preparing_animation = {
frame_height = 125,
line_length = 7,
axially_symmetrical = false,
frame_width = 175,
filename = "__base__/graphics/entity/medium-worm-turret/preparing.png",
shift = { 0.779688, -0.474219 },
priority = "medium",
direction_count = 1,
frame_count = 27
},
flags = { "placeable-player", "placeable-enemy", "not-repairable", "breaths-air" },
healing_per_tick = 0.015,
name = "medium-worm-turret",
resistances = { {
decrease = 4,
type = "physical"
}, {
decrease = 5,
type = "explosion",
percent = 15
} },
starting_attack_sound = { {
filename = "__base__/sound/creatures/worm-roar-short-1.ogg",
volume = 0.85
}, {
filename = "__base__/sound/creatures/worm-roar-short-2.ogg",
volume = 0.85
}, {
filename = "__base__/sound/creatures/worm-roar-short-3.ogg",
volume = 0.85
} },
max_health = 350,
preparing_speed = 0.025,
rotation_speed = 1
},
["big-worm-turret"] = {
corpse = "big-worm-corpse",
starting_attack_speed = 0.03,
folded_animation = {
frame_height = 104,
line_length = 5,
axially_symmetrical = false,
frame_width = 142,
filename = "__base__/graphics/entity/big-worm-turret/folded.png",
shift = { -0.121875, 0.153125 },
priority = "medium",
direction_count = 1,
frame_count = 15
},
order = "b-b-f",
collision_box = { { -1.4, -1.2 }, { 1.4, 1.2 } },
attack_parameters = {
damage_modifier = 6,
ammo_type = {
action = {
action_delivery = {
projectile = "acid-projectile-purple",
type = "projectile",
starting_speed = 0.5
},
type = "direct"
},
category = "biological"
},
projectile_creation_distance = 2.1,
range = 25,
cooldown = 100,
ammo_category = "rocket"
},
prepare_range = 30,
autoplace = {
control = "enemy-base",
order = "b[enemy]-a[base]",
force = "enemy",
sharpness = 0.3,
peaks = { {
starting_area_weight_max_range = 2,
starting_area_weight_range = 0,
influence = -10,
starting_area_weight_optimal = 1
}, {
noise_octaves_difference = -1.8,
noise_persistence = 0.5,
influence = 0.07,
noise_layer = "enemy-base"
}, {
noise_octaves_difference = -1.8,
tier_from_start_max_range = 20,
influence = 0.38,
tier_from_start_optimal = 10,
noise_persistence = 0.5,
tier_from_start_top_property_limit = 10,
noise_layer = "enemy-base"
} }
},
selection_box = { { -1.4, -1.2 }, { 1.4, 1.2 } },
shooting_cursor_size = 4,
prepared_speed = 0.01,
ending_attack_speed = 0.03,
folding_speed = 0.015,
icon = "__base__/graphics/icons/big-worm.png",
starting_attack_animation = {
axially_symmetrical = false,
frame_width = 270,
stripes = { {
height_in_frames = 8,
width_in_frames = 4,
filename = "__base__/graphics/entity/big-worm-turret/starting-attack-1.png"
}, {
height_in_frames = 8,
width_in_frames = 4,
filename = "__base__/graphics/entity/big-worm-turret/starting-attack-2.png"
}, {
height_in_frames = 8,
width_in_frames = 4,
filename = "__base__/graphics/entity/big-worm-turret/starting-attack-3.png"
}, {
height_in_frames = 8,
width_in_frames = 4,
filename = "__base__/graphics/entity/big-worm-turret/starting-attack-4.png"
} },
shift = { 0.596875, -0.55 },
direction_count = 16,
frame_count = 8,
frame_height = 207
},
ending_attack_animation = {
axially_symmetrical = false,
frame_width = 270,
frame_count = 8,
stripes = { {
height_in_frames = 8,
width_in_frames = 4,
filename = "__base__/graphics/entity/big-worm-turret/starting-attack-1.png"
}, {
height_in_frames = 8,
width_in_frames = 4,
filename = "__base__/graphics/entity/big-worm-turret/starting-attack-2.png"
}, {
height_in_frames = 8,
width_in_frames = 4,
filename = "__base__/graphics/entity/big-worm-turret/starting-attack-3.png"
}, {
height_in_frames = 8,
width_in_frames = 4,
filename = "__base__/graphics/entity/big-worm-turret/starting-attack-4.png"
} },
shift = { 0.596875, -0.55 },
frame_height = 207,
run_mode = "backward",
direction_count = 16
},
type = "turret",
subgroup = "enemies",
folding_animation = {
frame_height = 148,
line_length = 7,
run_mode = "backward",
axially_symmetrical = false,
frame_width = 207,
filename = "__base__/graphics/entity/big-worm-turret/preparing.png",
shift = { 0.89375, -0.534375 },
priority = "medium",
frame_count = 27,
direction_count = 1
},
folded_speed = 0.01,
prepared_animation = {
frame_height = 157,
line_length = 4,
run_mode = "forward-then-backward",
axially_symmetrical = false,
frame_width = 194,
filename = "__base__/graphics/entity/big-worm-turret/prepared.png",
shift = { 0.690625, -0.70625 },
priority = "medium",
direction_count = 1,
frame_count = 11
},
preparing_animation = {
frame_height = 148,
line_length = 7,
axially_symmetrical = false,
frame_width = 207,
filename = "__base__/graphics/entity/big-worm-turret/preparing.png",
shift = { 0.89375, -0.534375 },
priority = "medium",
direction_count = 1,
frame_count = 27
},
inventory_size = 2,
flags = { "placeable-player", "placeable-enemy", "not-repairable", "breaths-air" },
healing_per_tick = 0.02,
name = "big-worm-turret",
resistances = { {
decrease = 8,
type = "physical"
}, {
decrease = 10,
type = "explosion",
percent = 30
} },
starting_attack_sound = { {
filename = "__base__/sound/creatures/worm-roar-long-1.ogg",
volume = 0.9
} },
max_health = 500,
preparing_speed = 0.025,
rotation_speed = 1
},
["small-worm-turret"] = {
corpse = "small-worm-corpse",
starting_attack_speed = 0.03,
folded_animation = {
frame_height = 72,
line_length = 5,
axially_symmetrical = false,
frame_width = 99,
filename = "__base__/graphics/entity/small-worm-turret/folded.png",
shift = { -0.0453125, 0.0671875 },
priority = "medium",
direction_count = 1,
frame_count = 15
},
order = "b-b-d",
collision_box = { { -0.9, -0.8 }, { 0.9, 0.8 } },
attack_parameters = {
ammo_type = {
action = {
action_delivery = {
projectile = "acid-projectile-purple",
type = "projectile",
starting_speed = 0.5
},
type = "direct"
},
category = "biological"
},
projectile_creation_distance = 1.8,
range = 17,
cooldown = 15,
ammo_category = "bullet"
},
autoplace = {
control = "enemy-base",
order = "b[enemy]-a[base]",
force = "enemy",
sharpness = 0.3,
peaks = { {
starting_area_weight_max_range = 2,
starting_area_weight_range = 0,
influence = -10,
starting_area_weight_optimal = 1
}, {
noise_octaves_difference = -1.8,
noise_persistence = 0.5,
influence = 0.31,
noise_layer = "enemy-base"
}, {
noise_octaves_difference = -1.8,
tier_from_start_max_range = 20,
influence = 0.1,
tier_from_start_optimal = 10,
noise_persistence = 0.5,
tier_from_start_top_property_limit = 10,
noise_layer = "enemy-base"
} }
},
selection_box = { { -0.9, -0.8 }, { 0.9, 0.8 } },
shooting_cursor_size = 3,
prepared_speed = 0.015,
icon = "__base__/graphics/icons/small-worm.png",
starting_attack_animation = {
frame_height = 144,
stripes = { {
height_in_frames = 8,
width_in_frames = 8,
filename = "__base__/graphics/entity/small-worm-turret/starting-attack-1.png"
}, {
height_in_frames = 8,
width_in_frames = 8,
filename = "__base__/graphics/entity/small-worm-turret/starting-attack-2.png"
} },
line_length = 1,
axially_symmetrical = false,
frame_width = 189,
shift = { 0.457812, -0.425 },
priority = "medium",
direction_count = 16,
frame_count = 8
},
folding_animation = {
frame_height = 103,
line_length = 7,
run_mode = "backward",
axially_symmetrical = false,
frame_width = 144,
filename = "__base__/graphics/entity/small-worm-turret/preparing.png",
shift = { 0.665625, -0.414062 },
priority = "medium",
frame_count = 27,
direction_count = 1
},
type = "turret",
subgroup = "enemies",
prepare_range = 25,
folding_speed = 0.015,
ending_attack_animation = {
direction_count = 16,
stripes = { {
height_in_frames = 8,
width_in_frames = 8,
filename = "__base__/graphics/entity/small-worm-turret/starting-attack-1.png"
}, {
height_in_frames = 8,
width_in_frames = 8,
filename = "__base__/graphics/entity/small-worm-turret/starting-attack-2.png"
} },
line_length = 1,
run_mode = "backward",
axially_symmetrical = false,
frame_width = 189,
shift = { 0.457812, -0.425 },
priority = "medium",
frame_count = 8,
frame_height = 144
},
ending_attack_speed = 0.03,
preparing_animation = {
frame_height = 103,
line_length = 7,
axially_symmetrical = false,
frame_width = 144,
filename = "__base__/graphics/entity/small-worm-turret/preparing.png",
shift = { 0.665625, -0.414062 },
priority = "medium",
direction_count = 1,
frame_count = 27
},
flags = { "placeable-enemy", "not-repairable", "breaths-air" },
healing_per_tick = 0.01,
name = "small-worm-turret",
prepared_animation = {
frame_height = 109,
line_length = 4,
run_mode = "forward-then-backward",
axially_symmetrical = false,
frame_width = 135,
filename = "__base__/graphics/entity/small-worm-turret/prepared.png",
shift = { 0.523437, -0.534375 },
priority = "medium",
direction_count = 1,
frame_count = 11
},
starting_attack_sound = { {
filename = "__base__/sound/creatures/worm-roar-short-1.ogg",
volume = 0.7
}, {
filename = "__base__/sound/creatures/worm-roar-short-2.ogg",
volume = 0.7
}, {
filename = "__base__/sound/creatures/worm-roar-short-3.ogg",
volume = 0.7
} },
max_health = 200,
preparing_speed = 0.025,
folded_speed = 0.01
}
},
["repair-tool"] = {
["repair-pack"] = {
durability = 100,
type = "repair-tool",
subgroup = "tool",
order = "b[repair]-a[repair-pack]",
flags = { "goes-to-quickbar" },
name = "repair-pack",
speed = 1,
icon = "__base__/graphics/icons/repair-pack.png",
stack_size = 50
}
},
["item-group"] = {
other = {
inventory_order = "z",
type = "item-group",
name = "other",
order = "z",
icon = "__core__/graphics/questionmark.png"
},
combat = {
inventory_order = "b",
type = "item-group",
name = "combat",
order = "d",
icon = "__base__/graphics/technology/military.png"
},
environment = {
inventory_order = "a",
type = "item-group",
name = "environment",
order = "a",
icon = "__core__/graphics/neutral-force-icon.png"
},
["intermediate-products"] = {
inventory_order = "a",
type = "item-group",
name = "intermediate-products",
order = "c",
icon = "__base__/graphics/technology/engine.png"
},
production = {
inventory_order = "d",
type = "item-group",
name = "production",
order = "b",
icon = "__base__/graphics/technology/automation.png"
},
logistics = {
inventory_order = "c",
type = "item-group",
name = "logistics",
order = "aaa",
icon = "__base__/graphics/technology/logistics.png"
},
enemies = {
inventory_order = "a",
type = "item-group",
name = "enemies",
order = "aa",
icon = "__core__/graphics/enemy-force-icon.png"
}
},
particle = {
["wooden-particle"] = {
flags = { "not-on-map" },
type = "particle",
name = "wooden-particle",
life_time = 180,
pictures = { {
frame_width = 5,
filename = "__base__/graphics/entity/wooden-particle/wooden-particle-1.png",
priority = "extra-high",
frame_count = 1,
frame_height = 5
}, {
frame_width = 6,
filename = "__base__/graphics/entity/wooden-particle/wooden-particle-2.png",
priority = "extra-high",
frame_count = 1,
frame_height = 4
}, {
frame_width = 7,
filename = "__base__/graphics/entity/wooden-particle/wooden-particle-3.png",
priority = "extra-high",
frame_count = 1,
frame_height = 8
}, {
frame_width = 6,
filename = "__base__/graphics/entity/wooden-particle/wooden-particle-4.png",
priority = "extra-high",
frame_count = 1,
frame_height = 5
} },
shadows = { {
frame_width = 5,
filename = "__base__/graphics/entity/wooden-particle/wooden-particle-shadow-1.png",
priority = "extra-high",
frame_count = 1,
frame_height = 5
}, {
frame_width = 6,
filename = "__base__/graphics/entity/wooden-particle/wooden-particle-shadow-2.png",
priority = "extra-high",
frame_count = 1,
frame_height = 4
}, {
frame_width = 7,
filename = "__base__/graphics/entity/wooden-particle/wooden-particle-shadow-3.png",
priority = "extra-high",
frame_count = 1,
frame_height = 8
}, {
frame_width = 6,
filename = "__base__/graphics/entity/wooden-particle/wooden-particle-shadow-4.png",
priority = "extra-high",
frame_count = 1,
frame_height = 5
} }
},
["iron-ore-particle"] = {
flags = { "not-on-map" },
type = "particle",
name = "iron-ore-particle",
life_time = 180,
pictures = { {
frame_width = 5,
filename = "__base__/graphics/entity/iron-ore-particle/iron-ore-particle-1.png",
priority = "extra-high",
frame_count = 1,
frame_height = 5
}, {
frame_width = 7,
filename = "__base__/graphics/entity/iron-ore-particle/iron-ore-particle-2.png",
priority = "extra-high",
frame_count = 1,
frame_height = 5
}, {
frame_width = 6,
filename = "__base__/graphics/entity/iron-ore-particle/iron-ore-particle-3.png",
priority = "extra-high",
frame_count = 1,
frame_height = 7
}, {
frame_width = 9,
filename = "__base__/graphics/entity/iron-ore-particle/iron-ore-particle-4.png",
priority = "extra-high",
frame_count = 1,
frame_height = 8
} },
shadows = { {
frame_width = 5,
filename = "__base__/graphics/entity/iron-ore-particle/iron-ore-particle-shadow-1.png",
priority = "extra-high",
frame_count = 1,
frame_height = 5
}, {
frame_width = 7,
filename = "__base__/graphics/entity/iron-ore-particle/iron-ore-particle-shadow-2.png",
priority = "extra-high",
frame_count = 1,
frame_height = 5
}, {
frame_width = 6,
filename = "__base__/graphics/entity/iron-ore-particle/iron-ore-particle-shadow-3.png",
priority = "extra-high",
frame_count = 1,
frame_height = 7
}, {
frame_width = 9,
filename = "__base__/graphics/entity/iron-ore-particle/iron-ore-particle-shadow-4.png",
priority = "extra-high",
frame_count = 1,
frame_height = 8
} }
},
["stone-particle"] = {
flags = { "not-on-map" },
type = "particle",
name = "stone-particle",
life_time = 180,
pictures = { {
frame_width = 5,
filename = "__base__/graphics/entity/stone-particle/stone-particle-1.png",
priority = "extra-high",
frame_count = 1,
frame_height = 4
}, {
frame_width = 4,
filename = "__base__/graphics/entity/stone-particle/stone-particle-2.png",
priority = "extra-high",
frame_count = 1,
frame_height = 4
}, {
frame_width = 5,
filename = "__base__/graphics/entity/stone-particle/stone-particle-3.png",
priority = "extra-high",
frame_count = 1,
frame_height = 6
}, {
frame_width = 7,
filename = "__base__/graphics/entity/stone-particle/stone-particle-4.png",
priority = "extra-high",
frame_count = 1,
frame_height = 7
} },
shadows = { {
frame_width = 5,
filename = "__base__/graphics/entity/stone-particle/stone-particle-shadow-1.png",
priority = "extra-high",
frame_count = 1,
frame_height = 4
}, {
frame_width = 4,
filename = "__base__/graphics/entity/stone-particle/stone-particle-shadow-2.png",
priority = "extra-high",
frame_count = 1,
frame_height = 4
}, {
frame_width = 5,
filename = "__base__/graphics/entity/stone-particle/stone-particle-shadow-3.png",
priority = "extra-high",
frame_count = 1,
frame_height = 6
}, {
frame_width = 7,
filename = "__base__/graphics/entity/stone-particle/stone-particle-shadow-4.png",
priority = "extra-high",
frame_count = 1,
frame_height = 7
} }
},
["explosion-remnants-particle"] = {
type = "particle",
regular_trigger_effect = {
entity_name = "smoke-explosion-particle",
type = "create-smoke",
offset_deviation = { { -0.06, -0.06 }, { 0.06, 0.06 } },
speed_from_center = 0.007,
starting_frame_deviation = 5,
starting_frame_speed_deviation = 5
},
life_time = 900,
pictures = { {
frame_width = 22,
filename = "__base__/graphics/entity/explosion-particle/explosion-particle-01.png",
animation_speed = 0.25,
priority = "extra-high",
frame_count = 16,
frame_height = 20
}, {
frame_width = 21,
filename = "__base__/graphics/entity/explosion-particle/explosion-particle-02.png",
animation_speed = 0.25,
priority = "extra-high",
frame_count = 12,
frame_height = 20
}, {
frame_width = 15,
filename = "__base__/graphics/entity/explosion-particle/explosion-particle-03.png",
animation_speed = 0.25,
priority = "extra-high",
frame_count = 10,
frame_height = 15
}, {
frame_width = 28,
filename = "__base__/graphics/entity/explosion-particle/explosion-particle-04.png",
animation_speed = 0.25,
priority = "extra-high",
frame_count = 11,
frame_height = 27
}, {
frame_width = 24,
filename = "__base__/graphics/entity/explosion-particle/explosion-particle-05.png",
animation_speed = 0.25,
priority = "extra-high",
frame_count = 8,
frame_height = 26
}, {
frame_width = 27,
filename = "__base__/graphics/entity/explosion-particle/explosion-particle-15.png",
animation_speed = 0.25,
priority = "extra-high",
frame_count = 11,
frame_height = 28
}, {
frame_width = 12,
filename = "__base__/graphics/entity/explosion-particle/explosion-particle-19.png",
animation_speed = 0.25,
priority = "extra-high",
frame_count = 12,
frame_height = 12
} },
flags = { "not-on-map" },
name = "explosion-remnants-particle",
ended_in_water_trigger_effect = {
entity_name = "water-splash",
type = "create-entity"
},
shadows = { {
frame_width = 27,
filename = "__base__/graphics/entity/explosion-particle/explosion-particle-01-shadow.png",
animation_speed = 0.25,
priority = "extra-high",
frame_count = 16,
frame_height = 18
}, {
frame_width = 26,
filename = "__base__/graphics/entity/explosion-particle/explosion-particle-02-shadow.png",
animation_speed = 0.25,
priority = "extra-high",
frame_count = 12,
frame_height = 18
}, {
frame_width = 18,
filename = "__base__/graphics/entity/explosion-particle/explosion-particle-03-shadow.png",
animation_speed = 0.25,
priority = "extra-high",
frame_count = 10,
frame_height = 12
}, {
frame_width = 36,
filename = "__base__/graphics/entity/explosion-particle/explosion-particle-04-shadow.png",
animation_speed = 0.25,
priority = "extra-high",
frame_count = 11,
frame_height = 23
}, {
frame_width = 33,
filename = "__base__/graphics/entity/explosion-particle/explosion-particle-05-shadow.png",
animation_speed = 0.25,
priority = "extra-high",
frame_count = 8,
frame_height = 23
}, {
frame_width = 34,
filename = "__base__/graphics/entity/explosion-particle/explosion-particle-15-shadow.png",
animation_speed = 0.25,
priority = "extra-high",
frame_count = 11,
frame_height = 23
}, {
frame_width = 15,
filename = "__base__/graphics/entity/explosion-particle/explosion-particle-19-shadow.png",
animation_speed = 0.25,
priority = "extra-high",
frame_count = 12,
frame_height = 10
} },
regular_trigger_effect_frequency = 1
},
["copper-ore-particle"] = {
flags = { "not-on-map" },
type = "particle",
name = "copper-ore-particle",
life_time = 180,
pictures = { {
frame_width = 5,
filename = "__base__/graphics/entity/copper-ore-particle/copper-ore-particle-1.png",
priority = "extra-high",
frame_count = 1,
frame_height = 5
}, {
frame_width = 6,
filename = "__base__/graphics/entity/copper-ore-particle/copper-ore-particle-2.png",
priority = "extra-high",
frame_count = 1,
frame_height = 4
}, {
frame_width = 7,
filename = "__base__/graphics/entity/copper-ore-particle/copper-ore-particle-3.png",
priority = "extra-high",
frame_count = 1,
frame_height = 8
}, {
frame_width = 6,
filename = "__base__/graphics/entity/copper-ore-particle/copper-ore-particle-4.png",
priority = "extra-high",
frame_count = 1,
frame_height = 5
} },
shadows = { {
frame_width = 5,
filename = "__base__/graphics/entity/copper-ore-particle/copper-ore-particle-shadow-1.png",
priority = "extra-high",
frame_count = 1,
frame_height = 5
}, {
frame_width = 6,
filename = "__base__/graphics/entity/copper-ore-particle/copper-ore-particle-shadow-2.png",
priority = "extra-high",
frame_count = 1,
frame_height = 4
}, {
frame_width = 7,
filename = "__base__/graphics/entity/copper-ore-particle/copper-ore-particle-shadow-3.png",
priority = "extra-high",
frame_count = 1,
frame_height = 8
}, {
frame_width = 6,
filename = "__base__/graphics/entity/copper-ore-particle/copper-ore-particle-shadow-4.png",
priority = "extra-high",
frame_count = 1,
frame_height = 5
} }
},
["shell-particle"] = {
flags = { "not-on-map" },
type = "particle",
name = "shell-particle",
life_time = 600,
pictures = { {
frame_width = 6,
filename = "__base__/graphics/entity/shell-particle/shell-particle-1.png",
priority = "extra-high",
frame_count = 5,
frame_height = 6
}, {
frame_width = 5,
filename = "__base__/graphics/entity/shell-particle/shell-particle-2.png",
priority = "extra-high",
frame_count = 5,
frame_height = 7
} },
shadows = { {
frame_width = 9,
filename = "__base__/graphics/entity/shell-particle/shell-particle-shadow-1.png",
priority = "extra-high",
frame_count = 5,
frame_height = 7
}, {
frame_width = 7,
filename = "__base__/graphics/entity/shell-particle/shell-particle-shadow-2.png",
priority = "extra-high",
frame_count = 5,
frame_height = 8
} }
},
["coal-particle"] = {
flags = { "not-on-map" },
type = "particle",
name = "coal-particle",
life_time = 180,
pictures = { {
frame_width = 5,
filename = "__base__/graphics/entity/coal-particle/coal-particle-1.png",
priority = "extra-high",
frame_count = 1,
frame_height = 5
}, {
frame_width = 7,
filename = "__base__/graphics/entity/coal-particle/coal-particle-2.png",
priority = "extra-high",
frame_count = 1,
frame_height = 6
}, {
frame_width = 3,
filename = "__base__/graphics/entity/coal-particle/coal-particle-3.png",
priority = "extra-high",
frame_count = 1,
frame_height = 6
}, {
frame_width = 4,
filename = "__base__/graphics/entity/coal-particle/coal-particle-4.png",
priority = "extra-high",
frame_count = 1,
frame_height = 4
} },
shadows = { {
frame_width = 5,
filename = "__base__/graphics/entity/coal-particle/coal-particle-shadow-1.png",
priority = "extra-high",
frame_count = 1,
frame_height = 5
}, {
frame_width = 7,
filename = "__base__/graphics/entity/coal-particle/coal-particle-shadow-2.png",
priority = "extra-high",
frame_count = 1,
frame_height = 6
}, {
frame_width = 3,
filename = "__base__/graphics/entity/coal-particle/coal-particle-shadow-3.png",
priority = "extra-high",
frame_count = 1,
frame_height = 6
}, {
frame_width = 6,
filename = "__base__/graphics/entity/coal-particle/coal-particle-shadow-4.png",
priority = "extra-high",
frame_count = 1,
frame_height = 4
} }
}
},
technology = {
["night-vision-equipment"] = {
type = "technology",
name = "night-vision-equipment",
order = "g-g",
prerequisites = { "armor-making-3" },
unit = {
time = 15,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/night-vision-equipment.png",
effects = { {
recipe = "night-vision-equipment",
type = "unlock-recipe"
} }
},
["electric-energy-distribution-2"] = {
type = "technology",
name = "electric-energy-distribution-2",
order = "c-e-c",
prerequisites = { "electric-energy-distribution-1" },
unit = {
time = 45,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/electric-energy-distribution.png",
effects = { {
recipe = "substation",
type = "unlock-recipe"
} }
},
["rail-signals"] = {
type = "technology",
name = "rail-signals",
order = "c-g-c",
prerequisites = { "automated-rail-transportation" },
unit = {
time = 30,
count = 150,
ingredients = { { "science-pack-1", 2 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/rail-signals.png",
effects = { {
recipe = "rail-signal",
type = "unlock-recipe"
} }
},
["shotgun-shell-damage-4"] = {
order = "e-n-d",
type = "technology",
name = "shotgun-shell-damage-4",
upgrade = "true",
prerequisites = { "shotgun-shell-damage-3" },
unit = {
time = 60,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/shotgun-shell-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.2",
ammo_category = "shotgun-shell"
} }
},
["follower-robot-count-5"] = {
order = "e-p-b-c",
type = "technology",
name = "follower-robot-count-5",
upgrade = "true",
prerequisites = { "follower-robot-count-4" },
unit = {
count = 250,
time = 30,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/follower-robots.png",
effects = { {
modifier = 2,
type = "maximum-following-robots-count"
} }
},
["follower-robot-count-11"] = {
order = "e-p-b-c",
type = "technology",
name = "follower-robot-count-11",
upgrade = "true",
prerequisites = { "follower-robot-count-10" },
unit = {
count = 800,
time = 30,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/follower-robots.png",
effects = { {
modifier = 10,
type = "maximum-following-robots-count"
} }
},
modules = {
type = "technology",
name = "modules",
prerequisites = { "advanced-electronics" },
order = "i-a",
icon = "__base__/graphics/technology/module.png",
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
}
},
electronics = {
type = "technology",
name = "electronics",
order = "a-d-a",
prerequisites = { "automation" },
unit = {
time = 15,
count = 30,
ingredients = { { "science-pack-1", 1 } }
},
icon = "__base__/graphics/technology/electronics.png",
effects = { {
recipe = "smart-inserter",
type = "unlock-recipe"
} }
},
["automated-construction"] = {
type = "technology",
name = "automated-construction",
order = "c-k-b",
prerequisites = { "construction-robotics" },
unit = {
time = 30,
count = 75,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/automated-construction.png",
effects = { {
recipe = "blueprint",
type = "unlock-recipe"
}, {
recipe = "deconstruction-planner",
type = "unlock-recipe"
}, {
modifier = 18000,
type = "ghost-time-to-live"
} }
},
["fusion-reactor-equipment"] = {
type = "technology",
name = "fusion-reactor-equipment",
order = "g-l",
prerequisites = { "solar-panel-equipment" },
unit = {
time = 30,
count = 200,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/fusion-reactor-equipment.png",
effects = { {
recipe = "fusion-reactor-equipment",
type = "unlock-recipe"
} }
},
["automation-3"] = {
type = "technology",
name = "automation-3",
order = "a-b-c",
prerequisites = { "electronics", "modules", "automation-2" },
unit = {
time = 60,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/automation.png",
effects = { {
recipe = "assembling-machine-3",
type = "unlock-recipe"
} }
},
["follower-robot-count-3"] = {
order = "e-p-b-c",
type = "technology",
name = "follower-robot-count-3",
upgrade = "true",
prerequisites = { "follower-robot-count-2" },
unit = {
count = 150,
time = 30,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/follower-robots.png",
effects = { {
modifier = 2,
type = "maximum-following-robots-count"
} }
},
["laser-turret-speed-4"] = {
order = "e-n-j",
type = "technology",
name = "laser-turret-speed-4",
upgrade = "true",
prerequisites = { "laser-turret-speed-3" },
unit = {
time = 60,
count = 200,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/laser-turret-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.3",
ammo_category = "laser-turret"
} }
},
military = {
type = "technology",
name = "military",
order = "e-a-a",
unit = {
time = 15,
count = 10,
ingredients = { { "science-pack-1", 1 } }
},
icon = "__base__/graphics/technology/military.png",
effects = { {
recipe = "submachine-gun",
type = "unlock-recipe"
}, {
recipe = "shotgun",
type = "unlock-recipe"
}, {
recipe = "shotgun-shell",
type = "unlock-recipe"
} }
},
["laser-turret-damage-1"] = {
order = "e-n-a",
type = "technology",
name = "laser-turret-damage-1",
upgrade = "true",
prerequisites = { "laser-turrets" },
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/laser-turret-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.1",
ammo_category = "laser-turret"
} }
},
["bullet-speed-1"] = {
order = "e-l-g",
type = "technology",
name = "bullet-speed-1",
upgrade = "true",
prerequisites = { "military" },
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 } }
},
icon = "__base__/graphics/technology/bullet-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.2",
ammo_category = "bullet"
} }
},
["follower-robot-count-16"] = {
order = "e-p-b-c",
type = "technology",
name = "follower-robot-count-16",
upgrade = "true",
prerequisites = { "follower-robot-count-15" },
unit = {
count = 1800,
time = 30,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/follower-robots.png",
effects = { {
modifier = 10,
type = "maximum-following-robots-count"
} }
},
["logistic-robot-speed-4"] = {
order = "c-k-f-d",
type = "technology",
name = "logistic-robot-speed-4",
upgrade = "true",
prerequisites = { "logistic-robot-speed-3" },
unit = {
time = 60,
count = 250,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/logistic-robot-speed.png",
effects = { {
modifier = "0.55",
type = "logistic-robot-speed"
} }
},
["construction-robotics"] = {
type = "technology",
name = "construction-robotics",
order = "c-k-a",
prerequisites = { "robotics", "flying" },
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/construction-robotics.png",
effects = { {
recipe = "roboport",
type = "unlock-recipe"
}, {
recipe = "logistic-chest-passive-provider",
type = "unlock-recipe"
}, {
recipe = "logistic-chest-storage",
type = "unlock-recipe"
}, {
recipe = "construction-robot",
type = "unlock-recipe"
}, {
modifier = 18000,
type = "ghost-time-to-live"
} }
},
["energy-shield-mk2-equipment"] = {
type = "technology",
name = "energy-shield-mk2-equipment",
order = "g-e-b",
prerequisites = { "energy-shield-equipment" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/energy-shield-mk2-equipment.png",
effects = { {
recipe = "energy-shield-mk2-equipment",
type = "unlock-recipe"
} }
},
["logistic-robot-storage-1"] = {
order = "c-k-g-a",
type = "technology",
name = "logistic-robot-storage-1",
upgrade = "true",
prerequisites = { "logistic-robotics" },
unit = {
time = 30,
count = 200,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/logistic-robot-storage.png",
effects = { {
modifier = "1",
type = "logistic-robot-storage"
} }
},
["combat-robotics-2"] = {
type = "technology",
name = "combat-robotics-2",
order = "e-p-b-a",
prerequisites = { "combat-robotics", "military-3" },
unit = {
time = 30,
count = 200,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/combat-robotics.png",
effects = { {
recipe = "distractor-capsule",
type = "unlock-recipe"
} }
},
["rocket-defense"] = {
type = "technology",
name = "rocket-defense",
order = "k-a",
prerequisites = { "rocketry", "advanced-electronics-2", "rocket-speed-5" },
unit = {
time = 60,
count = 1000,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/rocket-defense.png",
effects = { {
recipe = "rocket-defense",
type = "unlock-recipe"
} }
},
["military-3"] = {
type = "technology",
name = "military-3",
order = "e-a-c",
prerequisites = { "military-2", "laser", "rocketry" },
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 2 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/military.png",
effects = { {
recipe = "poison-capsule",
type = "unlock-recipe"
}, {
recipe = "slowdown-capsule",
type = "unlock-recipe"
}, {
recipe = "combat-shotgun",
type = "unlock-recipe"
} }
},
["productivity-module"] = {
order = "i-e-a",
type = "technology",
name = "productivity-module",
upgrade = true,
prerequisites = { "modules" },
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/productivity-module.png",
effects = { {
recipe = "productivity-module",
type = "unlock-recipe"
} }
},
["laser-turret-speed-1"] = {
order = "e-n-g",
type = "technology",
name = "laser-turret-speed-1",
upgrade = "true",
prerequisites = { "laser-turrets" },
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 } }
},
icon = "__base__/graphics/technology/laser-turret-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.2",
ammo_category = "laser-turret"
} }
},
["armor-making"] = {
type = "technology",
name = "armor-making",
order = "g-a-a",
unit = {
time = 5,
count = 10,
ingredients = { { "science-pack-1", 1 } }
},
icon = "__base__/graphics/technology/armor-making.png",
effects = { {
recipe = "basic-armor",
type = "unlock-recipe"
} }
},
["character-logistic-slots-1"] = {
order = "c-k-e-a",
type = "technology",
name = "character-logistic-slots-1",
upgrade = "true",
prerequisites = { "logistic-robotics" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/character-logistic-slots.png",
effects = { {
modifier = 5,
type = "character-logistic-slots"
} }
},
["research-effectivity-3"] = {
order = "c-m-c",
type = "technology",
name = "research-effectivity-3",
upgrade = "true",
prerequisites = { "research-effectivity-2" },
unit = {
time = 30,
count = 250,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/research-effectivity.png",
effects = { {
modifier = 0.4,
type = "laboratory-speed"
} }
},
["gun-turret-damage-3"] = {
order = "e-o-c",
type = "technology",
name = "gun-turret-damage-3",
upgrade = "true",
prerequisites = { "gun-turret-damage-2" },
unit = {
time = 60,
count = 200,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/gun-turret-damage.png",
effects = { {
type = "turret-attack",
turret_id = "gun-turret",
modifier = "0.2"
} }
},
["advanced-electronics-2"] = {
type = "technology",
name = "advanced-electronics-2",
prerequisites = { "advanced-electronics" },
order = "a-d-c",
icon = "__base__/graphics/technology/advanced-electronics.png",
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
}
},
["follower-robot-count-13"] = {
order = "e-p-b-c",
type = "technology",
name = "follower-robot-count-13",
upgrade = "true",
prerequisites = { "follower-robot-count-12" },
unit = {
count = 1200,
time = 30,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/follower-robots.png",
effects = { {
modifier = 10,
type = "maximum-following-robots-count"
} }
},
["logistics-3"] = {
type = "technology",
name = "logistics-3",
order = "a-f-c",
prerequisites = { "logistics-2" },
unit = {
time = 15,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/logistics.png",
effects = { {
recipe = "express-transport-belt",
type = "unlock-recipe"
}, {
recipe = "express-transport-belt-to-ground",
type = "unlock-recipe"
}, {
recipe = "express-splitter",
type = "unlock-recipe"
} }
},
["research-effectivity-1"] = {
order = "c-m-a",
type = "technology",
name = "research-effectivity-1",
upgrade = "true",
prerequisites = { "electronics" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/research-effectivity.png",
effects = { {
modifier = 0.2,
type = "laboratory-speed"
} }
},
["laser-turret-damage-4"] = {
order = "e-n-d",
type = "technology",
name = "laser-turret-damage-4",
upgrade = "true",
prerequisites = { "laser-turret-damage-3" },
unit = {
time = 60,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/laser-turret-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.2",
ammo_category = "laser-turret"
} }
},
["bullet-damage-2"] = {
order = "e-l-b",
type = "technology",
name = "bullet-damage-2",
upgrade = "true",
prerequisites = { "bullet-damage-1" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/bullet-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.1",
ammo_category = "bullet"
} }
},
["bullet-speed-4"] = {
order = "e-l-j",
type = "technology",
name = "bullet-speed-4",
upgrade = "true",
prerequisites = { "bullet-speed-3" },
unit = {
time = 60,
count = 200,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/bullet-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.3",
ammo_category = "bullet"
} }
},
["shotgun-shell-speed-3"] = {
order = "e-n-i",
type = "technology",
name = "shotgun-shell-speed-3",
upgrade = "true",
prerequisites = { "shotgun-shell-speed-2" },
unit = {
time = 60,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/shotgun-shell-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.3",
ammo_category = "shotgun-shell"
} }
},
["logistic-robot-storage-3"] = {
order = "c-k-g-c",
type = "technology",
name = "logistic-robot-storage-3",
upgrade = "true",
prerequisites = { "logistic-robot-storage-2" },
unit = {
time = 60,
count = 450,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/logistic-robot-storage.png",
effects = { {
modifier = "1",
type = "logistic-robot-storage"
} }
},
["inserter-stack-size-bonus-2"] = {
order = "c-o-b",
type = "technology",
name = "inserter-stack-size-bonus-2",
upgrade = "true",
prerequisites = { "inserter-stack-size-bonus-1" },
unit = {
time = 30,
count = 60,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/inserter-stack-size-bonus.png",
effects = { {
modifier = 1,
type = "inserter-stack-size-bonus"
} }
},
["research-effectivity-2"] = {
order = "c-m-b",
type = "technology",
name = "research-effectivity-2",
upgrade = "true",
prerequisites = { "research-effectivity-1" },
unit = {
time = 30,
count = 150,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/research-effectivity.png",
effects = { {
modifier = 0.3,
type = "laboratory-speed"
} }
},
["bullet-damage-3"] = {
order = "e-l-c",
type = "technology",
name = "bullet-damage-3",
upgrade = "true",
prerequisites = { "bullet-damage-2" },
unit = {
time = 60,
count = 200,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/bullet-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.2",
ammo_category = "bullet"
} }
},
["inserter-stack-size-bonus-4"] = {
order = "c-o-d",
type = "technology",
name = "inserter-stack-size-bonus-4",
upgrade = "true",
prerequisites = { "inserter-stack-size-bonus-3" },
unit = {
time = 30,
count = 300,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 2 } }
},
icon = "__base__/graphics/technology/inserter-stack-size-bonus.png",
effects = { {
modifier = 1,
type = "inserter-stack-size-bonus"
} }
},
["character-logistic-slots-2"] = {
order = "c-k-e-b",
type = "technology",
name = "character-logistic-slots-2",
upgrade = "true",
prerequisites = { "character-logistic-slots-1" },
unit = {
time = 30,
count = 150,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/character-logistic-slots.png",
effects = { {
modifier = 5,
type = "character-logistic-slots"
} }
},
["shotgun-shell-damage-3"] = {
order = "e-n-c",
type = "technology",
name = "shotgun-shell-damage-3",
upgrade = "true",
prerequisites = { "shotgun-shell-damage-2" },
unit = {
time = 60,
count = 200,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/shotgun-shell-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.2",
ammo_category = "shotgun-shell"
} }
},
["armor-making-2"] = {
type = "technology",
name = "armor-making-2",
order = "g-a-b",
prerequisites = { "armor-making", "steel-processing" },
unit = {
time = 30,
count = 30,
ingredients = { { "science-pack-1", 1 } }
},
icon = "__base__/graphics/technology/armor-making.png",
effects = { {
recipe = "heavy-armor",
type = "unlock-recipe"
} }
},
["steel-processing"] = {
type = "technology",
name = "steel-processing",
order = "c-a",
unit = {
time = 5,
count = 20,
ingredients = { { "science-pack-1", 1 } }
},
icon = "__base__/graphics/technology/steel-processing.png",
effects = { {
recipe = "steel-plate",
type = "unlock-recipe"
}, {
recipe = "steel-chest",
type = "unlock-recipe"
}, {
recipe = "steel-axe",
type = "unlock-recipe"
} }
},
["energy-shield-equipment"] = {
type = "technology",
name = "energy-shield-equipment",
order = "g-e-a",
prerequisites = { "armor-making-3" },
unit = {
time = 15,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/energy-shield-equipment.png",
effects = { {
recipe = "energy-shield-equipment",
type = "unlock-recipe"
} }
},
["rocket-damage-4"] = {
order = "e-j-d",
type = "technology",
name = "rocket-damage-4",
upgrade = "true",
prerequisites = { "rocket-damage-3" },
unit = {
time = 60,
count = 150,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/rocket-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.2",
ammo_category = "rocket"
} }
},
["bullet-damage-5"] = {
order = "e-l-e",
type = "technology",
name = "bullet-damage-5",
upgrade = "true",
prerequisites = { "bullet-damage-4" },
unit = {
time = 60,
count = 200,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/bullet-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.2",
ammo_category = "bullet"
} }
},
["combat-robot-damage-4"] = {
order = "e-p-f",
type = "technology",
name = "combat-robot-damage-4",
upgrade = "true",
prerequisites = { "combat-robot-damage-3" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 2 }, { "science-pack-2", 2 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/combat-robot-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.25",
ammo_category = "combat-robot-laser"
} }
},
["follower-robot-count-12"] = {
order = "e-p-b-c",
type = "technology",
name = "follower-robot-count-12",
upgrade = "true",
prerequisites = { "follower-robot-count-11" },
unit = {
count = 1000,
time = 30,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/follower-robots.png",
effects = { {
modifier = 10,
type = "maximum-following-robots-count"
} }
},
["advanced-electronics"] = {
type = "technology",
name = "advanced-electronics",
order = "a-d-b",
prerequisites = { "electronics" },
unit = {
time = 15,
count = 40,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/advanced-electronics.png",
effects = { {
recipe = "smart-chest",
type = "unlock-recipe"
}, {
recipe = "red-wire",
type = "unlock-recipe"
}, {
recipe = "green-wire",
type = "unlock-recipe"
}, {
recipe = "advanced-circuit",
type = "unlock-recipe"
}, {
recipe = "processing-unit",
type = "unlock-recipe"
} }
},
["follower-robot-count-10"] = {
order = "e-p-b-c",
type = "technology",
name = "follower-robot-count-10",
upgrade = "true",
prerequisites = { "follower-robot-count-9" },
unit = {
count = 600,
time = 30,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/follower-robots.png",
effects = { {
modifier = 5,
type = "maximum-following-robots-count"
} }
},
["logistic-robotics"] = {
type = "technology",
name = "logistic-robotics",
order = "c-k-c",
prerequisites = { "robotics", "flying" },
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/logistic-robotics.png",
effects = { {
recipe = "roboport",
type = "unlock-recipe"
}, {
recipe = "logistic-chest-passive-provider",
type = "unlock-recipe"
}, {
recipe = "logistic-robot",
type = "unlock-recipe"
} }
},
["logistic-robot-storage-2"] = {
order = "c-k-g-b",
type = "technology",
name = "logistic-robot-storage-2",
upgrade = "true",
prerequisites = { "logistic-robot-storage-1" },
unit = {
time = 60,
count = 300,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/logistic-robot-storage.png",
effects = { {
modifier = "1",
type = "logistic-robot-storage"
} }
},
["rocket-speed-1"] = {
order = "e-j-f",
type = "technology",
name = "rocket-speed-1",
upgrade = "true",
prerequisites = { "rocketry", "alien-technology" },
unit = {
time = 30,
count = 200,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/rocket-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.2",
ammo_category = "rocket"
} }
},
["speed-module-2"] = {
order = "i-c-b",
type = "technology",
name = "speed-module-2",
upgrade = true,
prerequisites = { "speed-module" },
unit = {
time = 30,
count = 75,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/speed-module.png",
effects = { {
recipe = "speed-module-2",
type = "unlock-recipe"
} }
},
["follower-robot-count-6"] = {
order = "e-p-b-c",
type = "technology",
name = "follower-robot-count-6",
upgrade = "true",
prerequisites = { "follower-robot-count-5" },
unit = {
count = 200,
time = 30,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/follower-robots.png",
effects = { {
modifier = 5,
type = "maximum-following-robots-count"
} }
},
["follower-robot-count-9"] = {
order = "e-p-b-c",
type = "technology",
name = "follower-robot-count-9",
upgrade = "true",
prerequisites = { "follower-robot-count-8" },
unit = {
count = 500,
time = 30,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/follower-robots.png",
effects = { {
modifier = 5,
type = "maximum-following-robots-count"
} }
},
["follower-robot-count-8"] = {
order = "e-p-b-c",
type = "technology",
name = "follower-robot-count-8",
upgrade = "true",
prerequisites = { "follower-robot-count-7", "combat-robotics-3" },
unit = {
count = 400,
time = 30,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/follower-robots.png",
effects = { {
modifier = 5,
type = "maximum-following-robots-count"
} }
},
["laser-turret-damage-5"] = {
order = "e-n-e",
type = "technology",
name = "laser-turret-damage-5",
upgrade = "true",
prerequisites = { "laser-turret-damage-4" },
unit = {
time = 60,
count = 200,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/laser-turret-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.2",
ammo_category = "laser-turret"
} }
},
["research-effectivity-4"] = {
order = "c-m-d",
type = "technology",
name = "research-effectivity-4",
upgrade = "true",
prerequisites = { "research-effectivity-3" },
unit = {
time = 30,
count = 500,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/research-effectivity.png",
effects = { {
modifier = 0.5,
type = "laboratory-speed"
} }
},
["rocket-damage-5"] = {
order = "e-j-e",
type = "technology",
name = "rocket-damage-5",
upgrade = "true",
prerequisites = { "rocket-damage-4" },
unit = {
time = 60,
count = 300,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/rocket-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.2",
ammo_category = "rocket"
} }
},
turrets = {
type = "technology",
name = "turrets",
order = "a-j-a",
unit = {
time = 10,
count = 10,
ingredients = { { "science-pack-1", 1 } }
},
icon = "__base__/graphics/technology/turrets.png",
effects = { {
recipe = "gun-turret",
type = "unlock-recipe"
} }
},
["follower-robot-count-1"] = {
order = "e-p-b-c",
type = "technology",
name = "follower-robot-count-1",
upgrade = "true",
prerequisites = { "combat-robotics" },
unit = {
count = 50,
time = 30,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/follower-robots.png",
effects = { {
modifier = 1,
type = "maximum-following-robots-count"
} }
},
["bullet-damage-4"] = {
order = "e-l-d",
type = "technology",
name = "bullet-damage-4",
upgrade = "true",
prerequisites = { "bullet-damage-3" },
unit = {
time = 60,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/bullet-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.2",
ammo_category = "bullet"
} }
},
engine = {
type = "technology",
name = "engine",
order = "b-a",
prerequisites = { "steel-processing" },
effects = { {
recipe = "engine-unit",
type = "unlock-recipe"
} },
icon = "__base__/graphics/technology/engine.png",
unit = {
time = 15,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
}
},
toolbelt = {
type = "technology",
name = "toolbelt",
order = "c-k-m",
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/toolbelt.png",
effects = { {
modifier = 1,
type = "num-quick-bars"
} }
},
explosives = {
type = "technology",
name = "explosives",
order = "a-e-d",
prerequisites = { "sulfur-processing" },
effects = { {
recipe = "explosives",
type = "unlock-recipe"
} },
icon = "__base__/graphics/technology/explosives.png",
unit = {
time = 15,
count = 60,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
}
},
["automated-rail-transportation"] = {
type = "technology",
name = "automated-rail-transportation",
order = "c-g-b",
prerequisites = { "railway" },
unit = {
time = 20,
count = 70,
ingredients = { { "science-pack-1", 2 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/automated-rail-transportation.png",
effects = { {
recipe = "train-stop",
type = "unlock-recipe"
}, {
recipe = "cargo-wagon",
type = "unlock-recipe"
} }
},
["effectivity-module-2"] = {
order = "i-g-b",
type = "technology",
name = "effectivity-module-2",
upgrade = true,
prerequisites = { "effectivity-module" },
unit = {
time = 30,
count = 75,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/effectivity-module.png",
effects = { {
recipe = "effectivity-module-2",
type = "unlock-recipe"
} }
},
["advanced-material-processing-2"] = {
type = "technology",
name = "advanced-material-processing-2",
order = "c-c-b",
prerequisites = { "advanced-material-processing", "advanced-electronics" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/advanced-material-processing.png",
effects = { {
recipe = "electric-furnace",
type = "unlock-recipe"
} }
},
["land-mine"] = {
type = "technology",
name = "land-mine",
order = "e-e",
prerequisites = { "explosives", "military-2" },
unit = {
time = 15,
count = 20,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/land-mine.png",
effects = { {
recipe = "land-mine",
type = "unlock-recipe"
} }
},
optics = {
type = "technology",
name = "optics",
order = "a-h-a",
unit = {
time = 15,
count = 10,
ingredients = { { "science-pack-1", 1 } }
},
icon = "__base__/graphics/technology/optics.png",
effects = { {
recipe = "small-lamp",
type = "unlock-recipe"
} }
},
["shotgun-shell-speed-6"] = {
order = "e-n-l",
type = "technology",
name = "shotgun-shell-speed-6",
upgrade = "true",
prerequisites = { "shotgun-shell-speed-5" },
unit = {
time = 60,
count = 300,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/shotgun-shell-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.3",
ammo_category = "shotgun-shell"
} }
},
["military-4"] = {
type = "technology",
name = "military-4",
order = "e-a-d",
prerequisites = { "military-3" },
unit = {
time = 45,
count = 150,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 2 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/military.png",
effects = { {
recipe = "piercing-shotgun-shell",
type = "unlock-recipe"
} }
},
["combat-robot-damage-3"] = {
order = "e-p-e",
type = "technology",
name = "combat-robot-damage-3",
upgrade = "true",
prerequisites = { "combat-robot-damage-2" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 2 }, { "science-pack-2", 2 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/combat-robot-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.2",
ammo_category = "combat-robot-laser"
} }
},
["rocket-speed-4"] = {
order = "e-j-i",
type = "technology",
name = "rocket-speed-4",
upgrade = "true",
prerequisites = { "rocket-speed-3" },
unit = {
time = 60,
count = 150,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/rocket-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.3",
ammo_category = "rocket"
} }
},
["follower-robot-count-2"] = {
order = "e-p-b-c",
type = "technology",
name = "follower-robot-count-2",
upgrade = "true",
prerequisites = { "follower-robot-count-1" },
unit = {
count = 100,
time = 30,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/follower-robots.png",
effects = { {
modifier = 1,
type = "maximum-following-robots-count"
} }
},
["logistics-2"] = {
type = "technology",
name = "logistics-2",
order = "a-f-b",
prerequisites = { "logistics" },
unit = {
time = 30,
count = 40,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/logistics.png",
effects = { {
recipe = "fast-transport-belt",
type = "unlock-recipe"
}, {
recipe = "fast-transport-belt-to-ground",
type = "unlock-recipe"
}, {
recipe = "fast-splitter",
type = "unlock-recipe"
} }
},
["rocket-speed-5"] = {
order = "e-j-j",
type = "technology",
name = "rocket-speed-5",
upgrade = "true",
prerequisites = { "rocket-speed-4" },
unit = {
time = 60,
count = 300,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/rocket-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.3",
ammo_category = "rocket"
} }
},
["rocket-travel"] = {
enabled = false,
type = "technology",
name = "rocket-travel",
prerequisites = { "rocket-speed-2", "logistics-3" },
order = "e-h",
icon = "__base__/graphics/technology/rocket-travel.png",
unit = {
time = 15,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 2 } }
}
},
["rocket-speed-3"] = {
order = "e-j-h",
type = "technology",
name = "rocket-speed-3",
upgrade = "true",
prerequisites = { "rocket-speed-2" },
unit = {
time = 60,
count = 100,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/rocket-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.3",
ammo_category = "rocket"
} }
},
["rocket-speed-2"] = {
order = "e-j-g",
type = "technology",
name = "rocket-speed-2",
upgrade = "true",
prerequisites = { "rocket-speed-1" },
unit = {
time = 30,
count = 250,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/rocket-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.2",
ammo_category = "rocket"
} }
},
["advanced-material-processing"] = {
type = "technology",
name = "advanced-material-processing",
order = "c-c-a",
prerequisites = { "steel-processing" },
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/advanced-material-processing.png",
effects = { {
recipe = "steel-furnace",
type = "unlock-recipe"
} }
},
["rocket-damage-3"] = {
order = "e-j-c",
type = "technology",
name = "rocket-damage-3",
upgrade = "true",
prerequisites = { "rocket-damage-2" },
unit = {
time = 60,
count = 100,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/rocket-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.2",
ammo_category = "rocket"
} }
},
["rocket-damage-2"] = {
order = "e-j-b",
type = "technology",
name = "rocket-damage-2",
upgrade = "true",
prerequisites = { "rocket-damage-1" },
unit = {
time = 30,
count = 250,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/rocket-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.1",
ammo_category = "rocket"
} }
},
["gun-turret-damage-1"] = {
order = "e-o-a",
type = "technology",
name = "gun-turret-damage-1",
upgrade = "true",
prerequisites = { "turrets" },
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/gun-turret-damage.png",
effects = { {
type = "turret-attack",
turret_id = "gun-turret",
modifier = "0.1"
} }
},
["speed-module"] = {
order = "i-c-a",
type = "technology",
name = "speed-module",
upgrade = true,
prerequisites = { "modules" },
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/speed-module.png",
effects = { {
recipe = "speed-module",
type = "unlock-recipe"
} }
},
["armor-making-3"] = {
type = "technology",
name = "armor-making-3",
order = "g-a-c",
prerequisites = { "armor-making-2", "speed-module" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/armor-making.png",
effects = { {
recipe = "basic-modular-armor",
type = "unlock-recipe"
} }
},
flying = {
type = "technology",
name = "flying",
prerequisites = { "electric-engine", "advanced-electronics" },
order = "c-h",
icon = "__base__/graphics/technology/flying.png",
unit = {
time = 30,
count = 200,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
}
},
["laser-turret-speed-6"] = {
order = "e-n-l",
type = "technology",
name = "laser-turret-speed-6",
upgrade = "true",
prerequisites = { "laser-turret-speed-5" },
unit = {
time = 60,
count = 300,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/laser-turret-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.3",
ammo_category = "laser-turret"
} }
},
automation = {
type = "technology",
name = "automation",
order = "a-b-a",
unit = {
time = 10,
count = 10,
ingredients = { { "science-pack-1", 1 } }
},
icon = "__base__/graphics/technology/automation.png",
effects = { {
recipe = "assembling-machine-1",
type = "unlock-recipe"
}, {
recipe = "long-handed-inserter",
type = "unlock-recipe"
} }
},
["laser-turret-speed-5"] = {
order = "e-n-k",
type = "technology",
name = "laser-turret-speed-5",
upgrade = "true",
prerequisites = { "laser-turret-speed-4" },
unit = {
time = 60,
count = 200,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/laser-turret-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.3",
ammo_category = "laser-turret"
} }
},
["basic-exoskeleton-equipment"] = {
type = "technology",
name = "basic-exoskeleton-equipment",
order = "g-h",
prerequisites = { "solar-panel-equipment" },
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/basic-exoskeleton-equipment.png",
effects = { {
recipe = "basic-exoskeleton-equipment",
type = "unlock-recipe"
} }
},
["laser-turret-speed-3"] = {
order = "e-n-i",
type = "technology",
name = "laser-turret-speed-3",
upgrade = "true",
prerequisites = { "laser-turret-speed-2" },
unit = {
time = 60,
count = 200,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/laser-turret-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.3",
ammo_category = "laser-turret"
} }
},
["power-armor"] = {
type = "technology",
name = "power-armor",
order = "g-c-a",
prerequisites = { "armor-making-3" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/power-armor.png",
effects = { {
recipe = "power-armor",
type = "unlock-recipe"
} }
},
["oil-processing"] = {
type = "technology",
name = "oil-processing",
order = "d-a",
prerequisites = { "steel-processing" },
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/oil-gathering.png",
effects = { {
recipe = "pumpjack",
type = "unlock-recipe"
}, {
recipe = "oil-refinery",
type = "unlock-recipe"
}, {
recipe = "chemical-plant",
type = "unlock-recipe"
}, {
recipe = "basic-oil-processing",
type = "unlock-recipe"
}, {
recipe = "solid-fuel-from-light-oil",
type = "unlock-recipe"
}, {
recipe = "solid-fuel-from-petroleum-gas",
type = "unlock-recipe"
}, {
recipe = "solid-fuel-from-heavy-oil",
type = "unlock-recipe"
}, {
recipe = "lubricant",
type = "unlock-recipe"
} }
},
["laser-turret-speed-2"] = {
order = "e-n-h",
type = "technology",
name = "laser-turret-speed-2",
upgrade = "true",
prerequisites = { "laser-turret-speed-1" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/laser-turret-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.2",
ammo_category = "laser-turret"
} }
},
["combat-robotics-3"] = {
type = "technology",
name = "combat-robotics-3",
order = "e-p-b-b",
prerequisites = { "combat-robotics-2" },
unit = {
time = 30,
count = 300,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/combat-robotics.png",
effects = { {
recipe = "destroyer-capsule",
type = "unlock-recipe"
} }
},
["solar-panel-equipment"] = {
type = "technology",
name = "solar-panel-equipment",
order = "g-k",
prerequisites = { "armor-making-3" },
unit = {
time = 15,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/solar-panel-equipment.png",
effects = { {
recipe = "solar-panel-equipment",
type = "unlock-recipe"
} }
},
["laser-turret-damage-3"] = {
order = "e-n-c",
type = "technology",
name = "laser-turret-damage-3",
upgrade = "true",
prerequisites = { "laser-turret-damage-2" },
unit = {
time = 60,
count = 200,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/laser-turret-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.2",
ammo_category = "laser-turret"
} }
},
["shotgun-shell-speed-2"] = {
order = "e-n-h",
type = "technology",
name = "shotgun-shell-speed-2",
upgrade = "true",
prerequisites = { "shotgun-shell-speed-1" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 } }
},
icon = "__base__/graphics/technology/shotgun-shell-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.2",
ammo_category = "shotgun-shell"
} }
},
["laser-turret-damage-2"] = {
order = "e-n-b",
type = "technology",
name = "laser-turret-damage-2",
upgrade = "true",
prerequisites = { "laser-turret-damage-1" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/laser-turret-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.1",
ammo_category = "laser-turret"
} }
},
["gun-turret-damage-6"] = {
order = "e-o-f",
type = "technology",
name = "gun-turret-damage-6",
upgrade = "true",
prerequisites = { "gun-turret-damage-5" },
unit = {
time = 60,
count = 300,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/gun-turret-damage.png",
effects = { {
type = "turret-attack",
turret_id = "gun-turret",
modifier = "0.4"
} }
},
["electric-energy-accumulators-1"] = {
type = "technology",
name = "electric-energy-accumulators-1",
order = "c-e-a",
prerequisites = { "electric-energy-distribution-1", "battery" },
unit = {
time = 30,
count = 60,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/electric-energy-acumulators.png",
effects = { {
recipe = "basic-accumulator",
type = "unlock-recipe"
} }
},
["character-logistic-slots-3"] = {
order = "c-k-e-c",
type = "technology",
name = "character-logistic-slots-3",
upgrade = "true",
prerequisites = { "character-logistic-slots-2" },
unit = {
time = 30,
count = 150,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/character-logistic-slots.png",
effects = { {
modifier = 5,
type = "character-logistic-slots"
} }
},
["gun-turret-damage-5"] = {
order = "e-o-e",
type = "technology",
name = "gun-turret-damage-5",
upgrade = "true",
prerequisites = { "gun-turret-damage-4" },
unit = {
time = 60,
count = 200,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/gun-turret-damage.png",
effects = { {
type = "turret-attack",
turret_id = "gun-turret",
modifier = "0.2"
} }
},
["gun-turret-damage-4"] = {
order = "e-o-d",
type = "technology",
name = "gun-turret-damage-4",
upgrade = "true",
prerequisites = { "gun-turret-damage-3" },
unit = {
time = 60,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/gun-turret-damage.png",
effects = { {
type = "turret-attack",
turret_id = "gun-turret",
modifier = "0.2"
} }
},
["flame-thrower"] = {
type = "technology",
name = "flame-thrower",
order = "e-c-b",
prerequisites = { "flammables", "military-2" },
unit = {
time = 15,
count = 20,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/flame-thrower.png",
effects = { {
recipe = "flame-thrower",
type = "unlock-recipe"
}, {
recipe = "flame-thrower-ammo",
type = "unlock-recipe"
} }
},
["alien-technology"] = {
type = "technology",
name = "alien-technology",
order = "e-f",
prerequisites = { "rocketry" },
unit = {
time = 30,
count = 300,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/alien-technology.png",
effects = { {
recipe = "alien-science-pack",
type = "unlock-recipe"
} }
},
["shotgun-shell-speed-4"] = {
order = "e-n-j",
type = "technology",
name = "shotgun-shell-speed-4",
upgrade = "true",
prerequisites = { "shotgun-shell-speed-3" },
unit = {
time = 60,
count = 200,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/shotgun-shell-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.3",
ammo_category = "shotgun-shell"
} }
},
["character-logistic-slots-4"] = {
order = "c-k-e-d",
type = "technology",
name = "character-logistic-slots-4",
upgrade = "true",
prerequisites = { "character-logistic-slots-3" },
unit = {
time = 30,
count = 150,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/character-logistic-slots.png",
effects = { {
modifier = 5,
type = "character-logistic-slots"
} }
},
["gun-turret-damage-2"] = {
order = "e-o-b",
type = "technology",
name = "gun-turret-damage-2",
upgrade = "true",
prerequisites = { "gun-turret-damage-1" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/gun-turret-damage.png",
effects = { {
type = "turret-attack",
turret_id = "gun-turret",
modifier = "0.1"
} }
},
["advanced-oil-processing"] = {
type = "technology",
name = "advanced-oil-processing",
order = "d-b",
prerequisites = { "oil-processing" },
unit = {
time = 30,
count = 75,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/oil-processing.png",
effects = { {
recipe = "advanced-oil-processing",
type = "unlock-recipe"
}, {
recipe = "heavy-oil-cracking",
type = "unlock-recipe"
}, {
recipe = "light-oil-cracking",
type = "unlock-recipe"
} }
},
["productivity-module-2"] = {
order = "i-e-b",
type = "technology",
name = "productivity-module-2",
upgrade = true,
prerequisites = { "productivity-module" },
unit = {
time = 30,
count = 75,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/productivity-module.png",
effects = { {
recipe = "productivity-module-2",
type = "unlock-recipe"
} }
},
["shotgun-shell-speed-5"] = {
order = "e-n-k",
type = "technology",
name = "shotgun-shell-speed-5",
upgrade = "true",
prerequisites = { "shotgun-shell-speed-4" },
unit = {
time = 60,
count = 200,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/shotgun-shell-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.3",
ammo_category = "shotgun-shell"
} }
},
["shotgun-shell-speed-1"] = {
order = "e-n-g",
type = "technology",
name = "shotgun-shell-speed-1",
upgrade = "true",
prerequisites = { "military" },
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 } }
},
icon = "__base__/graphics/technology/shotgun-shell-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.2",
ammo_category = "shotgun-shell"
} }
},
["bullet-speed-3"] = {
order = "e-l-i",
type = "technology",
name = "bullet-speed-3",
upgrade = "true",
prerequisites = { "bullet-speed-2" },
unit = {
time = 60,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/bullet-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.3",
ammo_category = "bullet"
} }
},
["bullet-speed-2"] = {
order = "e-l-h",
type = "technology",
name = "bullet-speed-2",
upgrade = "true",
prerequisites = { "bullet-speed-1" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 } }
},
icon = "__base__/graphics/technology/bullet-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.2",
ammo_category = "bullet"
} }
},
["automation-2"] = {
type = "technology",
name = "automation-2",
order = "a-b-b",
prerequisites = { "electronics" },
unit = {
time = 15,
count = 40,
ingredients = { { "science-pack-1", 2 } }
},
icon = "__base__/graphics/technology/automation.png",
effects = { {
recipe = "assembling-machine-2",
type = "unlock-recipe"
} }
},
["shotgun-shell-damage-2"] = {
order = "e-n-b",
type = "technology",
name = "shotgun-shell-damage-2",
upgrade = "true",
prerequisites = { "shotgun-shell-damage-1" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/shotgun-shell-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.1",
ammo_category = "shotgun-shell"
} }
},
automobilism = {
type = "technology",
name = "automobilism",
order = "e-b",
prerequisites = { "logistics-2", "engine" },
unit = {
time = 20,
count = 100,
ingredients = { { "science-pack-1", 2 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/automobilism.png",
effects = { {
recipe = "car",
type = "unlock-recipe"
} }
},
["shotgun-shell-damage-5"] = {
order = "e-n-e",
type = "technology",
name = "shotgun-shell-damage-5",
upgrade = "true",
prerequisites = { "shotgun-shell-damage-4" },
unit = {
time = 60,
count = 200,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/shotgun-shell-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.2",
ammo_category = "shotgun-shell"
} }
},
["bullet-speed-6"] = {
order = "e-l-l",
type = "technology",
name = "bullet-speed-6",
upgrade = "true",
prerequisites = { "bullet-speed-5" },
unit = {
time = 60,
count = 300,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/bullet-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.3",
ammo_category = "bullet"
} }
},
["solar-energy"] = {
type = "technology",
name = "solar-energy",
order = "a-h-c",
prerequisites = { "optics", "advanced-electronics" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/solar-energy.png",
effects = { {
recipe = "solar-panel",
type = "unlock-recipe"
} }
},
["shotgun-shell-damage-6"] = {
order = "e-n-f",
type = "technology",
name = "shotgun-shell-damage-6",
upgrade = "true",
prerequisites = { "shotgun-shell-damage-5" },
unit = {
time = 60,
count = 300,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/shotgun-shell-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.4",
ammo_category = "shotgun-shell"
} }
},
["logistic-robot-speed-2"] = {
order = "c-k-f-b",
type = "technology",
name = "logistic-robot-speed-2",
upgrade = "true",
prerequisites = { "logistic-robot-speed-1" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/logistic-robot-speed.png",
effects = { {
modifier = "0.4",
type = "logistic-robot-speed"
} }
},
["bullet-damage-6"] = {
order = "e-l-f",
type = "technology",
name = "bullet-damage-6",
upgrade = "true",
prerequisites = { "bullet-damage-5" },
unit = {
time = 60,
count = 300,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/bullet-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.4",
ammo_category = "bullet"
} }
},
["follower-robot-count-17"] = {
order = "e-p-b-c",
type = "technology",
name = "follower-robot-count-17",
upgrade = "true",
prerequisites = { "follower-robot-count-16" },
unit = {
count = 2000,
time = 30,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/follower-robots.png",
effects = { {
modifier = 10,
type = "maximum-following-robots-count"
} }
},
["follower-robot-count-18"] = {
order = "e-p-b-c",
type = "technology",
name = "follower-robot-count-18",
upgrade = "true",
prerequisites = { "follower-robot-count-17" },
unit = {
count = 2200,
time = 30,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/follower-robots.png",
effects = { {
modifier = 10,
type = "maximum-following-robots-count"
} }
},
["combat-robotics"] = {
type = "technology",
name = "combat-robotics",
order = "e-p-a",
prerequisites = { "military-2" },
unit = {
time = 30,
count = 150,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/combat-robotics.png",
effects = { {
recipe = "defender-capsule",
type = "unlock-recipe"
} }
},
["follower-robot-count-20"] = {
order = "e-p-b-c",
type = "technology",
name = "follower-robot-count-20",
upgrade = "true",
prerequisites = { "follower-robot-count-19" },
unit = {
count = 2600,
time = 30,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/follower-robots.png",
effects = { {
modifier = 10,
type = "maximum-following-robots-count"
} }
},
["fluid-handling"] = {
type = "technology",
name = "fluid-handling",
order = "d-a-a",
prerequisites = { "oil-processing" },
unit = {
time = 30,
count = 75,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/fluid-handling.png",
effects = { {
recipe = "storage-tank",
type = "unlock-recipe"
}, {
recipe = "small-pump",
type = "unlock-recipe"
}, {
recipe = "empty-barrel",
type = "unlock-recipe"
}, {
recipe = "fill-crude-oil-barrel",
type = "unlock-recipe"
}, {
recipe = "empty-crude-oil-barrel",
type = "unlock-recipe"
} }
},
["electric-energy-distribution-1"] = {
type = "technology",
name = "electric-energy-distribution-1",
order = "c-e-b",
prerequisites = { "electronics", "steel-processing" },
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/electric-energy-distribution.png",
effects = { {
recipe = "medium-electric-pole",
type = "unlock-recipe"
}, {
recipe = "big-electric-pole",
type = "unlock-recipe"
} }
},
["follower-robot-count-15"] = {
order = "e-p-b-c",
type = "technology",
name = "follower-robot-count-15",
upgrade = "true",
prerequisites = { "follower-robot-count-14" },
unit = {
count = 1600,
time = 30,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/follower-robots.png",
effects = { {
modifier = 10,
type = "maximum-following-robots-count"
} }
},
["bullet-damage-1"] = {
order = "e-l-a",
type = "technology",
name = "bullet-damage-1",
upgrade = "true",
prerequisites = { "military" },
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 } }
},
icon = "__base__/graphics/technology/bullet-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.1",
ammo_category = "bullet"
} }
},
["basic-laser-defense-equipment"] = {
type = "technology",
name = "basic-laser-defense-equipment",
order = "g-m",
prerequisites = { "armor-making-3" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/basic-laser-defense-equipment.png",
effects = { {
recipe = "basic-laser-defense-equipment",
type = "unlock-recipe"
} }
},
battery = {
type = "technology",
name = "battery",
order = "b-c",
prerequisites = { "sulfur-processing" },
effects = { {
recipe = "battery",
type = "unlock-recipe"
}, {
recipe = "science-pack-3",
type = "unlock-recipe"
} },
icon = "__base__/graphics/technology/battery.png",
unit = {
time = 25,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
}
},
["speed-module-3"] = {
order = "i-c-c",
type = "technology",
name = "speed-module-3",
upgrade = true,
prerequisites = { "speed-module-2" },
unit = {
time = 60,
count = 300,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/speed-module.png",
effects = { {
recipe = "speed-module-3",
type = "unlock-recipe"
} }
},
railway = {
type = "technology",
name = "railway",
order = "c-g-a",
prerequisites = { "logistics-2", "steel-processing" },
unit = {
time = 20,
count = 70,
ingredients = { { "science-pack-1", 2 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/railway.png",
effects = { {
recipe = "straight-rail",
type = "unlock-recipe"
}, {
recipe = "curved-rail",
type = "unlock-recipe"
}, {
recipe = "diesel-locomotive",
type = "unlock-recipe"
} }
},
["military-2"] = {
type = "technology",
name = "military-2",
order = "e-a-b",
prerequisites = { "military", "steel-processing" },
unit = {
time = 15,
count = 20,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/military.png",
effects = { {
recipe = "piercing-bullet-magazine",
type = "unlock-recipe"
}, {
recipe = "basic-grenade",
type = "unlock-recipe"
} }
},
["follower-robot-count-7"] = {
order = "e-p-b-c",
type = "technology",
name = "follower-robot-count-7",
upgrade = "true",
prerequisites = { "follower-robot-count-6" },
unit = {
count = 300,
time = 30,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/follower-robots.png",
effects = { {
modifier = 5,
type = "maximum-following-robots-count"
} }
},
["electric-engine"] = {
type = "technology",
name = "electric-engine",
order = "b-b",
prerequisites = { "engine", "advanced-electronics" },
effects = { {
recipe = "electric-engine-unit",
type = "unlock-recipe"
} },
icon = "__base__/graphics/technology/electric-engine.png",
unit = {
time = 25,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
}
},
["follower-robot-count-4"] = {
order = "e-p-b-c",
type = "technology",
name = "follower-robot-count-4",
upgrade = "true",
prerequisites = { "follower-robot-count-3" },
unit = {
count = 200,
time = 30,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/follower-robots.png",
effects = { {
modifier = 2,
type = "maximum-following-robots-count"
} }
},
["logistic-system"] = {
type = "technology",
name = "logistic-system",
order = "c-k-d",
prerequisites = { "logistic-robotics" },
unit = {
time = 30,
count = 150,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/logistic-system.png",
effects = { {
recipe = "logistic-chest-active-provider",
type = "unlock-recipe"
}, {
recipe = "logistic-chest-requester",
type = "unlock-recipe"
} }
},
["logistic-robot-speed-3"] = {
order = "c-k-f-c",
type = "technology",
name = "logistic-robot-speed-3",
upgrade = "true",
prerequisites = { "logistic-robot-speed-2" },
unit = {
time = 60,
count = 150,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/logistic-robot-speed.png",
effects = { {
modifier = "0.45",
type = "logistic-robot-speed"
} }
},
["effect-transmission"] = {
type = "technology",
name = "effect-transmission",
order = "i-i",
prerequisites = { "modules", "advanced-electronics-2" },
unit = {
time = 30,
count = 75,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/effect-transmission.png",
effects = { {
recipe = "basic-beacon",
type = "unlock-recipe"
} }
},
["shotgun-shell-damage-1"] = {
order = "e-n-a",
type = "technology",
name = "shotgun-shell-damage-1",
upgrade = "true",
prerequisites = { "military" },
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 } }
},
icon = "__base__/graphics/technology/shotgun-shell-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.1",
ammo_category = "shotgun-shell"
} }
},
["bullet-speed-5"] = {
order = "e-l-k",
type = "technology",
name = "bullet-speed-5",
upgrade = "true",
prerequisites = { "bullet-speed-4" },
unit = {
time = 60,
count = 200,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/bullet-speed.png",
effects = { {
type = "gun-speed",
modifier = "0.3",
ammo_category = "bullet"
} }
},
["effectivity-module-3"] = {
order = "i-g-c",
type = "technology",
name = "effectivity-module-3",
upgrade = true,
prerequisites = { "effectivity-module-2" },
unit = {
time = 60,
count = 300,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/effectivity-module.png",
effects = { {
recipe = "effectivity-module-3",
type = "unlock-recipe"
} }
},
["inserter-stack-size-bonus-1"] = {
order = "c-o-a",
type = "technology",
name = "inserter-stack-size-bonus-1",
upgrade = "true",
prerequisites = { "logistics" },
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/inserter-stack-size-bonus.png",
effects = { {
modifier = 1,
type = "inserter-stack-size-bonus"
} }
},
plastics = {
type = "technology",
name = "plastics",
order = "d-d",
prerequisites = { "oil-processing" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/plastics.png",
effects = { {
recipe = "plastic-bar",
type = "unlock-recipe"
} }
},
["combat-robot-damage-5"] = {
order = "e-p-g",
type = "technology",
name = "combat-robot-damage-5",
upgrade = "true",
prerequisites = { "combat-robot-damage-4" },
unit = {
time = 30,
count = 200,
ingredients = { { "science-pack-1", 2 }, { "science-pack-2", 2 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/combat-robot-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.3",
ammo_category = "combat-robot-laser"
} }
},
rocketry = {
type = "technology",
name = "rocketry",
order = "e-g",
prerequisites = { "electronics", "flammables", "explosives", "steel-processing" },
unit = {
time = 15,
count = 80,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/rocketry.png",
effects = { {
recipe = "rocket-launcher",
type = "unlock-recipe"
}, {
recipe = "rocket",
type = "unlock-recipe"
} }
},
["follower-robot-count-14"] = {
order = "e-p-b-c",
type = "technology",
name = "follower-robot-count-14",
upgrade = "true",
prerequisites = { "follower-robot-count-13" },
unit = {
count = 1400,
time = 30,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/follower-robots.png",
effects = { {
modifier = 10,
type = "maximum-following-robots-count"
} }
},
["logistic-robot-speed-1"] = {
order = "c-k-f-a",
type = "technology",
name = "logistic-robot-speed-1",
upgrade = "true",
prerequisites = { "logistic-robotics" },
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/logistic-robot-speed.png",
effects = { {
modifier = "0.35",
type = "logistic-robot-speed"
} }
},
["power-armor-2"] = {
type = "technology",
name = "power-armor-2",
order = "g-c-b",
prerequisites = { "power-armor", "alien-technology" },
unit = {
time = 30,
count = 150,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 3 } }
},
icon = "__base__/graphics/technology/power-armor-mk2.png",
effects = { {
recipe = "power-armor-mk2",
type = "unlock-recipe"
} }
},
robotics = {
type = "technology",
name = "robotics",
order = "c-i",
prerequisites = { "advanced-electronics-2", "electric-engine", "battery" },
effects = { {
recipe = "flying-robot-frame",
type = "unlock-recipe"
} },
icon = "__base__/graphics/technology/robotics.png",
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
}
},
["combat-robot-damage-1"] = {
order = "e-p-c",
type = "technology",
name = "combat-robot-damage-1",
upgrade = "true",
prerequisites = { "combat-robotics" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/combat-robot-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.1",
ammo_category = "combat-robot-laser"
} }
},
["effectivity-module"] = {
order = "i-g-a",
type = "technology",
name = "effectivity-module",
upgrade = true,
prerequisites = { "modules" },
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/effectivity-module.png",
effects = { {
recipe = "effectivity-module",
type = "unlock-recipe"
} }
},
["laser-turret-damage-6"] = {
order = "e-n-f",
type = "technology",
name = "laser-turret-damage-6",
upgrade = "true",
prerequisites = { "laser-turret-damage-5" },
unit = {
time = 60,
count = 300,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/laser-turret-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.4",
ammo_category = "laser-turret"
} }
},
["battery-mk2-equipment"] = {
type = "technology",
name = "battery-mk2-equipment",
order = "g-i-b",
prerequisites = { "battery-equipment" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/battery-mk2-equipment.png",
effects = { {
recipe = "battery-mk2-equipment",
type = "unlock-recipe"
} }
},
["productivity-module-3"] = {
order = "i-e-c",
type = "technology",
name = "productivity-module-3",
upgrade = true,
prerequisites = { "productivity-module-2" },
unit = {
time = 60,
count = 300,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/productivity-module.png",
effects = { {
recipe = "productivity-module-3",
type = "unlock-recipe"
} }
},
["sulfur-processing"] = {
type = "technology",
name = "sulfur-processing",
order = "d-c",
prerequisites = { "oil-processing" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/sulfur-processing.png",
effects = { {
recipe = "sulfuric-acid",
type = "unlock-recipe"
}, {
recipe = "sulfur",
type = "unlock-recipe"
} }
},
["rocket-damage-1"] = {
order = "e-j-a",
type = "technology",
name = "rocket-damage-1",
upgrade = "true",
prerequisites = { "rocketry", "alien-technology" },
unit = {
time = 30,
count = 200,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/rocket-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.1",
ammo_category = "rocket"
} }
},
laser = {
type = "technology",
name = "laser",
prerequisites = { "optics", "advanced-electronics" },
order = "a-h-b",
icon = "__base__/graphics/technology/laser.png",
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
}
},
["laser-turrets"] = {
type = "technology",
name = "laser-turrets",
order = "a-j-b",
prerequisites = { "turrets", "laser", "battery" },
unit = {
time = 30,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/laser-turrets.png",
effects = { {
recipe = "laser-turret",
type = "unlock-recipe"
} }
},
["inserter-stack-size-bonus-3"] = {
order = "c-o-c",
type = "technology",
name = "inserter-stack-size-bonus-3",
upgrade = "true",
prerequisites = { "inserter-stack-size-bonus-2" },
unit = {
time = 30,
count = 200,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/inserter-stack-size-bonus.png",
effects = { {
modifier = 1,
type = "inserter-stack-size-bonus"
} }
},
["explosive-rocketry"] = {
type = "technology",
name = "explosive-rocketry",
order = "e-h",
prerequisites = { "rocketry" },
unit = {
time = 20,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/explosive-rocketry.png",
effects = { {
recipe = "explosive-rocket",
type = "unlock-recipe"
} }
},
["follower-robot-count-19"] = {
order = "e-p-b-c",
type = "technology",
name = "follower-robot-count-19",
upgrade = "true",
prerequisites = { "follower-robot-count-18" },
unit = {
count = 2400,
time = 30,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/follower-robots.png",
effects = { {
modifier = 10,
type = "maximum-following-robots-count"
} }
},
["basic-electric-discharge-defense-equipment"] = {
type = "technology",
name = "basic-electric-discharge-defense-equipment",
order = "g-o",
prerequisites = { "armor-making-3", "alien-technology" },
unit = {
time = 30,
count = 100,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 }, { "alien-science-pack", 1 } }
},
icon = "__base__/graphics/technology/basic-electric-discharge-defense-equipment.png",
effects = { {
recipe = "basic-electric-discharge-defense-equipment",
type = "unlock-recipe"
}, {
recipe = "basic-electric-discharge-defense-remote",
type = "unlock-recipe"
} }
},
logistics = {
type = "technology",
name = "logistics",
order = "a-f-a",
unit = {
time = 15,
count = 20,
ingredients = { { "science-pack-1", 1 } }
},
icon = "__base__/graphics/technology/logistics.png",
effects = { {
recipe = "basic-transport-belt-to-ground",
type = "unlock-recipe"
}, {
recipe = "fast-inserter",
type = "unlock-recipe"
}, {
recipe = "basic-splitter",
type = "unlock-recipe"
} }
},
flammables = {
type = "technology",
name = "flammables",
prerequisites = { "oil-processing" },
order = "e-c-a",
icon = "__base__/graphics/technology/flammables.png",
unit = {
time = 15,
count = 60,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
}
},
["combat-robot-damage-2"] = {
order = "e-p-d",
type = "technology",
name = "combat-robot-damage-2",
upgrade = "true",
prerequisites = { "combat-robot-damage-1" },
unit = {
time = 30,
count = 200,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/combat-robot-damage.png",
effects = { {
type = "ammo-damage",
modifier = "0.15",
ammo_category = "combat-robot-laser"
} }
},
["battery-equipment"] = {
type = "technology",
name = "battery-equipment",
order = "g-i-a",
prerequisites = { "armor-making-3", "battery" },
unit = {
time = 15,
count = 50,
ingredients = { { "science-pack-1", 1 }, { "science-pack-2", 1 } }
},
icon = "__base__/graphics/technology/battery-equipment.png",
effects = { {
recipe = "battery-equipment",
type = "unlock-recipe"
} }
},
["logistic-robot-speed-5"] = {
order = "c-k-f-e",
type = "technology",
name = "logistic-robot-speed-5",
upgrade = "true",
prerequisites = { "logistic-robot-speed-4" },
unit = {
time = 60,
count = 500,
ingredients = { { "alien-science-pack", 1 }, { "science-pack-1", 1 }, { "science-pack-2", 1 }, { "science-pack-3", 1 } }
},
icon = "__base__/graphics/technology/logistic-robot-speed.png",
effects = { {
modifier = "0.65",
type = "logistic-robot-speed"
} }
}
},
car = {
car = {
corpse = "medium-remnants",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 42,
offset_deviation = { { -0.7, -1 }, { 0.7, 1 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
collision_box = { { -0.7, -1 }, { 0.7, 1 } },
pictures = {
axially_symmetrical = false,
frame_width = 130,
filename = "__base__/graphics/entity/car/car-sheet.png",
line_length = 8,
direction_count = 64,
shift = { 0.5, 0 },
frame_height = 93
},
burner = {
fuel_inventory_size = 1,
smoke = { {
deviation = { 0.25, 0.25 },
slow_down_factor = 0.9,
starting_frame_speed_deviation = 5,
starting_frame_deviation = 5,
name = "smoke",
position = { 0, 1.5 },
starting_frame_speed = 0,
starting_frame = 3,
frequency = 50
} },
effectivity = 1
},
inventory_size = 80,
selection_box = { { -0.7, -1 }, { 0.7, 1 } },
acceleration_per_energy = 2e-07,
weight = 50,
close_sound = {
filename = "__base__/sound/car-door-close.ogg",
volume = 0.7
},
open_sound = {
filename = "__base__/sound/car-door-open.ogg",
volume = 0.7
},
icon = "__base__/graphics/icons/car.png",
light = { {
type = "oriented",
intensity = 0.6,
picture = {
filename = "__core__/graphics/light-cone.png",
scale = 2,
priority = "medium",
height = 200,
width = 200
},
shift = { -0.6, -14 },
minimum_darkness = 0.3,
size = 2
}, {
type = "oriented",
intensity = 0.6,
picture = {
filename = "__core__/graphics/light-cone.png",
scale = 2,
priority = "medium",
height = 200,
width = 200
},
shift = { 0.6, -14 },
minimum_darkness = 0.3,
size = 2
} },
friction = 0.005,
type = "car",
working_sound = {
match_speed_to_activity = true,
activate_sound = {
filename = "__base__/sound/car-engine-start.ogg",
volume = 0.6
},
sound = {
filename = "__base__/sound/car-engine.ogg",
volume = 0.6
},
deactivate_sound = {
filename = "__base__/sound/car-engine-stop.ogg",
volume = 0.6
}
},
sound_minimum_speed = 0.2,
crash_trigger = {
sound = { {
filename = "__base__/sound/car-crash.ogg",
volume = 0.8
} },
type = "play-sound"
},
stop_trigger = { {
sound = { {
filename = "__base__/sound/car-breaks.ogg",
volume = 0.6
} },
type = "play-sound"
} },
stop_trigger_speed = 0.2,
minable = {
mining_time = 1,
result = "car"
},
flags = { "pushable", "placeable-neutral", "player-creation" },
rotation_speed = 0.015,
name = "car",
resistances = { {
percent = 50,
type = "fire"
} },
breaking_speed = 0.002,
max_health = 500,
consumption = "600kW",
dying_explosion = "huge-explosion"
}
},
font = {
["default-bold"] = {
size = 14,
type = "font",
name = "default-bold",
from = "default-bold"
},
["default-game"] = {
type = "font",
name = "default-game",
from = "default",
border_color = {},
border = 1,
size = 18
},
default = {
size = 14,
type = "font",
name = "default",
from = "default"
},
["default-button"] = {
size = 18,
type = "font",
name = "default-button",
from = "default-bold"
},
["default-frame"] = {
size = 18,
type = "font",
name = "default-frame",
from = "default-bold"
},
["default-listbox"] = {
size = 16,
type = "font",
name = "default-listbox",
from = "default-bold"
},
["default-semibold"] = {
size = 14,
type = "font",
name = "default-semibold",
from = "default-semibold"
},
["scenario-message-dialog"] = {
size = 18,
type = "font",
name = "scenario-message-dialog",
from = "default"
}
},
inserter = {
["long-handed-inserter"] = {
corpse = "small-remnants",
hand_base_picture = {
height = 34,
priority = "extra-high",
filename = "__base__/graphics/entity/long-handed-inserter/long-handed-inserter-hand-base.png",
width = 8
},
fast_replaceable_group = "inserter",
collision_box = { { -0.15, -0.15 }, { 0.15, 0.15 } },
hand_closed_picture = {
height = 41,
priority = "extra-high",
filename = "__base__/graphics/entity/long-handed-inserter/long-handed-inserter-hand-closed.png",
width = 18
},
extension_speed = 0.04,
selection_box = { { -0.4, -0.35 }, { 0.4, 0.45 } },
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 4,
offset_deviation = { { -0.15, -0.15 }, { 0.15, 0.15 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
platform_picture = {
height = 46,
priority = "extra-high",
sheet = "__base__/graphics/entity/long-handed-inserter/long-handed-inserter-platform.png",
width = 46
},
hand_open_shadow = {
height = 41,
priority = "extra-high",
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-open-shadow.png",
width = 18
},
icon = "__base__/graphics/icons/long-handed-inserter.png",
energy_source = {
drain = "0.4kW",
type = "electric",
usage_priority = "secondary-input"
},
hand_closed_shadow = {
height = 41,
priority = "extra-high",
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-closed-shadow.png",
width = 18
},
type = "inserter",
pickup_position = { 0, -2 },
hand_base_shadow = {
height = 34,
priority = "extra-high",
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-base-shadow.png",
width = 8
},
working_sound = {
match_progress_to_activity = true,
sound = { {
filename = "__base__/sound/inserter-long-handed-1.ogg",
volume = 0.75
}, {
filename = "__base__/sound/inserter-long-handed-2.ogg",
volume = 0.75
}, {
filename = "__base__/sound/inserter-long-handed-3.ogg",
volume = 0.75
}, {
filename = "__base__/sound/inserter-long-handed-4.ogg",
volume = 0.75
}, {
filename = "__base__/sound/inserter-long-handed-5.ogg",
volume = 0.75
} }
},
hand_open_picture = {
height = 41,
priority = "extra-high",
filename = "__base__/graphics/entity/long-handed-inserter/long-handed-inserter-hand-open.png",
width = 18
},
hand_size = 1.5,
minable = {
result = "long-handed-inserter",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "placeable-player", "player-creation" },
rotation_speed = 0.02,
name = "long-handed-inserter",
resistances = { {
percent = 90,
type = "fire"
} },
energy_per_movement = 5000,
max_health = 40,
energy_per_rotation = 5000,
insert_position = { 0, 2.35 }
},
["basic-inserter"] = {
corpse = "small-remnants",
hand_base_picture = {
height = 33,
priority = "extra-high",
filename = "__base__/graphics/entity/basic-inserter/basic-inserter-hand-base.png",
width = 8
},
fast_replaceable_group = "inserter",
collision_box = { { -0.15, -0.15 }, { 0.15, 0.15 } },
hand_closed_picture = {
height = 41,
priority = "extra-high",
filename = "__base__/graphics/entity/basic-inserter/basic-inserter-hand-closed.png",
width = 18
},
extension_speed = 0.028,
selection_box = { { -0.4, -0.35 }, { 0.4, 0.45 } },
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 4,
offset_deviation = { { -0.15, -0.15 }, { 0.15, 0.15 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
rotation_speed = 0.014,
icon = "__base__/graphics/icons/basic-inserter.png",
energy_source = {
drain = "0.4kW",
type = "electric",
usage_priority = "secondary-input"
},
platform_picture = {
height = 46,
priority = "extra-high",
sheet = "__base__/graphics/entity/basic-inserter/basic-inserter-platform.png",
width = 46
},
type = "inserter",
hand_open_shadow = {
height = 41,
priority = "extra-high",
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-open-shadow.png",
width = 18
},
insert_position = { 0, 1.35 },
pickup_position = { 0, -1 },
hand_open_picture = {
height = 41,
priority = "extra-high",
filename = "__base__/graphics/entity/basic-inserter/basic-inserter-hand-open.png",
width = 18
},
hand_closed_shadow = {
height = 41,
priority = "extra-high",
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-closed-shadow.png",
width = 18
},
minable = {
result = "basic-inserter",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "placeable-player", "player-creation" },
hand_base_shadow = {
height = 34,
priority = "extra-high",
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-base-shadow.png",
width = 8
},
name = "basic-inserter",
resistances = { {
percent = 90,
type = "fire"
} },
working_sound = {
match_progress_to_activity = true,
sound = { {
filename = "__base__/sound/inserter-basic-1.ogg",
volume = 0.75
}, {
filename = "__base__/sound/inserter-basic-2.ogg",
volume = 0.75
}, {
filename = "__base__/sound/inserter-basic-3.ogg",
volume = 0.75
}, {
filename = "__base__/sound/inserter-basic-4.ogg",
volume = 0.75
}, {
filename = "__base__/sound/inserter-basic-5.ogg",
volume = 0.75
} }
},
max_health = 40,
energy_per_rotation = 5000,
energy_per_movement = 5000
},
["smart-inserter"] = {
corpse = "small-remnants",
hand_base_picture = {
height = 34,
priority = "extra-high",
filename = "__base__/graphics/entity/smart-inserter/smart-inserter-hand-base.png",
width = 8
},
fast_replaceable_group = "inserter",
collision_box = { { -0.15, -0.15 }, { 0.15, 0.15 } },
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 4,
offset_deviation = { { -0.15, -0.15 }, { 0.15, 0.15 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
hand_closed_picture = {
height = 41,
priority = "extra-high",
filename = "__base__/graphics/entity/smart-inserter/smart-inserter-hand-closed.png",
width = 18
},
extension_speed = 0.07,
selection_box = { { -0.4, -0.35 }, { 0.4, 0.45 } },
hand_closed_shadow = {
height = 41,
priority = "extra-high",
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-closed-shadow.png",
width = 18
},
rotation_speed = 0.035,
programmable = true,
platform_picture = {
height = 46,
priority = "extra-high",
sheet = "__base__/graphics/entity/smart-inserter/smart-inserter-platform.png",
width = 46
},
icon = "__base__/graphics/icons/smart-inserter.png",
energy_source = {
drain = "0.4kW",
type = "electric",
usage_priority = "secondary-input"
},
hand_open_shadow = {
height = 41,
priority = "extra-high",
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-open-shadow.png",
width = 18
},
type = "inserter",
pickup_position = { 0, -1 },
uses_arm_movement = "basic-inserter",
hand_base_shadow = {
height = 34,
priority = "extra-high",
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-base-shadow.png",
width = 8
},
hand_open_picture = {
height = 41,
priority = "extra-high",
filename = "__base__/graphics/entity/smart-inserter/smart-inserter-hand-open.png",
width = 18
},
insert_position = { 0, 1.35 },
minable = {
result = "smart-inserter",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "placeable-player", "player-creation" },
filter_count = 5,
name = "smart-inserter",
resistances = { {
percent = 90,
type = "fire"
} },
energy_per_movement = 7000,
max_health = 40,
energy_per_rotation = 7000,
working_sound = {
match_progress_to_activity = true,
sound = { {
filename = "__base__/sound/inserter-fast-1.ogg",
volume = 0.75
}, {
filename = "__base__/sound/inserter-fast-2.ogg",
volume = 0.75
}, {
filename = "__base__/sound/inserter-fast-3.ogg",
volume = 0.75
}, {
filename = "__base__/sound/inserter-fast-4.ogg",
volume = 0.75
}, {
filename = "__base__/sound/inserter-fast-5.ogg",
volume = 0.75
} }
}
},
["fast-inserter"] = {
corpse = "small-remnants",
hand_base_picture = {
height = 34,
priority = "extra-high",
filename = "__base__/graphics/entity/fast-inserter/fast-inserter-hand-base.png",
width = 8
},
fast_replaceable_group = "inserter",
collision_box = { { -0.15, -0.15 }, { 0.15, 0.15 } },
hand_closed_picture = {
height = 41,
priority = "extra-high",
filename = "__base__/graphics/entity/fast-inserter/fast-inserter-hand-closed.png",
width = 18
},
extension_speed = 0.07,
selection_box = { { -0.4, -0.35 }, { 0.4, 0.45 } },
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 4,
offset_deviation = { { -0.15, -0.15 }, { 0.15, 0.15 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
rotation_speed = 0.035,
icon = "__base__/graphics/icons/fast-inserter.png",
energy_source = {
drain = "0.4kW",
type = "electric",
usage_priority = "secondary-input"
},
platform_picture = {
height = 46,
priority = "extra-high",
sheet = "__base__/graphics/entity/fast-inserter/fast-inserter-platform.png",
width = 46
},
type = "inserter",
pickup_position = { 0, -1 },
hand_open_shadow = {
height = 41,
priority = "extra-high",
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-open-shadow.png",
width = 18
},
hand_closed_shadow = {
height = 41,
priority = "extra-high",
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-closed-shadow.png",
width = 18
},
hand_open_picture = {
height = 41,
priority = "extra-high",
filename = "__base__/graphics/entity/fast-inserter/fast-inserter-hand-open.png",
width = 18
},
working_sound = {
match_progress_to_activity = true,
sound = { {
filename = "__base__/sound/inserter-fast-1.ogg",
volume = 0.75
}, {
filename = "__base__/sound/inserter-fast-2.ogg",
volume = 0.75
}, {
filename = "__base__/sound/inserter-fast-3.ogg",
volume = 0.75
}, {
filename = "__base__/sound/inserter-fast-4.ogg",
volume = 0.75
}, {
filename = "__base__/sound/inserter-fast-5.ogg",
volume = 0.75
} }
},
minable = {
result = "fast-inserter",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "placeable-player", "player-creation" },
hand_base_shadow = {
height = 34,
priority = "extra-high",
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-base-shadow.png",
width = 8
},
name = "fast-inserter",
resistances = { {
percent = 90,
type = "fire"
} },
energy_per_movement = 5000,
max_health = 40,
energy_per_rotation = 5000,
insert_position = { 0, 1.35 }
},
["burner-inserter"] = {
corpse = "small-remnants",
hand_base_picture = {
height = 34,
priority = "extra-high",
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-base.png",
width = 8
},
fast_replaceable_group = "inserter",
collision_box = { { -0.15, -0.15 }, { 0.15, 0.15 } },
hand_closed_picture = {
height = 41,
priority = "extra-high",
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-closed.png",
width = 18
},
extension_speed = 0.02,
selection_box = { { -0.4, -0.35 }, { 0.4, 0.45 } },
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 4,
offset_deviation = { { -0.15, -0.15 }, { 0.15, 0.15 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
rotation_speed = 0.01,
icon = "__base__/graphics/icons/burner-inserter.png",
energy_source = {
fuel_inventory_size = 1,
type = "burner",
smoke = { {
frequency = 0.3,
name = "smoke",
deviation = { 0.1, 0.1 }
} },
effectivity = 1
},
platform_picture = {
height = 46,
priority = "extra-high",
sheet = "__base__/graphics/entity/burner-inserter/burner-inserter-platform.png",
width = 46
},
type = "inserter",
hand_open_shadow = {
height = 41,
priority = "extra-high",
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-open-shadow.png",
width = 18
},
insert_position = { 0, 1.35 },
pickup_position = { 0, -1 },
hand_open_picture = {
height = 41,
priority = "extra-high",
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-open.png",
width = 18
},
hand_closed_shadow = {
height = 41,
priority = "extra-high",
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-closed-shadow.png",
width = 18
},
minable = {
result = "burner-inserter",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "placeable-player", "player-creation" },
hand_base_shadow = {
height = 34,
priority = "extra-high",
filename = "__base__/graphics/entity/burner-inserter/burner-inserter-hand-base-shadow.png",
width = 8
},
name = "burner-inserter",
resistances = { {
percent = 90,
type = "fire"
} },
working_sound = {
match_progress_to_activity = true,
sound = { {
filename = "__base__/sound/inserter-basic-1.ogg",
volume = 0.75
}, {
filename = "__base__/sound/inserter-basic-2.ogg",
volume = 0.75
}, {
filename = "__base__/sound/inserter-basic-3.ogg",
volume = 0.75
}, {
filename = "__base__/sound/inserter-basic-4.ogg",
volume = 0.75
}, {
filename = "__base__/sound/inserter-basic-5.ogg",
volume = 0.75
} }
},
max_health = 40,
energy_per_rotation = 100000,
energy_per_movement = 100000
}
},
lamp = {
["small-lamp"] = {
corpse = "small-remnants",
type = "lamp",
light = {
intensity = 0.9,
size = 40
},
picture_on = {
x = 83,
filename = "__base__/graphics/entity/small-lamp/small-lamp.png",
height = 75,
priority = "high",
shift = { 0, -0.1 },
width = 83
},
collision_box = { { -0.15, -0.15 }, { 0.15, 0.15 } },
picture_off = {
filename = "__base__/graphics/entity/small-lamp/small-lamp.png",
height = 75,
priority = "high",
shift = { 0, -0.1 },
width = 83
},
minable = {
result = "small-lamp",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "player-creation" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "small-lamp",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 4,
offset_deviation = { { -0.15, -0.15 }, { 0.15, 0.15 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
energy_usage_per_tick = "5KW",
max_health = 55,
icon = "__base__/graphics/icons/small-lamp.png",
energy_source = {
usage_priority = "secondary-input",
type = "electric"
}
}
},
["ammo-category"] = {
rocket = {
name = "rocket",
type = "ammo-category"
},
electric = {
name = "electric",
type = "ammo-category"
},
melee = {
name = "melee",
type = "ammo-category"
},
["laser-turret"] = {
name = "laser-turret",
type = "ammo-category"
},
["shotgun-shell"] = {
name = "shotgun-shell",
type = "ammo-category"
},
bullet = {
name = "bullet",
type = "ammo-category"
},
biological = {
name = "biological",
type = "ammo-category"
},
["flame-thrower"] = {
name = "flame-thrower",
type = "ammo-category"
},
capsule = {
name = "capsule",
type = "ammo-category"
},
["combat-robot-laser"] = {
name = "combat-robot-laser",
type = "ammo-category"
},
railgun = {
name = "railgun",
type = "ammo-category"
}
},
["item-entity"] = {
["item-on-ground"] = {
flags = { "placeable-off-grid", "not-on-map" },
type = "item-entity",
name = "item-on-ground",
collision_box = { { -0.14, -0.14 }, { 0.14, 0.14 } },
selection_box = { { -0.17, -0.17 }, { 0.17, 0.17 } }
}
},
["ammo-turret"] = {
["gun-turret"] = {
corpse = "small-remnants",
automated_ammo_count = 10,
folded_animation = {
direction_count = 4,
line_length = 1,
axially_symmetrical = false,
frame_width = 171,
filename = "__base__/graphics/entity/gun-turret/gun-turret-extension.png",
shift = { 1.34375, 0.1 },
priority = "medium",
frame_count = 1,
frame_height = 102
},
collision_box = { { -0.4, -0.9 }, { 0.4, 0.9 } },
attack_parameters = {
shell_particle = {
starting_frame_speed_deviation = 0.1,
speed_deviation = 0.03,
name = "shell-particle",
direction_deviation = 0.1,
speed = 0.1,
starting_frame_speed = 0.2,
center = { 0, 0.6 },
creation_distance = 0.6
},
sound = { {
filename = "__base__/sound/gunshot.ogg",
volume = 0.3
} },
range = 17,
projectile_creation_distance = 1.2,
projectile_center = { 0, 0.6 },
cooldown = 6,
ammo_category = "bullet"
},
selection_box = { { -0.5, -1 }, { 0.5, 1 } },
folding_speed = 0.08,
icon = "__base__/graphics/icons/gun-turret.png",
type = "ammo-turret",
folding_animation = {
direction_count = 4,
run_mode = "backward",
axially_symmetrical = false,
frame_width = 171,
filename = "__base__/graphics/entity/gun-turret/gun-turret-extension.png",
shift = { 1.34375, 0.1 },
priority = "medium",
frame_count = 5,
frame_height = 102
},
preparing_animation = {
axially_symmetrical = false,
frame_width = 171,
filename = "__base__/graphics/entity/gun-turret/gun-turret-extension.png",
frame_count = 5,
shift = { 1.34375, 0.1 },
priority = "medium",
direction_count = 4,
frame_height = 102
},
base_picture = {
filename = "__base__/graphics/entity/gun-turret/gun-turret-base.png",
height = 28,
priority = "high",
shift = { 0, 0.475 },
width = 43
},
prepared_animation = {
frame_height = 107,
line_length = 8,
axially_symmetrical = false,
frame_width = 178,
filename = "__base__/graphics/entity/gun-turret/gun-turret.png",
shift = { 1.34375, 0.13125 },
priority = "medium",
frame_count = 1,
direction_count = 64
},
minable = {
mining_time = 0.5,
result = "gun-turret"
},
flags = { "placeable-player", "player-creation" },
rotation_speed = 0.015,
name = "gun-turret",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 21,
offset_deviation = { { -0.4, -0.9 }, { 0.4, 0.9 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
inventory_size = 1,
max_health = 200,
preparing_speed = 0.08,
dying_explosion = "huge-explosion"
}
},
unit = {
["big-biter"] = {
corpse = "big-biter-corpse",
sticker_box = { { -0.6, -0.8 }, { 0.6, 0 } },
order = "b-b-c",
collision_box = { { -0.4, -0.4 }, { 0.4, 0.4 } },
attack_parameters = {
animation = {
axially_symmetrical = false,
frame_width = 279,
stripes = { {
height_in_frames = 8,
width_in_frames = 6,
filename = "__base__/graphics/entity/big-biter/big-biter-attack-1.png"
}, {
height_in_frames = 8,
width_in_frames = 5,
filename = "__base__/graphics/entity/big-biter/big-biter-attack-2.png"
}, {
height_in_frames = 8,
width_in_frames = 6,
filename = "__base__/graphics/entity/big-biter/big-biter-attack-3.png"
}, {
height_in_frames = 8,
width_in_frames = 5,
filename = "__base__/graphics/entity/big-biter/big-biter-attack-4.png"
} },
shift = { 1.74609, -0.644531 },
direction_count = 16,
frame_count = 11,
frame_height = 184
},
ammo_type = {
target_type = "entity",
action = {
action_delivery = {
target_effects = {
damage = {
type = "physical",
amount = 30
},
type = "damage"
},
type = "instant"
},
type = "direct"
},
category = "melee"
},
sound = { {
filename = "__base__/sound/creatures/biter-roar-long-1.ogg",
volume = 0.8
}, {
filename = "__base__/sound/creatures/biter-roar-long-2.ogg",
volume = 0.8
} },
cooldown = 35,
range = 1.5,
ammo_category = "melee"
},
selection_box = { { -0.7, -1.5 }, { 0.7, 0.3 } },
movement_speed = 0.17,
icon = "__base__/graphics/icons/creeper.png",
type = "unit",
subgroup = "enemies",
run_animation = {
axially_symmetrical = false,
frame_width = 169,
direction_count = 16,
stripes = { {
height_in_frames = 16,
width_in_frames = 8,
filename = "__base__/graphics/entity/big-biter/big-biter-run-1.png"
}, {
height_in_frames = 16,
width_in_frames = 8,
filename = "__base__/graphics/entity/big-biter/big-biter-run-2.png"
} },
shift = { 0.714844, -0.304688 },
frame_count = 16,
still_frame = 4,
frame_height = 117
},
vision_distance = 30,
dying_sound = { {
filename = "__base__/sound/creatures/creeper-death-1.ogg",
volume = 0.7
}, {
filename = "__base__/sound/creatures/creeper-death-2.ogg",
volume = 0.7
}, {
filename = "__base__/sound/creatures/creeper-death-3.ogg",
volume = 0.7
}, {
filename = "__base__/sound/creatures/creeper-death-4.ogg",
volume = 0.7
} },
flags = { "placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air", "not-repairable" },
healing_per_tick = 0.02,
name = "big-biter",
resistances = { {
decrease = 8,
type = "physical"
}, {
percent = 10,
type = "explosion"
} },
pollution_to_join_attack = 1000,
max_health = 375,
distance_per_frame = 0.2,
distraction_cooldown = 300
},
["medium-biter"] = {
corpse = "medium-biter-corpse",
sticker_box = { { -0.3, -0.5 }, { 0.3, 0.1 } },
order = "b-b-b",
collision_box = { { -0.3, -0.3 }, { 0.3, 0.3 } },
attack_parameters = {
animation = {
axially_symmetrical = false,
frame_width = 200,
stripes = { {
height_in_frames = 8,
width_in_frames = 6,
filename = "__base__/graphics/entity/medium-biter/medium-biter-attack-1.png"
}, {
height_in_frames = 8,
width_in_frames = 5,
filename = "__base__/graphics/entity/medium-biter/medium-biter-attack-2.png"
}, {
height_in_frames = 8,
width_in_frames = 6,
filename = "__base__/graphics/entity/medium-biter/medium-biter-attack-3.png"
}, {
height_in_frames = 8,
width_in_frames = 5,
filename = "__base__/graphics/entity/medium-biter/medium-biter-attack-4.png"
} },
shift = { 1.25719, -0.464063 },
direction_count = 16,
frame_count = 11,
frame_height = 132
},
ammo_type = {
target_type = "entity",
action = {
action_delivery = {
target_effects = {
damage = {
type = "physical",
amount = 15
},
type = "damage"
},
type = "instant"
},
type = "direct"
},
category = "melee"
},
sound = { {
filename = "__base__/sound/creatures/biter-roar-medium-1.ogg",
volume = 0.8
}, {
filename = "__base__/sound/creatures/biter-roar-medium-2.ogg",
volume = 0.8
} },
cooldown = 35,
range = 1,
ammo_category = "melee"
},
selection_box = { { -0.7, -1.5 }, { 0.7, 0.3 } },
movement_speed = 0.185,
icon = "__base__/graphics/icons/creeper.png",
type = "unit",
subgroup = "enemies",
run_animation = {
axially_symmetrical = false,
frame_width = 122,
filename = "__base__/graphics/entity/medium-biter/medium-biter-run.png",
direction_count = 16,
shift = { 0.514688, -0.219375 },
frame_count = 16,
still_frame = 4,
frame_height = 84
},
vision_distance = 30,
dying_sound = { {
filename = "__base__/sound/creatures/creeper-death-1.ogg",
volume = 0.7
}, {
filename = "__base__/sound/creatures/creeper-death-2.ogg",
volume = 0.7
}, {
filename = "__base__/sound/creatures/creeper-death-3.ogg",
volume = 0.7
}, {
filename = "__base__/sound/creatures/creeper-death-4.ogg",
volume = 0.7
} },
flags = { "placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air", "not-repairable" },
healing_per_tick = 0.01,
name = "medium-biter",
resistances = { {
decrease = 4,
type = "physical"
}, {
percent = 10,
type = "explosion"
} },
pollution_to_join_attack = 1000,
max_health = 75,
distance_per_frame = 0.15,
distraction_cooldown = 300
},
["small-biter"] = {
corpse = "small-biter-corpse",
order = "b-b-a",
collision_box = { { -0.2, -0.2 }, { 0.2, 0.2 } },
attack_parameters = {
animation = {
axially_symmetrical = false,
frame_width = 139,
filename = "__base__/graphics/entity/small-biter/small-biter-attack.png",
shift = { 0.84375, -0.3125 },
direction_count = 16,
frame_count = 11,
frame_height = 93
},
ammo_type = {
target_type = "entity",
action = {
action_delivery = {
target_effects = {
damage = {
type = "physical",
amount = 6
},
type = "damage"
},
type = "instant"
},
type = "direct"
},
category = "melee"
},
sound = { {
filename = "__base__/sound/creatures/biter-roar-short-1.ogg",
volume = 0.8
}, {
filename = "__base__/sound/creatures/biter-roar-short-2.ogg",
volume = 0.8
}, {
filename = "__base__/sound/creatures/biter-roar-short-3.ogg",
volume = 0.8
} },
cooldown = 35,
range = 0.5,
ammo_category = "melee"
},
selection_box = { { -0.4, -0.7 }, { 0.7, 0.4 } },
movement_speed = 0.2,
icon = "__base__/graphics/icons/creeper.png",
type = "unit",
subgroup = "enemies",
vision_distance = 30,
run_animation = {
axially_symmetrical = false,
frame_width = 86,
filename = "__base__/graphics/entity/small-biter/small-biter-run.png",
direction_count = 16,
shift = { 0.359375, -0.15625 },
frame_count = 16,
still_frame = 4,
frame_height = 59
},
flags = { "placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air" },
healing_per_tick = 0.01,
name = "small-biter",
dying_sound = { {
filename = "__base__/sound/creatures/creeper-death-1.ogg",
volume = 0.7
}, {
filename = "__base__/sound/creatures/creeper-death-2.ogg",
volume = 0.7
}, {
filename = "__base__/sound/creatures/creeper-death-3.ogg",
volume = 0.7
}, {
filename = "__base__/sound/creatures/creeper-death-4.ogg",
volume = 0.7
} },
pollution_to_join_attack = 200,
max_health = 15,
distance_per_frame = 0.1,
distraction_cooldown = 300
}
},
["noise-layer"] = {
grass = {
name = "grass",
type = "noise-layer"
},
grass1 = {
name = "grass1",
type = "noise-layer"
},
["iron-ore"] = {
name = "iron-ore",
type = "noise-layer"
},
["dirt-dark"] = {
name = "dirt-dark",
type = "noise-layer"
},
["brown-cane"] = {
name = "brown-cane",
type = "noise-layer"
},
["garballo-mini"] = {
name = "garballo-mini",
type = "noise-layer"
},
coral = {
name = "coral",
type = "noise-layer"
},
["pita-mini"] = {
name = "pita-mini",
type = "noise-layer"
},
trees = {
name = "trees",
type = "noise-layer"
},
["crude-oil"] = {
name = "crude-oil",
type = "noise-layer"
},
fluff = {
name = "fluff",
type = "noise-layer"
},
["enemy-base"] = {
name = "enemy-base",
type = "noise-layer"
},
stone = {
name = "stone",
type = "noise-layer"
},
coal = {
name = "coal",
type = "noise-layer"
},
garballo = {
name = "garballo",
type = "noise-layer"
},
pita = {
name = "pita",
type = "noise-layer"
},
["sand-dark"] = {
name = "sand-dark",
type = "noise-layer"
},
dirt = {
name = "dirt",
type = "noise-layer"
},
sand = {
name = "sand",
type = "noise-layer"
},
["copper-ore"] = {
name = "copper-ore",
type = "noise-layer"
},
["grass-medium"] = {
name = "grass-medium",
type = "noise-layer"
},
grass2 = {
name = "grass2",
type = "noise-layer"
},
["grass-dry"] = {
name = "grass-dry",
type = "noise-layer"
}
},
["rocket-defense"] = {
["rocket-defense"] = {
corpse = "big-remnants",
type = "rocket-defense",
picture = {
height = 160,
priority = "low",
filename = "__base__/graphics/entity/rocket-defense/rocket-defense.png",
width = 160
},
collision_box = { { -2.4, -2.4 }, { 2.4, 2.4 } },
minable = {
result = "rocket-defense",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-player", "player-creation" },
selection_box = { { -2.5, -2.5 }, { 2.5, 2.5 } },
name = "rocket-defense",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 345,
offset_deviation = { { -2.4, -2.4 }, { 2.4, 2.4 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
max_health = 5000,
icon = "__base__/graphics/icons/rocket-defense.png",
energy_source = {
type = "electric",
usage_priority = "primary-input",
buffer_capacity = "100MJ"
}
}
},
["offshore-pump"] = {
["offshore-pump"] = {
corpse = "small-remnants",
type = "offshore-pump",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 10,
offset_deviation = { { -0.6, -0.3 }, { 0.6, 0.3 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
picture = {
west = {
x = 480,
filename = "__base__/graphics/entity/offshore-pump/offshore-pump.png",
shift = { 1, 0.05 },
priority = "high",
height = 102,
width = 160
},
south = {
x = 320,
filename = "__base__/graphics/entity/offshore-pump/offshore-pump.png",
shift = { 0.9, 0.65 },
priority = "high",
height = 102,
width = 160
},
east = {
x = 160,
filename = "__base__/graphics/entity/offshore-pump/offshore-pump.png",
shift = { 0.9, 0.05 },
priority = "high",
height = 102,
width = 160
},
north = {
filename = "__base__/graphics/entity/offshore-pump/offshore-pump.png",
shift = { 0.9, 0.05 },
priority = "high",
height = 102,
width = 160
}
},
tile_width = 1,
collision_box = { { -0.6, -0.3 }, { 0.6, 0.3 } },
pumping_speed = 1,
minable = {
mining_time = 1,
result = "offshore-pump"
},
flags = { "placeable-neutral", "player-creation", "filter-directions" },
selection_box = { { -1, -1.49 }, { 1, 0.49 } },
name = "offshore-pump",
resistances = { {
percent = 70,
type = "fire"
} },
fluid = "water",
max_health = 80,
icon = "__base__/graphics/icons/offshore-pump.png",
fluid_box = {
pipe_connections = { {
position = { 0, 1 }
} },
base_area = 1,
pipe_covers = {
west = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-west.png",
width = 32
},
south = {
height = 52,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-south.png",
width = 46
},
east = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-east.png",
width = 32
},
north = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-north.png",
width = 44
}
}
}
}
},
["item-subgroup"] = {
other = {
group = "other",
type = "item-subgroup",
name = "other",
order = "z"
},
["energy-pipe-distribution"] = {
group = "logistics",
type = "item-subgroup",
name = "energy-pipe-distribution",
order = "d"
},
belt = {
group = "logistics",
type = "item-subgroup",
name = "belt",
order = "b"
},
["defensive-structure"] = {
group = "combat",
type = "item-subgroup",
name = "defensive-structure",
order = "f"
},
armor = {
group = "combat",
type = "item-subgroup",
name = "armor",
order = "d"
},
["science-pack"] = {
group = "intermediate-products",
type = "item-subgroup",
name = "science-pack",
order = "g"
},
trees = {
group = "environment",
type = "item-subgroup",
name = "trees",
order = "aa"
},
barrel = {
group = "intermediate-products",
type = "item-subgroup",
name = "barrel",
order = "d"
},
inserter = {
group = "logistics",
type = "item-subgroup",
name = "inserter",
order = "c"
},
energy = {
group = "production",
type = "item-subgroup",
name = "energy",
order = "b"
},
module = {
group = "production",
type = "item-subgroup",
name = "module",
order = "f"
},
["smelting-machine"] = {
group = "production",
type = "item-subgroup",
name = "smelting-machine",
order = "d"
},
wrecks = {
group = "environment",
type = "item-subgroup",
name = "wrecks",
order = "e"
},
corpses = {
group = "environment",
type = "item-subgroup",
name = "corpses",
order = "c"
},
ammo = {
group = "combat",
type = "item-subgroup",
name = "ammo",
order = "b"
},
["raw-material"] = {
group = "intermediate-products",
type = "item-subgroup",
name = "raw-material",
order = "c"
},
storage = {
group = "logistics",
type = "item-subgroup",
name = "storage",
order = "a"
},
gun = {
group = "combat",
type = "item-subgroup",
name = "gun",
order = "a"
},
tool = {
group = "production",
type = "item-subgroup",
name = "tool",
order = "a"
},
capsule = {
group = "combat",
type = "item-subgroup",
name = "capsule",
order = "c"
},
grass = {
group = "environment",
type = "item-subgroup",
name = "grass",
order = "b"
},
["intermediate-product"] = {
group = "intermediate-products",
type = "item-subgroup",
name = "intermediate-product",
order = "e"
},
["extraction-machine"] = {
group = "production",
type = "item-subgroup",
name = "extraction-machine",
order = "c"
},
["raw-resource"] = {
group = "intermediate-products",
type = "item-subgroup",
name = "raw-resource",
order = "b"
},
remnants = {
group = "environment",
type = "item-subgroup",
name = "remnants",
order = "d"
},
equipment = {
group = "combat",
type = "item-subgroup",
name = "equipment",
order = "e"
},
["circuit-network"] = {
group = "intermediate-products",
type = "item-subgroup",
name = "circuit-network",
order = "f"
},
enemies = {
group = "enemies",
type = "item-subgroup",
name = "enemies",
order = "a"
},
["production-machine"] = {
group = "production",
type = "item-subgroup",
name = "production-machine",
order = "e"
},
["logistic-network"] = {
group = "logistics",
type = "item-subgroup",
name = "logistic-network",
order = "f"
},
creatures = {
group = "environment",
type = "item-subgroup",
name = "creatures",
order = "a"
},
fluid = {
group = "intermediate-products",
type = "item-subgroup",
name = "fluid",
order = "a"
},
transport = {
group = "logistics",
type = "item-subgroup",
name = "transport",
order = "e"
}
},
["storage-tank"] = {
["storage-tank"] = {
corpse = "medium-remnants",
type = "storage-tank",
picture = {
shift = { 0.6875, 0.109375 },
width = 140,
height = 115,
priority = "extra-high",
frames = 2,
sheet = "__base__/graphics/entity/storage-tank/storage-tank.png"
},
collision_box = { { -1.3, -1.3 }, { 1.3, 1.3 } },
minable = {
result = "storage-tank",
hardness = 0.2,
mining_time = 3
},
flags = { "placeable-player", "player-creation" },
selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
name = "storage-tank",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 101,
offset_deviation = { { -1.3, -1.3 }, { 1.3, 1.3 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
working_sound = {
max_sounds_per_type = 3,
sound = {
filename = "__base__/sound/storage-tank.ogg",
volume = 0.8
},
apparent_volume = 1.5
},
max_health = 500,
icon = "__base__/graphics/icons/storage-tank.png",
fluid_box = {
pipe_connections = { {
position = { -1, -2 }
}, {
position = { 2, 1 }
}, {
position = { 1, 2 }
}, {
position = { -2, -1 }
} },
base_area = 250,
pipe_covers = {
west = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-west.png",
width = 32
},
south = {
height = 52,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-south.png",
width = 46
},
east = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-east.png",
width = 32
},
north = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-north.png",
width = 44
}
}
}
}
},
["assembling-machine"] = {
["assembling-machine-3"] = {
corpse = "big-remnants",
crafting_categories = { "crafting", "advanced-crafting", "crafting-with-fluid" },
fast_replaceable_group = "assembling-machine",
collision_box = { { -1.2, -1.2 }, { 1.2, 1.2 } },
ingredient_count = 4,
selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
allowed_effects = { "consumption", "speed", "productivity", "pollution" },
icon = "__base__/graphics/icons/assembling-machine-3.png",
energy_source = {
emissions = 0.0085714285714286,
type = "electric",
usage_priority = "secondary-input"
},
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 86,
offset_deviation = { { -1.2, -1.2 }, { 1.2, 1.2 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
type = "assembling-machine",
module_slots = 4,
animation = {
frame_width = 142,
filename = "__base__/graphics/entity/assembling-machine-3/assembling-machine-3.png",
shift = { 0.84, -0.09 },
line_length = 8,
priority = "high",
frame_count = 32,
frame_height = 113
},
energy_usage = "210kW",
crafting_speed = 1.25,
working_sound = {
idle_sound = {
filename = "__base__/sound/idle1.ogg",
volume = 0.6
},
sound = { {
filename = "__base__/sound/assembling-machine-t3-1.ogg",
volume = 0.8
}, {
filename = "__base__/sound/assembling-machine-t3-2.ogg",
volume = 0.8
} },
apparent_volume = 1.5
},
minable = {
result = "assembling-machine-3",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "placeable-player", "player-creation" },
fluid_boxes = { {
pipe_covers = {
west = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-west.png",
width = 32
},
south = {
height = 52,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-south.png",
width = 46
},
east = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-east.png",
width = 32
},
north = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-north.png",
width = 44
}
},
base_level = -1,
production_type = "input",
pipe_connections = { {
position = { 0, -2 },
type = "input"
} },
base_area = 10,
pipe_picture = {
west = {
filename = "__base__/graphics/entity/assembling-machine-3/pipe-west.png",
height = 45,
priority = "extra-high",
shift = { 0.8125, 0 },
width = 40
},
south = {
filename = "__base__/graphics/entity/assembling-machine-3/pipe-south.png",
height = 45,
priority = "extra-high",
shift = { 0.03125, -1.0625 },
width = 40
},
east = {
filename = "__base__/graphics/entity/assembling-machine-3/pipe-east.png",
height = 45,
priority = "extra-high",
shift = { -0.78125, 0.15625 },
width = 40
},
north = {
filename = "__base__/graphics/entity/assembling-machine-3/pipe-north.png",
height = 45,
priority = "extra-high",
shift = { 0.03125, 0.3125 },
width = 40
}
}
}, {
pipe_covers = {
west = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-west.png",
width = 32
},
south = {
height = 52,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-south.png",
width = 46
},
east = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-east.png",
width = 32
},
north = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-north.png",
width = 44
}
},
base_level = 1,
production_type = "output",
pipe_connections = { {
position = { 0, 2 },
type = "output"
} },
base_area = 10,
pipe_picture = {
west = {
filename = "__base__/graphics/entity/assembling-machine-3/pipe-west.png",
height = 45,
priority = "extra-high",
shift = { 0.8125, 0 },
width = 40
},
south = {
filename = "__base__/graphics/entity/assembling-machine-3/pipe-south.png",
height = 45,
priority = "extra-high",
shift = { 0.03125, -1.0625 },
width = 40
},
east = {
filename = "__base__/graphics/entity/assembling-machine-3/pipe-east.png",
height = 45,
priority = "extra-high",
shift = { -0.78125, 0.15625 },
width = 40
},
north = {
filename = "__base__/graphics/entity/assembling-machine-3/pipe-north.png",
height = 45,
priority = "extra-high",
shift = { 0.03125, 0.3125 },
width = 40
}
}
},
off_when_no_fluid_recipe = true
},
name = "assembling-machine-3",
resistances = { {
percent = 70,
type = "fire"
} },
open_sound = {
filename = "__base__/sound/machine-open.ogg",
volume = 0.85
},
max_health = 300,
close_sound = {
filename = "__base__/sound/machine-close.ogg",
volume = 0.75
},
dying_explosion = "huge-explosion"
},
["assembling-machine-1"] = {
corpse = "big-remnants",
crafting_categories = { "crafting" },
fast_replaceable_group = "assembling-machine",
collision_box = { { -1.2, -1.2 }, { 1.2, 1.2 } },
ingredient_count = 2,
selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
icon = "__base__/graphics/icons/assembling-machine-1.png",
energy_source = {
emissions = 0.033333333333333,
type = "electric",
usage_priority = "secondary-input"
},
type = "assembling-machine",
animation = {
frame_width = 99,
filename = "__base__/graphics/entity/assembling-machine-1/assembling-machine-1.png",
shift = { 0.25, -0.1 },
line_length = 8,
priority = "high",
frame_count = 32,
frame_height = 102
},
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 86,
offset_deviation = { { -1.2, -1.2 }, { 1.2, 1.2 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
working_sound = {
idle_sound = {
filename = "__base__/sound/idle1.ogg",
volume = 0.6
},
sound = { {
filename = "__base__/sound/assembling-machine-t1-1.ogg",
volume = 0.8
}, {
filename = "__base__/sound/assembling-machine-t1-2.ogg",
volume = 0.8
} },
apparent_volume = 1.5
},
crafting_speed = 0.5,
minable = {
result = "assembling-machine-1",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "placeable-player", "player-creation" },
open_sound = {
filename = "__base__/sound/machine-open.ogg",
volume = 0.85
},
name = "assembling-machine-1",
resistances = { {
percent = 70,
type = "fire"
} },
energy_usage = "90kW",
max_health = 200,
close_sound = {
filename = "__base__/sound/machine-close.ogg",
volume = 0.75
},
dying_explosion = "huge-explosion"
},
["chemical-plant"] = {
corpse = "big-remnants",
crafting_categories = { "chemistry" },
crafting_speed = 1.25,
collision_box = { { -1.4, -1.4 }, { 1.4, 1.4 } },
ingredient_count = 4,
selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
allowed_effects = { "consumption", "speed", "productivity", "pollution" },
icon = "__base__/graphics/icons/chemical-plant.png",
energy_source = {
emissions = 0.0085714285714286,
type = "electric",
usage_priority = "secondary-input"
},
type = "assembling-machine",
animation = {
west = {
x = 156,
filename = "__base__/graphics/entity/chemical-plant/chemical-plant.png",
shift = { 0.5, -0.078125 },
frame_count = 1,
frame_height = 141,
frame_width = 156
},
south = {
x = 312,
filename = "__base__/graphics/entity/chemical-plant/chemical-plant.png",
shift = { 0.5, -0.078125 },
frame_count = 1,
frame_height = 141,
frame_width = 156
},
east = {
x = 468,
filename = "__base__/graphics/entity/chemical-plant/chemical-plant.png",
shift = { 0.5, -0.078125 },
frame_count = 1,
frame_height = 141,
frame_width = 156
},
north = {
frame_width = 156,
filename = "__base__/graphics/entity/chemical-plant/chemical-plant.png",
shift = { 0.5, -0.078125 },
frame_count = 1,
frame_height = 141
}
},
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 117,
offset_deviation = { { -1.4, -1.4 }, { 1.4, 1.4 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
working_sound = {
idle_sound = {
filename = "__base__/sound/idle1.ogg",
volume = 0.6
},
sound = { {
filename = "__base__/sound/chemical-plant.ogg",
volume = 0.8
} },
apparent_volume = 1.5
},
minable = {
result = "chemical-plant",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "placeable-player", "player-creation" },
energy_usage = "210kW",
name = "chemical-plant",
fluid_boxes = { {
pipe_covers = {
west = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-west.png",
width = 32
},
south = {
height = 52,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-south.png",
width = 46
},
east = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-east.png",
width = 32
},
north = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-north.png",
width = 44
}
},
base_level = -1,
production_type = "input",
pipe_connections = { {
position = { -1, -2 },
type = "input"
} },
base_area = 10
}, {
pipe_covers = {
west = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-west.png",
width = 32
},
south = {
height = 52,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-south.png",
width = 46
},
east = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-east.png",
width = 32
},
north = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-north.png",
width = 44
}
},
base_level = -1,
production_type = "input",
pipe_connections = { {
position = { 1, -2 },
type = "input"
} },
base_area = 10
}, {
production_type = "output",
pipe_connections = { {
position = { -1, 2 }
} },
pipe_covers = {
west = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-west.png",
width = 32
},
south = {
height = 52,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-south.png",
width = 46
},
east = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-east.png",
width = 32
},
north = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-north.png",
width = 44
}
},
base_level = 1
}, {
production_type = "output",
pipe_connections = { {
position = { 1, 2 }
} },
pipe_covers = {
west = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-west.png",
width = 32
},
south = {
height = 52,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-south.png",
width = 46
},
east = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-east.png",
width = 32
},
north = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-north.png",
width = 44
}
},
base_level = 1
} },
working_visualisations = { {
west_position = { -0.3, 0.02 },
north_position = { 0.94, -0.73 },
south_position = { -0.97, -1.47 },
east_position = { 0.05, -1.46 },
animation = {
frame_count = 35,
filename = "__base__/graphics/entity/chemical-plant/boiling-green-patch.png",
animation_speed = 0.15,
frame_height = 12,
frame_width = 17
}
}, {
west_position = { -0.3, 0.55 },
south_animation = {
x = 42,
filename = "__base__/graphics/entity/chemical-plant/boiling-window-green-patch.png",
frame_height = 10,
frame_width = 21,
frame_count = 1
},
north_position = { 1.4, -0.23 },
south_position = { -1, -1 },
east_position = { 0.05, -0.96 },
west_animation = {
x = 21,
filename = "__base__/graphics/entity/chemical-plant/boiling-window-green-patch.png",
frame_height = 10,
frame_width = 21,
frame_count = 1
},
north_animation = {
frame_height = 10,
frame_count = 1,
filename = "__base__/graphics/entity/chemical-plant/boiling-window-green-patch.png",
frame_width = 21
}
} },
max_health = 300,
module_slots = 2,
dying_explosion = "huge-explosion"
},
["oil-refinery"] = {
corpse = "big-remnants",
crafting_categories = { "oil-processing" },
crafting_speed = 1,
has_backer_name = true,
collision_box = { { -2.4, -2.4 }, { 2.4, 2.4 } },
ingredient_count = 4,
selection_box = { { -2.5, -2.5 }, { 2.5, 2.5 } },
pipe_covers = {
west = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-west.png",
width = 32
},
south = {
height = 52,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-south.png",
width = 46
},
east = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-east.png",
width = 32
},
north = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-north.png",
width = 44
}
},
allowed_effects = { "consumption", "speed", "productivity", "pollution" },
icon = "__base__/graphics/icons/oil-refinery.png",
energy_source = {
emissions = 0.0085714285714286,
type = "electric",
usage_priority = "secondary-input"
},
type = "assembling-machine",
animation = {
west = {
x = 1011,
filename = "__base__/graphics/entity/oil-refinery/oil-refinery.png",
shift = { 2.515625, 0.484375 },
frame_count = 1,
frame_height = 255,
frame_width = 337
},
south = {
x = 674,
filename = "__base__/graphics/entity/oil-refinery/oil-refinery.png",
shift = { 2.515625, 0.484375 },
frame_count = 1,
frame_height = 255,
frame_width = 337
},
east = {
x = 337,
filename = "__base__/graphics/entity/oil-refinery/oil-refinery.png",
shift = { 2.515625, 0.484375 },
frame_count = 1,
frame_height = 255,
frame_width = 337
},
north = {
frame_width = 337,
filename = "__base__/graphics/entity/oil-refinery/oil-refinery.png",
shift = { 2.515625, 0.484375 },
frame_count = 1,
frame_height = 255
}
},
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 345,
offset_deviation = { { -2.4, -2.4 }, { 2.4, 2.4 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
working_visualisations = { {
west_position = { 1.8437, -1.2 },
north_position = { 1.03125, -1.55 },
south_position = { -1.875, -2 },
east_position = { -1.65625, -1.3 },
animation = {
frame_count = 29,
filename = "__base__/graphics/entity/oil-refinery/oil-refinery-fire.png",
frame_height = 35,
scale = 1.5,
shift = { 0, -0.5625 },
run_mode = "backward",
frame_width = 16
},
light = {
intensity = 0.4,
size = 6
}
} },
minable = {
mining_time = 1,
result = "oil-refinery"
},
flags = { "placeable-neutral", "player-creation" },
working_sound = {
idle_sound = {
filename = "__base__/sound/idle1.ogg",
volume = 0.6
},
sound = {
filename = "__base__/sound/oil-refinery.ogg"
},
apparent_volume = 2.5
},
name = "oil-refinery",
fluid_boxes = { {
pipe_covers = {
west = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-west.png",
width = 32
},
south = {
height = 52,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-south.png",
width = 46
},
east = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-east.png",
width = 32
},
north = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-north.png",
width = 44
}
},
base_level = -1,
production_type = "input",
pipe_connections = { {
position = { -1, 3 },
type = "input"
} },
base_area = 10
}, {
pipe_covers = {
west = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-west.png",
width = 32
},
south = {
height = 52,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-south.png",
width = 46
},
east = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-east.png",
width = 32
},
north = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-north.png",
width = 44
}
},
base_level = -1,
production_type = "input",
pipe_connections = { {
position = { 1, 3 },
type = "input"
} },
base_area = 10
}, {
production_type = "output",
pipe_connections = { {
position = { -2, -3 }
} },
pipe_covers = {
west = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-west.png",
width = 32
},
south = {
height = 52,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-south.png",
width = 46
},
east = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-east.png",
width = 32
},
north = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-north.png",
width = 44
}
},
base_level = 1
}, {
production_type = "output",
pipe_connections = { {
position = { 0, -3 }
} },
pipe_covers = {
west = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-west.png",
width = 32
},
south = {
height = 52,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-south.png",
width = 46
},
east = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-east.png",
width = 32
},
north = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-north.png",
width = 44
}
},
base_level = 1
}, {
production_type = "output",
pipe_connections = { {
position = { 2, -3 }
} },
pipe_covers = {
west = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-west.png",
width = 32
},
south = {
height = 52,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-south.png",
width = 46
},
east = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-east.png",
width = 32
},
north = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-north.png",
width = 44
}
},
base_level = 1
} },
energy_usage = "420kW",
max_health = 300,
module_slots = 2,
dying_explosion = "huge-explosion"
},
["assembling-machine-2"] = {
corpse = "big-remnants",
crafting_categories = { "crafting", "advanced-crafting", "crafting-with-fluid" },
fast_replaceable_group = "assembling-machine",
collision_box = { { -1.2, -1.2 }, { 1.2, 1.2 } },
ingredient_count = 4,
selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
allowed_effects = { "consumption", "speed", "productivity", "pollution" },
icon = "__base__/graphics/icons/assembling-machine-2.png",
energy_source = {
emissions = 0.016,
type = "electric",
usage_priority = "secondary-input"
},
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 86,
offset_deviation = { { -1.2, -1.2 }, { 1.2, 1.2 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
type = "assembling-machine",
module_slots = 2,
animation = {
frame_width = 113,
filename = "__base__/graphics/entity/assembling-machine-2/assembling-machine-2.png",
shift = { 0.4, -0.06 },
line_length = 8,
priority = "high",
frame_count = 32,
frame_height = 99
},
energy_usage = "150kW",
crafting_speed = 0.75,
working_sound = {
idle_sound = {
filename = "__base__/sound/idle1.ogg",
volume = 0.6
},
sound = { {
filename = "__base__/sound/assembling-machine-t2-1.ogg",
volume = 0.8
}, {
filename = "__base__/sound/assembling-machine-t2-2.ogg",
volume = 0.8
} },
apparent_volume = 1.5
},
minable = {
result = "assembling-machine-2",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "placeable-player", "player-creation" },
fluid_boxes = { {
pipe_covers = {
west = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-west.png",
width = 32
},
south = {
height = 52,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-south.png",
width = 46
},
east = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-east.png",
width = 32
},
north = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-north.png",
width = 44
}
},
base_level = -1,
production_type = "input",
pipe_connections = { {
position = { 0, -2 },
type = "input"
} },
base_area = 10,
pipe_picture = {
west = {
filename = "__base__/graphics/entity/assembling-machine-2/pipe-west.png",
height = 40,
priority = "extra-high",
shift = { 0.78125, 0.03125 },
width = 41
},
south = {
filename = "__base__/graphics/entity/assembling-machine-2/pipe-south.png",
height = 40,
priority = "extra-high",
shift = { 0.0625, -1 },
width = 41
},
east = {
filename = "__base__/graphics/entity/assembling-machine-2/pipe-east.png",
height = 40,
priority = "extra-high",
shift = { -0.71875, 0 },
width = 41
},
north = {
filename = "__base__/graphics/entity/assembling-machine-2/pipe-north.png",
height = 40,
priority = "extra-high",
shift = { 0.09375, 0.4375 },
width = 41
}
}
}, {
pipe_covers = {
west = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-west.png",
width = 32
},
south = {
height = 52,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-south.png",
width = 46
},
east = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-east.png",
width = 32
},
north = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-north.png",
width = 44
}
},
base_level = 1,
production_type = "output",
pipe_connections = { {
position = { 0, 2 },
type = "output"
} },
base_area = 10,
pipe_picture = {
west = {
filename = "__base__/graphics/entity/assembling-machine-2/pipe-west.png",
height = 40,
priority = "extra-high",
shift = { 0.78125, 0.03125 },
width = 41
},
south = {
filename = "__base__/graphics/entity/assembling-machine-2/pipe-south.png",
height = 40,
priority = "extra-high",
shift = { 0.0625, -1 },
width = 41
},
east = {
filename = "__base__/graphics/entity/assembling-machine-2/pipe-east.png",
height = 40,
priority = "extra-high",
shift = { -0.71875, 0 },
width = 41
},
north = {
filename = "__base__/graphics/entity/assembling-machine-2/pipe-north.png",
height = 40,
priority = "extra-high",
shift = { 0.09375, 0.4375 },
width = 41
}
}
},
off_when_no_fluid_recipe = true
},
name = "assembling-machine-2",
resistances = { {
percent = 70,
type = "fire"
} },
open_sound = {
filename = "__base__/sound/machine-open.ogg",
volume = 0.85
},
max_health = 250,
close_sound = {
filename = "__base__/sound/machine-close.ogg",
volume = 0.75
},
dying_explosion = "huge-explosion"
}
},
["logistic-container"] = {
["logistic-chest-active-provider"] = {
corpse = "small-remnants",
type = "logistic-container",
inventory_size = 48,
fast_replaceable_group = "container",
picture = {
filename = "__base__/graphics/entity/logistic-chest/logistic-chest-active-provider.png",
height = 32,
priority = "extra-high",
shift = { 0.1, 0 },
width = 38
},
collision_box = { { -0.35, -0.35 }, { 0.35, 0.35 } },
close_sound = {
filename = "__base__/sound/metallic-chest-close.ogg",
volume = 0.7
},
minable = {
result = "logistic-chest-active-provider",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-player", "player-creation" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "logistic-chest-active-provider",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 7,
offset_deviation = { { -0.35, -0.35 }, { 0.35, 0.35 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
logistic_mode = "active-provider",
max_health = 150,
icon = "__base__/graphics/icons/logistic-chest-active-provider.png",
open_sound = {
filename = "__base__/sound/metallic-chest-open.ogg",
volume = 0.65
}
},
["logistic-chest-requester"] = {
corpse = "small-remnants",
type = "logistic-container",
inventory_size = 48,
fast_replaceable_group = "container",
picture = {
filename = "__base__/graphics/entity/logistic-chest/logistic-chest-requester.png",
height = 32,
priority = "extra-high",
shift = { 0.1, 0 },
width = 38
},
collision_box = { { -0.35, -0.35 }, { 0.35, 0.35 } },
close_sound = {
filename = "__base__/sound/metallic-chest-close.ogg",
volume = 0.7
},
minable = {
result = "logistic-chest-requester",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-player", "player-creation" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "logistic-chest-requester",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 7,
offset_deviation = { { -0.35, -0.35 }, { 0.35, 0.35 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
logistic_mode = "requester",
max_health = 150,
icon = "__base__/graphics/icons/logistic-chest-requester.png",
open_sound = {
filename = "__base__/sound/metallic-chest-open.ogg",
volume = 0.65
}
},
["logistic-chest-storage"] = {
corpse = "small-remnants",
type = "logistic-container",
inventory_size = 48,
fast_replaceable_group = "container",
picture = {
filename = "__base__/graphics/entity/logistic-chest/logistic-chest-storage.png",
height = 32,
priority = "extra-high",
shift = { 0.1, 0 },
width = 38
},
collision_box = { { -0.35, -0.35 }, { 0.35, 0.35 } },
close_sound = {
filename = "__base__/sound/metallic-chest-close.ogg",
volume = 0.7
},
minable = {
result = "logistic-chest-storage",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-player", "player-creation" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "logistic-chest-storage",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 7,
offset_deviation = { { -0.35, -0.35 }, { 0.35, 0.35 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
logistic_mode = "storage",
max_health = 150,
icon = "__base__/graphics/icons/logistic-chest-storage.png",
open_sound = {
filename = "__base__/sound/metallic-chest-open.ogg",
volume = 0.65
}
},
["logistic-chest-passive-provider"] = {
corpse = "small-remnants",
type = "logistic-container",
inventory_size = 48,
fast_replaceable_group = "container",
picture = {
filename = "__base__/graphics/entity/logistic-chest/logistic-chest-passive-provider.png",
height = 32,
priority = "extra-high",
shift = { 0.1, 0 },
width = 38
},
collision_box = { { -0.35, -0.35 }, { 0.35, 0.35 } },
close_sound = {
filename = "__base__/sound/metallic-chest-close.ogg",
volume = 0.7
},
minable = {
result = "logistic-chest-passive-provider",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-player", "player-creation" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "logistic-chest-passive-provider",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 7,
offset_deviation = { { -0.35, -0.35 }, { 0.35, 0.35 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
logistic_mode = "passive-provider",
max_health = 150,
icon = "__base__/graphics/icons/logistic-chest-passive-provider.png",
open_sound = {
filename = "__base__/sound/metallic-chest-open.ogg",
volume = 0.65
}
}
},
["active-defense-equipment"] = {
["basic-laser-defense-equipment"] = {
sprite = {
height = 96,
priority = "medium",
filename = "__base__/graphics/equipment/basic-laser-defense-equipment.png",
width = 64
},
type = "active-defense-equipment",
name = "basic-laser-defense-equipment",
automatic = true,
attack_parameters = {
projectile_creation_distance = 0.6,
sound = { {
filename = "__base__/sound/laser.ogg",
volume = 0.4
} },
range = 15,
ammo_type = {
type = "projectile",
energy_consumption = "100J",
category = "electric",
projectile = "laser",
action = { {
action_delivery = { {
projectile = "laser",
type = "projectile",
starting_speed = 0.28
} },
type = "direct"
} },
speed = 1
},
damage_modifier = 1,
projectile_center = { 0, 0 },
cooldown = 20,
ammo_category = "electric"
},
shape = {
height = 3,
type = "full",
width = 2
},
energy_source = {
type = "electric",
buffer_capacity = "101J",
usage_priority = "secondary-input"
}
},
["basic-electric-discharge-defense-equipment"] = {
sprite = {
height = 96,
priority = "medium",
filename = "__base__/graphics/equipment/basic-electric-discharge-defense-equipment.png",
width = 96
},
type = "active-defense-equipment",
name = "basic-electric-discharge-defense-equipment",
attack_parameters = {
projectile_creation_distance = 0.6,
sound = { {
filename = "__base__/sound/laser.ogg",
volume = 0.4
} },
range = 10,
ammo_type = {
type = "projectile",
energy_consumption = "2KJ",
category = "electric",
speed = 1,
action = { {
action_delivery = { {
projectile = "blue-laser",
type = "projectile",
starting_speed = 0.28
} },
type = "area",
force = "enemy",
perimeter = 10
} }
},
damage_modifier = 3,
projectile_center = { 0, 0 },
cooldown = 150,
ammo_category = "electric"
},
automatic = false,
energy_source = {
type = "electric",
buffer_capacity = "4040J",
usage_priority = "secondary-input"
},
shape = {
height = 3,
type = "full",
width = 3
},
ability_icon = {
height = 32,
priority = "medium",
filename = "__base__/graphics/equipment/basic-electric-discharge-defense-equipment-ability.png",
width = 32
}
}
},
["resource-category"] = {
["basic-fluid"] = {
name = "basic-fluid",
type = "resource-category"
},
["basic-solid"] = {
name = "basic-solid",
type = "resource-category"
}
},
["movement-bonus-equipment"] = {
["basic-exoskeleton-equipment"] = {
sprite = {
height = 128,
priority = "medium",
filename = "__base__/graphics/equipment/basic-exoskeleton-equipment.png",
width = 64
},
type = "movement-bonus-equipment",
name = "basic-exoskeleton-equipment",
movement_bonus = 0.3,
energy_consumption = "200W",
shape = {
height = 4,
type = "full",
width = 2
},
energy_source = {
usage_priority = "secondary-input",
type = "electric"
}
}
},
["solar-panel-equipment"] = {
["solar-panel-equipment"] = {
sprite = {
height = 32,
priority = "medium",
filename = "__base__/graphics/equipment/solar-panel-equipment.png",
width = 32
},
type = "solar-panel-equipment",
name = "solar-panel-equipment",
power = "10W",
shape = {
height = 1,
type = "full",
width = 1
},
energy_source = {
usage_priority = "primary-output",
type = "electric"
}
}
},
["simple-entity"] = {
["small-ship-wreck"] = {
type = "simple-entity",
subgroup = "wrecks",
order = "d[remnants]-d[ship-wreck]-c[small]-a",
collision_box = { { -0.7, -0.7 }, { 0.7, 0.7 } },
pictures = { {
height = 68,
filename = "__base__/graphics/entity/ship-wreck/small-ship-wreck-a.png",
width = 65
}, {
height = 67,
filename = "__base__/graphics/entity/ship-wreck/small-ship-wreck-b.png",
width = 109
}, {
height = 54,
filename = "__base__/graphics/entity/ship-wreck/small-ship-wreck-c.png",
width = 63
}, {
height = 67,
filename = "__base__/graphics/entity/ship-wreck/small-ship-wreck-d.png",
width = 82
}, {
height = 75,
shift = { 0.3, -0.2 },
filename = "__base__/graphics/entity/ship-wreck/small-ship-wreck-e.png",
width = 78
}, {
height = 35,
filename = "__base__/graphics/entity/ship-wreck/small-ship-wreck-f.png",
width = 58
}, {
height = 72,
filename = "__base__/graphics/entity/ship-wreck/small-ship-wreck-g.png",
width = 80
}, {
height = 54,
filename = "__base__/graphics/entity/ship-wreck/small-ship-wreck-h.png",
width = 79
}, {
height = 55,
filename = "__base__/graphics/entity/ship-wreck/small-ship-wreck-i.png",
width = 56
} },
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -1.3, -1.1 }, { 1.3, 1.1 } },
name = "small-ship-wreck",
max_health = 200,
icon = "__base__/graphics/icons/ship-wreck/small-ship-wreck.png",
render_layer = "object"
},
["stone-rock"] = {
type = "simple-entity",
subgroup = "grass",
order = "b[decorative]-k[stone-rock]-a[big]",
collision_box = { { -1.1, -1.1 }, { 1.1, 1.1 } },
pictures = { {
height = 60,
shift = { 0.1, 0 },
filename = "__base__/graphics/entity/decorative/stone-rock/stone-rock-01.png",
width = 76
}, {
height = 86,
shift = { 0.2, 0 },
filename = "__base__/graphics/entity/decorative/stone-rock/stone-rock-02.png",
width = 83
}, {
height = 98,
shift = { 0.7, 0 },
filename = "__base__/graphics/entity/decorative/stone-rock/stone-rock-03.png",
width = 126
}, {
height = 108,
shift = { 0.1, 0 },
filename = "__base__/graphics/entity/decorative/stone-rock/stone-rock-04.png",
width = 92
}, {
height = 99,
shift = { 0.5, 0 },
filename = "__base__/graphics/entity/decorative/stone-rock/stone-rock-05.png",
width = 140
} },
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -1.3, -1.3 }, { 1.3, 1.3 } },
name = "stone-rock",
resistances = { {
percent = 100,
type = "fire"
} },
autoplace = {
order = "a[doodad]-a[rock]",
peaks = { {
influence = 0.0002
}, {
influence = 0.002,
elevation_optimal = 30000,
min_influence = 0,
elevation_range = 23000,
elevation_max_range = 30000
} }
},
max_health = 200,
icon = "__base__/graphics/icons/stone-rock.png",
render_layer = "object"
},
["medium-ship-wreck"] = {
type = "simple-entity",
subgroup = "wrecks",
order = "d[remnants]-d[ship-wreck]-b[medium]-a",
collision_box = { { -1.2, -0.9 }, { 1.2, 0.9 } },
pictures = { {
height = 85,
filename = "__base__/graphics/entity/ship-wreck/medium-ship-wreck-1.png",
width = 120
}, {
height = 107,
shift = { 0.3, 0.1 },
filename = "__base__/graphics/entity/ship-wreck/medium-ship-wreck-2.png",
width = 126
} },
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -1.5, -1.2 }, { 1.5, 1.2 } },
name = "medium-ship-wreck",
max_health = 200,
icon = "__base__/graphics/icons/ship-wreck/medium-ship-wreck.png",
render_layer = "object"
}
},
beacon = {
["basic-beacon"] = {
corpse = "big-remnants",
radius_visualisation_picture = {
height = 12,
filename = "__base__/graphics/entity/basic-beacon/beacon-radius-visualization.png",
width = 12
},
collision_box = { { -1.2, -1.2 }, { 1.2, 1.2 } },
selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
supply_area_distance = 3,
allowed_effects = { "consumption", "speed", "pollution" },
icon = "__base__/graphics/icons/basic-beacon.png",
energy_source = {
usage_priority = "secondary-input",
type = "electric"
},
animation_shadow = {
frame_width = 63,
filename = "__base__/graphics/entity/basic-beacon/basic-beacon-antenna-shadow.png",
animation_speed = 0.5,
line_length = 8,
shift = { 3.12, 0.5 },
frame_count = 32,
frame_height = 49
},
type = "beacon",
distribution_effectivity = 0.5,
animation = {
frame_width = 54,
filename = "__base__/graphics/entity/basic-beacon/basic-beacon-antenna.png",
animation_speed = 0.5,
line_length = 8,
shift = { -0.03, -1.72 },
frame_count = 32,
frame_height = 50
},
minable = {
mining_time = 1,
result = "basic-beacon"
},
flags = { "placeable-player", "player-creation" },
num_module_slots = 2,
name = "basic-beacon",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 86,
offset_deviation = { { -1.2, -1.2 }, { 1.2, 1.2 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
energy_usage = "480kW",
max_health = 200,
base_picture = {
height = 93,
shift = { 0.34, 0.06 },
filename = "__base__/graphics/entity/basic-beacon/basic-beacon-base.png",
width = 116
},
dying_explosion = "huge-explosion"
}
},
resource = {
stone = {
type = "resource",
order = "a-b-d",
collision_box = { { -0.1, -0.1 }, { 0.1, 0.1 } },
stage_counts = { 1000, 600, 400, 200, 100, 50, 20, 1 },
minable = {
result = "stone",
mining_time = 2,
hardness = 0.4,
mining_particle = "stone-particle"
},
flags = { "placeable-neutral" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "stone",
map_color = {
b = 0.317,
g = 0.45,
r = 0.478
},
stages = {
frame_width = 38,
filename = "__base__/graphics/entity/stone/stone.png",
direction_count = 8,
priority = "extra-high",
frame_count = 4,
frame_height = 38
},
icon = "__base__/graphics/icons/stone.png",
autoplace = {
size_control_multiplier = 0.06,
control = "stone",
peaks = { {
starting_area_weight_max_range = 2,
starting_area_weight_range = 0,
influence = 0.2,
starting_area_weight_optimal = 0
}, {
noise_octaves_difference = -3,
influence = 0.6,
starting_area_weight_optimal = 0,
starting_area_weight_max_range = 2,
noise_persistence = 0.45,
starting_area_weight_range = 0,
noise_layer = "stone"
}, {
starting_area_weight_max_range = 2,
starting_area_weight_range = 0,
influence = 0.25,
starting_area_weight_optimal = 1
}, {
noise_octaves_difference = -4,
influence = 0.6,
starting_area_weight_optimal = 1,
starting_area_weight_max_range = 2,
noise_persistence = 0.45,
starting_area_weight_range = 0,
noise_layer = "stone"
}, {
noise_octaves_difference = -2.3,
influence = -0.2,
noise_persistence = 0.45,
max_influence = 0,
noise_layer = "copper-ore"
}, {
noise_octaves_difference = -2.3,
influence = -0.2,
noise_persistence = 0.45,
max_influence = 0,
noise_layer = "iron-ore"
}, {
noise_octaves_difference = -2.3,
influence = -0.2,
noise_persistence = 0.45,
max_influence = 0,
noise_layer = "coal"
} },
richness_base = 250,
sharpness = 1,
richness_multiplier = 11000
}
},
["crude-oil"] = {
minimum = 750,
order = "a-b-a",
collision_box = { { -1.4, -1.4 }, { 1.4, 1.4 } },
map_color = {
b = 0.8,
g = 0.1,
r = 0.8
},
autoplace = {
richness_base = 5000,
size_control_multiplier = 0.06,
control = "crude-oil",
peaks = { {
influence = 0.1
}, {
starting_area_weight_max_range = 2,
starting_area_weight_range = 0,
influence = 0.105,
starting_area_weight_optimal = 1
}, {
noise_octaves_difference = -2.7,
noise_persistence = 0.3,
influence = 0.67,
noise_layer = "crude-oil"
} },
max_probability = 0.04,
sharpness = 1,
richness_multiplier = 150000
},
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
stages = {
frame_width = 75,
filename = "__base__/graphics/entity/crude-oil/crude-oil.png",
direction_count = 1,
priority = "extra-high",
frame_count = 4,
frame_height = 61
},
category = "basic-fluid",
icon = "__base__/graphics/icons/crude-oil.png",
normal = 7500,
type = "resource",
stage_counts = { 0 },
minable = {
mining_time = 1,
hardness = 1,
results = { {
type = "fluid",
name = "crude-oil",
amount_min = 1,
probability = 1,
amount_max = 1
} }
},
flags = { "placeable-neutral" },
map_grid = false,
name = "crude-oil",
infinite = true
},
["copper-ore"] = {
type = "resource",
order = "a-b-a",
collision_box = { { -0.1, -0.1 }, { 0.1, 0.1 } },
stage_counts = { 1000, 600, 400, 200, 100, 50, 20, 1 },
minable = {
result = "copper-ore",
mining_time = 2,
hardness = 0.9,
mining_particle = "copper-ore-particle"
},
flags = { "placeable-neutral" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "copper-ore",
map_color = {
b = 0.215,
g = 0.388,
r = 0.803
},
stages = {
frame_width = 38,
filename = "__base__/graphics/entity/copper-ore/copper-ore.png",
direction_count = 8,
priority = "extra-high",
frame_count = 4,
frame_height = 38
},
icon = "__base__/graphics/icons/copper-ore.png",
autoplace = {
size_control_multiplier = 0.06,
control = "copper-ore",
peaks = { {
starting_area_weight_max_range = 2,
starting_area_weight_range = 0,
influence = 0.2,
starting_area_weight_optimal = 0
}, {
noise_octaves_difference = -1.9,
influence = 0.65,
starting_area_weight_optimal = 0,
starting_area_weight_max_range = 2,
noise_persistence = 0.3,
starting_area_weight_range = 0,
noise_layer = "copper-ore"
}, {
starting_area_weight_max_range = 2,
starting_area_weight_range = 0,
influence = 0.3,
starting_area_weight_optimal = 1
}, {
noise_octaves_difference = -2.3,
influence = 0.55,
starting_area_weight_optimal = 1,
starting_area_weight_max_range = 2,
noise_persistence = 0.4,
starting_area_weight_range = 0,
noise_layer = "copper-ore"
}, {
noise_octaves_difference = -2.3,
influence = -0.2,
noise_persistence = 0.45,
max_influence = 0,
noise_layer = "iron-ore"
}, {
noise_octaves_difference = -2.3,
influence = -0.2,
noise_persistence = 0.45,
max_influence = 0,
noise_layer = "coal"
}, {
noise_octaves_difference = -3,
influence = -0.2,
noise_persistence = 0.45,
max_influence = 0,
noise_layer = "stone"
} },
richness_base = 350,
sharpness = 1,
richness_multiplier = 13000
}
},
coal = {
type = "resource",
order = "a-b-c",
collision_box = { { -0.1, -0.1 }, { 0.1, 0.1 } },
stage_counts = { 1000, 600, 400, 200, 100, 50, 20, 1 },
minable = {
result = "coal",
mining_time = 2,
hardness = 0.9,
mining_particle = "coal-particle"
},
flags = { "placeable-neutral" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "coal",
map_color = {
b = 0,
g = 0,
r = 0
},
stages = {
frame_width = 38,
filename = "__base__/graphics/entity/coal/coal.png",
direction_count = 8,
priority = "extra-high",
frame_count = 4,
frame_height = 38
},
icon = "__base__/graphics/icons/coal.png",
autoplace = {
size_control_multiplier = 0.06,
control = "coal",
peaks = { {
starting_area_weight_max_range = 2,
starting_area_weight_range = 0,
influence = 0.21,
starting_area_weight_optimal = 0
}, {
noise_octaves_difference = -1.9,
influence = 0.65,
starting_area_weight_optimal = 0,
starting_area_weight_max_range = 2,
noise_persistence = 0.35,
starting_area_weight_range = 0,
noise_layer = "coal"
}, {
starting_area_weight_max_range = 2,
starting_area_weight_range = 0,
influence = 0.32,
starting_area_weight_optimal = 1
}, {
noise_octaves_difference = -2.3,
influence = 0.5,
starting_area_weight_optimal = 1,
starting_area_weight_max_range = 2,
noise_persistence = 0.4,
starting_area_weight_range = 0,
noise_layer = "coal"
}, {
noise_octaves_difference = -2.3,
influence = -0.2,
noise_persistence = 0.45,
max_influence = 0,
noise_layer = "copper-ore"
}, {
noise_octaves_difference = -2.3,
influence = -0.2,
noise_persistence = 0.45,
max_influence = 0,
noise_layer = "iron-ore"
}, {
noise_octaves_difference = -3,
influence = -0.2,
noise_persistence = 0.45,
max_influence = 0,
noise_layer = "stone"
} },
richness_base = 350,
sharpness = 1,
richness_multiplier = 13000
}
},
["iron-ore"] = {
type = "resource",
order = "a-b-b",
collision_box = { { -0.1, -0.1 }, { 0.1, 0.1 } },
stage_counts = { 1000, 600, 400, 200, 100, 50, 20, 1 },
minable = {
result = "iron-ore",
mining_time = 2,
hardness = 0.9,
mining_particle = "iron-ore-particle"
},
flags = { "placeable-neutral" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "iron-ore",
map_color = {
b = 0.427,
g = 0.419,
r = 0.337
},
stages = {
frame_width = 38,
filename = "__base__/graphics/entity/iron-ore/iron-ore.png",
direction_count = 8,
priority = "extra-high",
frame_count = 4,
frame_height = 38
},
icon = "__base__/graphics/icons/iron-ore.png",
autoplace = {
size_control_multiplier = 0.06,
control = "iron-ore",
peaks = { {
starting_area_weight_max_range = 2,
starting_area_weight_range = 0,
influence = 0.2,
starting_area_weight_optimal = 0
}, {
starting_area_weight_max_range = 2,
starting_area_weight_range = 0,
influence = 0.3,
starting_area_weight_optimal = 1
}, {
noise_octaves_difference = -1.9,
influence = 0.65,
starting_area_weight_optimal = 0,
starting_area_weight_max_range = 2,
noise_persistence = 0.3,
starting_area_weight_range = 0,
noise_layer = "iron-ore"
}, {
noise_octaves_difference = -2.3,
influence = 0.57,
starting_area_weight_optimal = 1,
starting_area_weight_max_range = 2,
noise_persistence = 0.4,
starting_area_weight_range = 0,
noise_layer = "iron-ore"
}, {
noise_octaves_difference = -2.3,
influence = -0.2,
noise_persistence = 0.45,
max_influence = 0,
noise_layer = "copper-ore"
}, {
noise_octaves_difference = -2.3,
influence = -0.2,
noise_persistence = 0.45,
max_influence = 0,
noise_layer = "coal"
}, {
noise_octaves_difference = -3,
influence = -0.2,
noise_persistence = 0.45,
max_influence = 0,
noise_layer = "stone"
} },
richness_base = 350,
sharpness = 1,
richness_multiplier = 15000
}
}
},
ghost = {
ghost = {
flags = { "not-on-map" },
type = "ghost",
name = "ghost",
minable = {
mining_time = 0,
results = {}
}
}
},
["combat-robot"] = {
distractor = {
shadow = {
height = 37,
priority = "high",
filename = "__base__/graphics/entity/combat-robot/combat-robot-shadow.png",
width = 52
},
order = "e-a-b",
collision_box = { { 0, 0 }, { 0, 0 } },
attack_parameters = {
projectile_creation_distance = 0.6,
sound = { {
filename = "__base__/sound/laser.ogg",
volume = 0.4
} },
range = 15,
ammo_type = {
action = {
action_delivery = {
projectile = "laser",
type = "projectile",
starting_speed = 0.3
},
type = "direct"
},
category = "combat-robot-laser"
},
damage_modifier = 0.7,
projectile_center = { 0, 0 },
cooldown = 20,
ammo_category = "combat-robot-laser"
},
selection_box = { { -0.9, -1.5 }, { 0.9, -0.5 } },
destroy_action = {
action_delivery = {
source_effects = {
entity_name = "explosion",
type = "create-entity"
},
type = "instant"
},
type = "direct"
},
speed = 0.01,
icon = "__base__/graphics/icons/distractor.png",
type = "combat-robot",
time_to_live = 2700,
picture = {
height = 34,
priority = "high",
filename = "__base__/graphics/entity/combat-robot/distractor.png",
width = 37
},
flags = { "placeable-player", "player-creation", "placeable-off-grid", "not-on-map" },
name = "distractor",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 4,
offset_deviation = { { 0, 0 }, { 0, 0 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
max_health = 90,
distance_per_frame = 0.13,
subgroup = "capsule"
},
defender = {
shadow = {
height = 37,
priority = "high",
filename = "__base__/graphics/entity/combat-robot/combat-robot-shadow.png",
width = 52
},
order = "e-a-a",
collision_box = { { 0, 0 }, { 0, 0 } },
attack_parameters = {
range = 15,
sound = { {
filename = "__base__/sound/gunshot.ogg",
volume = 0.3
} },
ammo_type = {
action = {
action_delivery = {
type = "instant",
target_effects = { {
entity_name = "explosion-gunshot",
type = "create-entity"
}, {
damage = {
type = "physical",
amount = 5
},
type = "damage"
} },
source_effects = {
entity_name = "explosion-gunshot",
type = "create-entity"
}
},
type = "direct"
},
category = "bullet"
},
projectile_creation_distance = 0.6,
projectile_center = { 0, 0 },
cooldown = 20,
ammo_category = "bullet"
},
selection_box = { { -0.5, -1.5 }, { 0.5, -0.5 } },
destroy_action = {
action_delivery = {
source_effects = {
entity_name = "explosion",
type = "create-entity"
},
type = "instant"
},
type = "direct"
},
speed = 0.01,
follows_player = true,
icon = "__base__/graphics/icons/defender.png",
friction = 0.01,
type = "combat-robot",
subgroup = "capsule",
picture = {
height = 34,
priority = "high",
filename = "__base__/graphics/entity/combat-robot/defender.png",
width = 37
},
flags = { "placeable-player", "player-creation", "placeable-off-grid", "not-on-map" },
name = "defender",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 4,
offset_deviation = { { 0, 0 }, { 0, 0 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
range_from_player = 6,
max_health = 60,
distance_per_frame = 0.13,
time_to_live = 2700
},
destroyer = {
shadow = {
height = 37,
priority = "high",
filename = "__base__/graphics/entity/combat-robot/combat-robot-shadow.png",
width = 52
},
order = "e-a-c",
collision_box = { { 0, 0 }, { 0, 0 } },
attack_parameters = {
range = 15,
sound = { {
filename = "__base__/sound/laser.ogg",
volume = 0.4
} },
ammo_type = {
action = {
action_delivery = {
projectile = "blue-laser",
type = "projectile",
starting_speed = 0.3
},
type = "direct"
},
category = "combat-robot-laser"
},
projectile_creation_distance = 0.6,
projectile_center = { 0, 0 },
cooldown = 20,
ammo_category = "combat-robot-laser"
},
selection_box = { { -0.5, -1.5 }, { 0.5, -0.5 } },
destroy_action = {
action_delivery = {
source_effects = {
entity_name = "explosion",
type = "create-entity"
},
type = "instant"
},
type = "direct"
},
speed = 0.01,
follows_player = true,
icon = "__base__/graphics/icons/destroyer.png",
friction = 0.01,
type = "combat-robot",
subgroup = "capsule",
picture = {
height = 34,
priority = "high",
filename = "__base__/graphics/entity/combat-robot/destroyer.png",
width = 37
},
flags = { "placeable-player", "player-creation", "placeable-off-grid", "not-on-map" },
name = "destroyer",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 4,
offset_deviation = { { 0, 0 }, { 0, 0 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
range_from_player = 6,
max_health = 60,
distance_per_frame = 0.13,
time_to_live = 7200
}
},
smoke = {
["smoke-fast"] = {
flags = { "not-on-map" },
type = "smoke",
name = "smoke-fast",
animation = {
frame_width = 50,
filename = "__base__/graphics/entity/smoke-fast/smoke-fast.png",
animation_speed = 1,
priority = "high",
frame_count = 16,
frame_height = 50
}
},
["poison-cloud"] = {
wind_speed_factor = 0,
type = "smoke",
action = {
action_delivery = {
target_effects = {
action = {
entity_flags = { "breaths-air" },
type = "area",
action_delivery = {
target_effects = {
damage = {
type = "poison",
amount = 4
},
type = "damage"
},
type = "instant"
},
perimeter = 11
},
type = "nested-result"
},
type = "instant"
},
type = "direct"
},
animation = {
scale = 3,
frame_width = 256,
filename = "__base__/graphics/entity/cloud/cloud-45-frames.png",
animation_speed = 3,
line_length = 7,
priority = "low",
frame_count = 45,
frame_height = 256
},
slow_down_factor = 0,
cyclic = true,
show_when_smoke_off = true,
fade_away_duration = 120,
flags = { "not-on-map" },
name = "poison-cloud",
action_frequency = 30,
color = {
b = 0.2,
g = 0.9,
r = 0.2
},
spread_duration = 10,
duration = 1200
},
["smoke-building"] = {
wind_speed_factor = 0,
type = "smoke",
animation = {
frame_width = 50,
filename = "__base__/graphics/entity/smoke-fast/smoke-fast.png",
animation_speed = 2,
scale = 0.5,
priority = "high",
frame_count = 16,
frame_height = 50
},
duration = 45,
show_when_smoke_off = true,
fade_away_duration = 30,
flags = { "not-on-map" },
render_layer = "building-smoke",
name = "smoke-building",
movement_slow_down_factor = 0.96
},
smoke = {
flags = { "not-on-map" },
type = "smoke",
name = "smoke",
animation = {
frame_width = 88,
filename = "__base__/graphics/entity/smoke/smoke.png",
animation_speed = 12,
line_length = 7,
priority = "high",
frame_count = 39,
frame_height = 78
}
},
["smoke-explosion-particle"] = {
wind_speed_factor = 0.02,
type = "smoke",
animation = {
frame_width = 50,
filename = "__base__/graphics/entity/smoke-fast/smoke-fast.png",
animation_speed = 2,
scale = 0.5,
priority = "high",
frame_count = 16,
frame_height = 50
},
duration = 150,
show_when_smoke_off = true,
fade_away_duration = 60,
flags = { "not-on-map" },
render_layer = "smoke",
name = "smoke-explosion-particle",
movement_slow_down_factor = 0.96
},
["smoke-train-stop"] = {
wind_speed_factor = 0,
type = "smoke",
animation = {
frame_width = 50,
filename = "__base__/graphics/entity/smoke-fast/smoke-fast.png",
animation_speed = 2,
scale = 0.5,
priority = "high",
frame_count = 16,
frame_height = 50
},
duration = 40,
show_when_smoke_off = true,
fade_away_duration = 30,
flags = { "not-on-map" },
render_layer = "lower-object",
name = "smoke-train-stop",
movement_slow_down_factor = 0.95
}
},
["night-vision-equipment"] = {
["night-vision-equipment"] = {
sprite = {
height = 64,
priority = "medium",
filename = "__base__/graphics/equipment/night-vision-equipment.png",
width = 96
},
type = "night-vision-equipment",
name = "night-vision-equipment",
energy_input = "10W",
shape = {
height = 2,
type = "full",
width = 3
},
energy_source = {
usage_priority = "primary-input",
type = "electric",
buffer_capacity = "120J",
input_flow_limit = "120W"
}
}
},
module = {
["effectivity-module-3"] = {
flags = { "goes-to-main-inventory" },
type = "module",
name = "effectivity-module-3",
effect = {
consumption = {
bonus = -0.5
}
},
order = "c[effectivity]-c[effectivity-module-3]",
stack_size = 50,
icon = "__base__/graphics/icons/effectivity-module-3.png",
subgroup = "module"
},
["speed-module-2"] = {
flags = { "goes-to-main-inventory" },
type = "module",
name = "speed-module-2",
effect = {
speed = {
bonus = 0.3
},
consumption = {
bonus = 0.6
}
},
order = "a[speed]-b[speed-module-2]",
stack_size = 50,
icon = "__base__/graphics/icons/speed-module-2.png",
subgroup = "module"
},
["speed-module"] = {
flags = { "goes-to-main-inventory" },
type = "module",
name = "speed-module",
effect = {
speed = {
bonus = 0.2
},
consumption = {
bonus = 0.5
}
},
order = "a[speed]-a[speed-module-1]",
stack_size = 50,
icon = "__base__/graphics/icons/speed-module.png",
subgroup = "module"
},
["speed-module-3"] = {
flags = { "goes-to-main-inventory" },
type = "module",
name = "speed-module-3",
effect = {
speed = {
bonus = 0.5
},
consumption = {
bonus = 0.7
}
},
order = "a[speed]-c[speed-module-3]",
stack_size = 50,
icon = "__base__/graphics/icons/speed-module-3.png",
subgroup = "module"
},
["productivity-module-3"] = {
type = "module",
subgroup = "module",
effect = {
pollution = {
bonus = 0.5
},
speed = {
bonus = -0.15
},
productivity = {
bonus = 0.1
},
consumption = {
bonus = 0.8
}
},
order = "c[productivity]-c[productivity-module-3]",
flags = { "goes-to-main-inventory" },
name = "productivity-module-3",
limitation_message_key = "production-module-usable-only-on-intermeidates",
limitation = { "sulfuric-acid", "basic-oil-processing", "advanced-oil-processing", "heavy-oil-cracking", "light-oil-cracking", "solid-fuel-from-light-oil", "solid-fuel-from-heavy-oil", "solid-fuel-from-petroleum-gas", "lubricant", "iron-plate", "copper-plate", "steel-plate", "stone-brick", "sulfur", "plastic-bar", "empty-barrel", "iron-stick", "iron-gear-wheel", "copper-cable", "electronic-circuit", "advanced-circuit", "engine-unit", "electric-engine-unit", "processing-unit", "explosives", "battery", "flying-robot-frame", "science-pack-1", "science-pack-2", "science-pack-3", "alien-science-pack" },
icon = "__base__/graphics/icons/productivity-module-3.png",
stack_size = 50
},
["productivity-module"] = {
type = "module",
subgroup = "module",
effect = {
pollution = {
bonus = 0.3
},
speed = {
bonus = -0.15
},
productivity = {
bonus = 0.04
},
consumption = {
bonus = 0.4
}
},
order = "c[productivity]-a[productivity-module-1]",
flags = { "goes-to-main-inventory" },
name = "productivity-module",
limitation_message_key = "production-module-usable-only-on-intermeidates",
limitation = { "sulfuric-acid", "basic-oil-processing", "advanced-oil-processing", "heavy-oil-cracking", "light-oil-cracking", "solid-fuel-from-light-oil", "solid-fuel-from-heavy-oil", "solid-fuel-from-petroleum-gas", "lubricant", "iron-plate", "copper-plate", "steel-plate", "stone-brick", "sulfur", "plastic-bar", "empty-barrel", "iron-stick", "iron-gear-wheel", "copper-cable", "electronic-circuit", "advanced-circuit", "engine-unit", "electric-engine-unit", "processing-unit", "explosives", "battery", "flying-robot-frame", "science-pack-1", "science-pack-2", "science-pack-3", "alien-science-pack" },
icon = "__base__/graphics/icons/productivity-module.png",
stack_size = 50
},
["effectivity-module-2"] = {
flags = { "goes-to-main-inventory" },
type = "module",
name = "effectivity-module-2",
effect = {
consumption = {
bonus = -0.4
}
},
order = "c[effectivity]-b[effectivity-module-2]",
stack_size = 50,
icon = "__base__/graphics/icons/effectivity-module-2.png",
subgroup = "module"
},
["productivity-module-2"] = {
type = "module",
subgroup = "module",
effect = {
pollution = {
bonus = 0.4
},
speed = {
bonus = -0.15
},
productivity = {
bonus = 0.06
},
consumption = {
bonus = 0.6
}
},
order = "c[productivity]-b[productivity-module-2]",
flags = { "goes-to-main-inventory" },
name = "productivity-module-2",
limitation_message_key = "production-module-usable-only-on-intermeidates",
limitation = { "sulfuric-acid", "basic-oil-processing", "advanced-oil-processing", "heavy-oil-cracking", "light-oil-cracking", "solid-fuel-from-light-oil", "solid-fuel-from-heavy-oil", "solid-fuel-from-petroleum-gas", "lubricant", "iron-plate", "copper-plate", "steel-plate", "stone-brick", "sulfur", "plastic-bar", "empty-barrel", "iron-stick", "iron-gear-wheel", "copper-cable", "electronic-circuit", "advanced-circuit", "engine-unit", "electric-engine-unit", "processing-unit", "explosives", "battery", "flying-robot-frame", "science-pack-1", "science-pack-2", "science-pack-3", "alien-science-pack" },
icon = "__base__/graphics/icons/productivity-module-2.png",
stack_size = 50
},
["effectivity-module"] = {
type = "module",
subgroup = "module",
effect = {
consumption = {
bonus = -0.3
}
},
order = "c[effectivity]-a[effectivity-module-1]",
flags = { "goes-to-main-inventory" },
name = "effectivity-module",
icon = "__base__/graphics/icons/effectivity-module.png",
stack_size = 50
}
},
recipe = {
["night-vision-equipment"] = {
enabled = "false",
type = "recipe",
name = "night-vision-equipment",
result = "night-vision-equipment",
energy_required = 10,
ingredients = { { "advanced-circuit", 5 }, { "steel-plate", 10 } }
},
["small-electric-pole"] = {
result_count = 2,
type = "recipe",
name = "small-electric-pole",
ingredients = { { "wood", 2 }, { "copper-cable", 2 } },
result = "small-electric-pole"
},
["gun-turret"] = {
enabled = "false",
type = "recipe",
name = "gun-turret",
result = "gun-turret",
energy_required = 5,
ingredients = { { "iron-gear-wheel", 5 }, { "copper-plate", 5 }, { "iron-plate", 10 } }
},
radar = {
result = "radar",
type = "recipe",
name = "radar",
ingredients = { { "electronic-circuit", 5 }, { "iron-gear-wheel", 5 }, { "iron-plate", 10 } }
},
["diesel-locomotive"] = {
enabled = "false",
type = "recipe",
name = "diesel-locomotive",
ingredients = { { "engine-unit", 15 }, { "electronic-circuit", 5 }, { "steel-plate", 10 } },
result = "diesel-locomotive"
},
["fusion-reactor-equipment"] = {
enabled = "false",
type = "recipe",
name = "fusion-reactor-equipment",
result = "fusion-reactor-equipment",
energy_required = 10,
ingredients = { { "processing-unit", 100 }, { "alien-artifact", 30 } }
},
["stone-furnace"] = {
result = "stone-furnace",
type = "recipe",
name = "stone-furnace",
ingredients = { { "stone", 5 } }
},
["logistic-chest-requester"] = {
enabled = "false",
type = "recipe",
name = "logistic-chest-requester",
ingredients = { { "smart-chest", 1 }, { "advanced-circuit", 1 } },
result = "logistic-chest-requester"
},
["burner-mining-drill"] = {
type = "recipe",
name = "burner-mining-drill",
result = "burner-mining-drill",
energy_required = 2,
ingredients = { { "iron-gear-wheel", 3 }, { "stone-furnace", 1 }, { "iron-plate", 3 } }
},
["basic-transport-belt"] = {
result_count = 2,
type = "recipe",
name = "basic-transport-belt",
ingredients = { { "iron-plate", 1 }, { "iron-gear-wheel", 1 } },
result = "basic-transport-belt"
},
car = {
enabled = "false",
type = "recipe",
name = "car",
ingredients = { { "engine-unit", 8 }, { "iron-plate", 20 }, { "steel-plate", 5 } },
result = "car"
},
pipe = {
result = "pipe",
type = "recipe",
name = "pipe",
ingredients = { { "iron-plate", 1 } }
},
["copper-cable"] = {
result_count = 2,
type = "recipe",
name = "copper-cable",
ingredients = { { "copper-plate", 1 } },
result = "copper-cable"
},
["cargo-wagon"] = {
enabled = "false",
type = "recipe",
name = "cargo-wagon",
ingredients = { { "iron-gear-wheel", 10 }, { "iron-plate", 20 }, { "steel-plate", 5 } },
result = "cargo-wagon"
},
["basic-oil-processing"] = {
enabled = "false",
type = "recipe",
subgroup = "fluid",
order = "a[oil-processing]-a[basic-oil-processing]",
energy_required = 5,
name = "basic-oil-processing",
category = "oil-processing",
icon = "__base__/graphics/icons/fluid/basic-oil-processing.png",
ingredients = { {
type = "fluid",
name = "crude-oil",
amount = 10
} },
results = { {
type = "fluid",
name = "heavy-oil",
amount = 3
}, {
type = "fluid",
name = "light-oil",
amount = 3
}, {
type = "fluid",
name = "petroleum-gas",
amount = 4
} }
},
["empty-crude-oil-barrel"] = {
enabled = "false",
type = "recipe",
subgroup = "barrel",
order = "c[empty-crude-oil-barrel]",
energy_required = 1,
name = "empty-crude-oil-barrel",
category = "crafting-with-fluid",
ingredients = { {
type = "item",
name = "crude-oil-barrel",
amount = 1
} },
icon = "__base__/graphics/icons/fluid/empty-crude-oil-barrel.png",
results = { {
type = "fluid",
name = "crude-oil",
amount = 25
}, {
type = "item",
name = "empty-barrel",
amount = 1
} }
},
wood = {
result_count = 2,
type = "recipe",
name = "wood",
ingredients = { { "raw-wood", 1 } },
result = "wood"
},
["long-handed-inserter"] = {
enabled = "false",
type = "recipe",
name = "long-handed-inserter",
ingredients = { { "iron-gear-wheel", 1 }, { "iron-plate", 1 }, { "basic-inserter", 1 } },
result = "long-handed-inserter"
},
roboport = {
enabled = "false",
type = "recipe",
name = "roboport",
energy_required = 15,
ingredients = { { "steel-plate", 45 }, { "iron-gear-wheel", 45 }, { "advanced-circuit", 45 } },
result = "roboport"
},
["energy-shield-mk2-equipment"] = {
enabled = "false",
type = "recipe",
name = "energy-shield-mk2-equipment",
result = "energy-shield-mk2-equipment",
energy_required = 10,
ingredients = { { "energy-shield-equipment", 10 }, { "processing-unit", 10 } }
},
["light-oil-cracking"] = {
enabled = "false",
type = "recipe",
subgroup = "fluid",
order = "b[fluid-chemistry]-b[light-oil-cracking]",
main_product = "",
energy_required = 5,
name = "light-oil-cracking",
category = "chemistry",
icon = "__base__/graphics/icons/fluid/light-oil-cracking.png",
ingredients = { {
type = "fluid",
name = "light-oil",
amount = 3
}, {
type = "fluid",
name = "water",
amount = 3
} },
results = { {
type = "fluid",
name = "petroleum-gas",
amount = 2
} }
},
["piercing-bullet-magazine"] = {
enabled = "false",
type = "recipe",
name = "piercing-bullet-magazine",
result = "piercing-bullet-magazine",
energy_required = 3,
ingredients = { { "copper-plate", 5 }, { "steel-plate", 1 } }
},
["rocket-defense"] = {
enabled = "false",
type = "recipe",
name = "rocket-defense",
ingredients = { { "rocket", 100 }, { "advanced-circuit", 150 }, { "processing-unit", 100 }, { "speed-module-3", 50 }, { "productivity-module-3", 50 } },
result = "rocket-defense"
},
["electric-engine-unit"] = {
enabled = "false",
type = "recipe",
name = "electric-engine-unit",
category = "crafting-with-fluid",
result = "electric-engine-unit",
energy_required = 20,
ingredients = { { "engine-unit", 1 }, {
type = "fluid",
name = "lubricant",
amount = 2
}, { "electronic-circuit", 2 } }
},
["productivity-module"] = {
enabled = "false",
type = "recipe",
name = "productivity-module",
result = "productivity-module",
ingredients = { { "advanced-circuit", 5 }, { "electronic-circuit", 5 } },
energy_required = 15
},
["storage-tank"] = {
enabled = "false",
type = "recipe",
name = "storage-tank",
result = "storage-tank",
energy_required = 3,
ingredients = { { "iron-plate", 20 }, { "steel-plate", 5 } }
},
["steel-axe"] = {
enabled = "false",
type = "recipe",
name = "steel-axe",
ingredients = { { "steel-plate", 5 }, { "iron-stick", 2 } },
result = "steel-axe"
},
["destroyer-capsule"] = {
enabled = "false",
type = "recipe",
name = "destroyer-capsule",
result = "destroyer-capsule",
energy_required = 15,
ingredients = { { "distractor-capsule", 4 }, { "speed-module", 1 } }
},
["solid-fuel-from-light-oil"] = {
enabled = "false",
type = "recipe",
subgroup = "fluid",
order = "b[fluid-chemistry]-c[solid-fuel-from-light-oil]",
energy_required = 3,
name = "solid-fuel-from-light-oil",
category = "chemistry",
icon = "__base__/graphics/icons/solid-fuel-from-light-oil.png",
ingredients = { {
type = "fluid",
name = "light-oil",
amount = 1
} },
results = { {
type = "item",
name = "solid-fuel",
amount = 1
} }
},
["battery-mk2-equipment"] = {
enabled = "false",
type = "recipe",
name = "battery-mk2-equipment",
result = "battery-mk2-equipment",
energy_required = 10,
ingredients = { { "battery-equipment", 10 }, { "processing-unit", 20 } }
},
["curved-rail"] = {
enabled = "false",
type = "recipe",
name = "curved-rail",
result_count = 2,
ingredients = { { "stone", 4 }, { "iron-stick", 4 }, { "steel-plate", 4 } },
result = "curved-rail"
},
substation = {
enabled = "false",
type = "recipe",
name = "substation",
ingredients = { { "steel-plate", 10 }, { "advanced-circuit", 5 }, { "copper-plate", 5 } },
result = "substation"
},
["basic-beacon"] = {
enabled = "false",
type = "recipe",
name = "basic-beacon",
result = "basic-beacon",
energy_required = 15,
ingredients = { { "electronic-circuit", 20 }, { "advanced-circuit", 20 }, { "steel-plate", 10 }, { "copper-cable", 10 } }
},
["poison-capsule"] = {
enabled = "false",
type = "recipe",
name = "poison-capsule",
result = "poison-capsule",
energy_required = 8,
ingredients = { { "steel-plate", 3 }, { "electronic-circuit", 3 }, { "coal", 10 } }
},
["basic-electric-discharge-defense-equipment"] = {
enabled = "false",
type = "recipe",
name = "basic-electric-discharge-defense-equipment",
result = "basic-electric-discharge-defense-equipment",
energy_required = 10,
ingredients = { { "processing-unit", 5 }, { "steel-plate", 20 }, { "laser-turret", 10 } }
},
["shotgun-shell"] = {
enabled = "false",
type = "recipe",
name = "shotgun-shell",
result = "shotgun-shell",
energy_required = 3,
ingredients = { { "copper-plate", 2 }, { "iron-plate", 2 } }
},
["red-wire"] = {
enabled = "false",
type = "recipe",
name = "red-wire",
ingredients = { { "electronic-circuit", 1 }, { "copper-cable", 1 } },
result = "red-wire"
},
["assembling-machine-3"] = {
enabled = "false",
type = "recipe",
name = "assembling-machine-3",
ingredients = { { "speed-module", 4 }, { "assembling-machine-2", 2 } },
result = "assembling-machine-3"
},
lubricant = {
enabled = "false",
type = "recipe",
name = "lubricant",
category = "chemistry",
ingredients = { {
type = "fluid",
name = "heavy-oil",
amount = 1
} },
energy_required = 1,
results = { {
type = "fluid",
name = "lubricant",
amount = 1
} }
},
["basic-transport-belt-to-ground"] = {
enabled = "false",
type = "recipe",
name = "basic-transport-belt-to-ground",
result = "basic-transport-belt-to-ground",
result_count = 2,
energy_required = 1,
ingredients = { { "iron-plate", 10 }, { "basic-transport-belt", 5 } }
},
["oil-refinery"] = {
enabled = "false",
type = "recipe",
name = "oil-refinery",
result = "oil-refinery",
energy_required = 20,
ingredients = { { "steel-plate", 15 }, { "iron-gear-wheel", 10 }, { "stone-brick", 10 }, { "electronic-circuit", 10 }, { "pipe", 10 } }
},
["basic-splitter"] = {
enabled = "false",
type = "recipe",
name = "basic-splitter",
result = "basic-splitter",
energy_required = 1,
ingredients = { { "electronic-circuit", 5 }, { "iron-plate", 5 }, { "basic-transport-belt", 4 } }
},
["energy-shield-equipment"] = {
enabled = "false",
type = "recipe",
name = "energy-shield-equipment",
result = "energy-shield-equipment",
energy_required = 10,
ingredients = { { "advanced-circuit", 5 }, { "steel-plate", 10 } }
},
wall = {
enabled = "true",
type = "recipe",
name = "wall",
ingredients = { { "stone-brick", 5 } },
result = "wall"
},
["effectivity-module"] = {
enabled = "false",
type = "recipe",
name = "effectivity-module",
result = "effectivity-module",
ingredients = { { "advanced-circuit", 5 }, { "electronic-circuit", 5 } },
energy_required = 15
},
["steel-plate"] = {
enabled = "false",
type = "recipe",
name = "steel-plate",
category = "smelting",
result = "steel-plate",
energy_required = 17.5,
ingredients = { { "iron-plate", 5 } }
},
["assembling-machine-2"] = {
enabled = "false",
type = "recipe",
name = "assembling-machine-2",
ingredients = { { "iron-plate", 9 }, { "electronic-circuit", 3 }, { "iron-gear-wheel", 5 }, { "assembling-machine-1", 1 } },
result = "assembling-machine-2"
},
["speed-module-2"] = {
enabled = "false",
type = "recipe",
name = "speed-module-2",
result = "speed-module-2",
ingredients = { { "speed-module", 4 }, { "processing-unit", 5 }, { "advanced-circuit", 5 } },
energy_required = 30
},
["laser-turret"] = {
enabled = "false",
type = "recipe",
name = "laser-turret",
result = "laser-turret",
energy_required = 5,
ingredients = { { "steel-plate", 5 }, { "electronic-circuit", 5 }, { "battery", 3 } }
},
boiler = {
result = "boiler",
type = "recipe",
name = "boiler",
ingredients = { { "stone-furnace", 1 }, { "pipe", 1 } }
},
["basic-bullet-magazine"] = {
result_count = 1,
type = "recipe",
name = "basic-bullet-magazine",
result = "basic-bullet-magazine",
energy_required = 2,
ingredients = { { "iron-plate", 2 } }
},
["rail-signal"] = {
enabled = "false",
type = "recipe",
name = "rail-signal",
ingredients = { { "electronic-circuit", 1 }, { "iron-plate", 5 } },
result = "rail-signal"
},
["solid-fuel-from-heavy-oil"] = {
enabled = "false",
type = "recipe",
subgroup = "fluid",
order = "b[fluid-chemistry]-e[solid-fuel-from-heavy-oil]",
energy_required = 3,
name = "solid-fuel-from-heavy-oil",
category = "chemistry",
icon = "__base__/graphics/icons/solid-fuel-from-heavy-oil.png",
ingredients = { {
type = "fluid",
name = "heavy-oil",
amount = 2
} },
results = { {
type = "item",
name = "solid-fuel",
amount = 1
} }
},
["express-splitter"] = {
enabled = "false",
type = "recipe",
name = "express-splitter",
result = "express-splitter",
energy_required = 2,
ingredients = { { "advanced-circuit", 10 }, { "iron-gear-wheel", 10 }, { "express-transport-belt", 4 } }
},
["plastic-bar"] = {
enabled = "false",
type = "recipe",
name = "plastic-bar",
category = "chemistry",
ingredients = { {
type = "fluid",
name = "petroleum-gas",
amount = 3
}, {
type = "item",
name = "coal",
amount = 1
} },
energy_required = 1,
results = { {
type = "item",
name = "plastic-bar",
amount = 2
} }
},
["electric-furnace"] = {
enabled = "false",
type = "recipe",
name = "electric-furnace",
energy_required = 5,
ingredients = { { "steel-plate", 15 }, { "advanced-circuit", 5 }, { "stone-brick", 10 } },
result = "electric-furnace"
},
["steel-furnace"] = {
enabled = "false",
type = "recipe",
name = "steel-furnace",
energy_required = 3,
ingredients = { { "steel-plate", 8 }, { "stone-brick", 10 } },
result = "steel-furnace"
},
pistol = {
type = "recipe",
name = "pistol",
result = "pistol",
energy_required = 1,
ingredients = { { "copper-plate", 5 }, { "iron-plate", 5 } }
},
["iron-axe"] = {
result = "iron-axe",
type = "recipe",
name = "iron-axe",
ingredients = { { "iron-stick", 2 }, { "iron-plate", 3 } }
},
["small-plane"] = {
enabled = "false",
type = "recipe",
name = "small-plane",
category = "crafting",
result = "small-plane",
energy_required = 30,
ingredients = { { "plastic-bar", 120 }, { "advanced-circuit", 250 }, { "electric-engine-unit", 20 }, { "battery", 150 } }
},
["express-transport-belt"] = {
enabled = "false",
type = "recipe",
name = "express-transport-belt",
category = "crafting-with-fluid",
ingredients = { { "iron-gear-wheel", 5 }, { "fast-transport-belt", 1 }, {
type = "fluid",
name = "lubricant",
amount = 2
} },
result = "express-transport-belt"
},
shotgun = {
enabled = "false",
type = "recipe",
name = "shotgun",
result = "shotgun",
energy_required = 4,
ingredients = { { "iron-plate", 15 }, { "iron-gear-wheel", 5 }, { "copper-plate", 10 }, { "wood", 5 } }
},
["basic-inserter"] = {
result = "basic-inserter",
type = "recipe",
name = "basic-inserter",
ingredients = { { "electronic-circuit", 1 }, { "iron-gear-wheel", 1 }, { "iron-plate", 1 } }
},
["electronic-circuit"] = {
result = "electronic-circuit",
type = "recipe",
name = "electronic-circuit",
ingredients = { { "iron-plate", 1 }, { "copper-cable", 3 } }
},
["pipe-to-ground"] = {
result_count = 2,
type = "recipe",
name = "pipe-to-ground",
ingredients = { { "pipe", 10 }, { "iron-plate", 5 } },
result = "pipe-to-ground"
},
["train-stop"] = {
enabled = "false",
type = "recipe",
name = "train-stop",
ingredients = { { "electronic-circuit", 5 }, { "iron-plate", 10 }, { "steel-plate", 3 } },
result = "train-stop"
},
["effectivity-module-2"] = {
enabled = "false",
type = "recipe",
name = "effectivity-module-2",
result = "effectivity-module-2",
ingredients = { { "effectivity-module", 4 }, { "advanced-circuit", 5 }, { "processing-unit", 5 } },
energy_required = 30
},
["solid-fuel-from-petroleum-gas"] = {
enabled = "false",
type = "recipe",
subgroup = "fluid",
order = "b[fluid-chemistry]-d[solid-fuel-from-petroleum-gas]",
energy_required = 3,
name = "solid-fuel-from-petroleum-gas",
category = "chemistry",
icon = "__base__/graphics/icons/solid-fuel-from-petroleum-gas.png",
ingredients = { {
type = "fluid",
name = "petroleum-gas",
amount = 2
} },
results = { {
type = "item",
name = "solid-fuel",
amount = 1
} }
},
["land-mine"] = {
enabled = "false",
type = "recipe",
name = "land-mine",
result_count = 4,
result = "land-mine",
energy_required = 5,
ingredients = { { "steel-plate", 1 }, { "explosives", 2 } }
},
["combat-shotgun"] = {
enabled = "false",
type = "recipe",
name = "combat-shotgun",
result = "combat-shotgun",
energy_required = 8,
ingredients = { { "steel-plate", 15 }, { "iron-gear-wheel", 5 }, { "copper-plate", 10 }, { "wood", 10 } }
},
pumpjack = {
enabled = "false",
type = "recipe",
name = "pumpjack",
result = "pumpjack",
energy_required = 20,
ingredients = { { "steel-plate", 15 }, { "iron-gear-wheel", 10 }, { "electronic-circuit", 10 }, { "pipe", 10 } }
},
["smart-chest"] = {
enabled = "false",
type = "recipe",
name = "smart-chest",
ingredients = { { "steel-chest", 1 }, { "electronic-circuit", 3 } },
result = "smart-chest"
},
["deconstruction-planner"] = {
enabled = "false",
type = "recipe",
name = "deconstruction-planner",
result = "deconstruction-planner",
energy_required = 1,
ingredients = { { "advanced-circuit", 1 } }
},
["fast-inserter"] = {
enabled = "false",
type = "recipe",
name = "fast-inserter",
ingredients = { { "electronic-circuit", 2 }, { "iron-plate", 2 }, { "basic-inserter", 1 } },
result = "fast-inserter"
},
["explosive-rocket"] = {
enabled = "false",
type = "recipe",
name = "explosive-rocket",
result = "explosive-rocket",
energy_required = 8,
ingredients = { { "rocket", 1 }, { "explosives", 5 } }
},
["smart-inserter"] = {
enabled = "false",
type = "recipe",
name = "smart-inserter",
ingredients = { { "fast-inserter", 1 }, { "electronic-circuit", 4 } },
result = "smart-inserter"
},
["basic-electric-discharge-defense-remote"] = {
enabled = "false",
type = "recipe",
name = "basic-electric-discharge-defense-remote",
ingredients = { { "electronic-circuit", 1 } },
result = "basic-electric-discharge-defense-remote"
},
["speed-module"] = {
enabled = "false",
type = "recipe",
name = "speed-module",
result = "speed-module",
ingredients = { { "advanced-circuit", 5 }, { "electronic-circuit", 5 } },
energy_required = 15
},
["submachine-gun"] = {
enabled = "false",
type = "recipe",
name = "submachine-gun",
result = "submachine-gun",
energy_required = 3,
ingredients = { { "iron-gear-wheel", 10 }, { "copper-plate", 5 }, { "iron-plate", 10 } }
},
["basic-exoskeleton-equipment"] = {
enabled = "false",
type = "recipe",
name = "basic-exoskeleton-equipment",
result = "basic-exoskeleton-equipment",
energy_required = 10,
ingredients = { { "processing-unit", 10 }, { "electric-engine-unit", 30 }, { "steel-plate", 20 } }
},
["power-armor"] = {
enabled = "false",
type = "recipe",
name = "power-armor",
result = "power-armor",
energy_required = 20,
ingredients = { { "processing-unit", 100 }, { "electric-engine-unit", 30 }, { "steel-plate", 100 }, { "alien-artifact", 10 } }
},
["flame-thrower-ammo"] = {
enabled = "false",
type = "recipe",
name = "flame-thrower-ammo",
category = "chemistry",
result = "flame-thrower-ammo",
energy_required = 3,
ingredients = { {
type = "item",
name = "iron-plate",
amount = 5
}, {
type = "fluid",
name = "light-oil",
amount = 2.5
}, {
type = "fluid",
name = "heavy-oil",
amount = 2.5
} }
},
["solar-panel-equipment"] = {
enabled = "false",
type = "recipe",
name = "solar-panel-equipment",
result = "solar-panel-equipment",
energy_required = 10,
ingredients = { { "solar-panel", 5 }, { "processing-unit", 1 }, { "steel-plate", 5 } }
},
["straight-rail"] = {
enabled = "false",
type = "recipe",
name = "straight-rail",
result_count = 2,
ingredients = { { "stone", 1 }, { "iron-stick", 1 }, { "steel-plate", 1 } },
result = "straight-rail"
},
["medium-electric-pole"] = {
enabled = "false",
type = "recipe",
name = "medium-electric-pole",
ingredients = { { "steel-plate", 2 }, { "copper-plate", 2 } },
result = "medium-electric-pole"
},
["engine-unit"] = {
enabled = "false",
type = "recipe",
name = "engine-unit",
category = "advanced-crafting",
result = "engine-unit",
energy_required = 20,
ingredients = { { "steel-plate", 1 }, { "iron-gear-wheel", 1 }, { "pipe", 2 } }
},
["flame-thrower"] = {
enabled = "false",
type = "recipe",
name = "flame-thrower",
result = "flame-thrower",
energy_required = 10,
ingredients = { { "steel-plate", 5 }, { "iron-gear-wheel", 10 } }
},
["chemical-plant"] = {
enabled = "false",
type = "recipe",
name = "chemical-plant",
result = "chemical-plant",
energy_required = 10,
ingredients = { { "steel-plate", 5 }, { "iron-gear-wheel", 5 }, { "electronic-circuit", 5 }, { "pipe", 5 } }
},
["copper-plate"] = {
type = "recipe",
name = "copper-plate",
category = "smelting",
result = "copper-plate",
energy_required = 3.5,
ingredients = { { "copper-ore", 1 } }
},
["small-pump"] = {
enabled = "false",
type = "recipe",
name = "small-pump",
result = "small-pump",
energy_required = 2,
ingredients = { { "electric-engine-unit", 1 }, { "steel-plate", 1 }, { "pipe", 1 } }
},
["fast-transport-belt"] = {
enabled = "false",
type = "recipe",
name = "fast-transport-belt",
ingredients = { { "iron-gear-wheel", 5 }, { "basic-transport-belt", 1 } },
result = "fast-transport-belt"
},
["advanced-oil-processing"] = {
enabled = "false",
type = "recipe",
subgroup = "fluid",
order = "a[oil-processing]-b[advanced-oil-processing]",
energy_required = 5,
name = "advanced-oil-processing",
category = "oil-processing",
icon = "__base__/graphics/icons/fluid/advanced-oil-processing.png",
ingredients = { {
type = "fluid",
name = "crude-oil",
amount = 10
}, {
type = "fluid",
name = "water",
amount = 5
} },
results = { {
type = "fluid",
name = "heavy-oil",
amount = 1
}, {
type = "fluid",
name = "light-oil",
amount = 4.5
}, {
type = "fluid",
name = "petroleum-gas",
amount = 5.5
} }
},
["effectivity-module-3"] = {
enabled = "false",
type = "recipe",
name = "effectivity-module-3",
result = "effectivity-module-3",
ingredients = { { "effectivity-module-2", 5 }, { "advanced-circuit", 5 }, { "processing-unit", 5 }, { "alien-artifact", 1 } },
energy_required = 60
},
["solar-panel"] = {
enabled = "false",
type = "recipe",
name = "solar-panel",
ingredients = { { "steel-plate", 5 }, { "electronic-circuit", 15 }, { "copper-plate", 5 } },
result = "solar-panel"
},
battery = {
enabled = "false",
type = "recipe",
name = "battery",
category = "chemistry",
result = "battery",
energy_required = 5,
ingredients = { {
type = "fluid",
name = "sulfuric-acid",
amount = 2
}, { "iron-plate", 1 }, { "copper-plate", 1 } }
},
railgun = {
enabled = "false",
type = "recipe",
name = "railgun",
result = "railgun",
energy_required = 8,
ingredients = { { "steel-plate", 15 }, { "copper-plate", 15 }, { "electronic-circuit", 10 }, { "advanced-circuit", 5 } }
},
explosives = {
enabled = "false",
type = "recipe",
name = "explosives",
category = "chemistry",
result = "explosives",
energy_required = 5,
ingredients = { {
type = "item",
name = "sulfur",
amount = 1
}, {
type = "item",
name = "coal",
amount = 1
}, {
type = "fluid",
name = "water",
amount = 1
} }
},
["flying-robot-frame"] = {
enabled = "false",
type = "recipe",
name = "flying-robot-frame",
result = "flying-robot-frame",
energy_required = 20,
ingredients = { { "electric-engine-unit", 1 }, { "battery", 2 }, { "steel-plate", 1 }, { "electronic-circuit", 3 } }
},
["logistic-chest-active-provider"] = {
enabled = "false",
type = "recipe",
name = "logistic-chest-active-provider",
ingredients = { { "smart-chest", 1 }, { "advanced-circuit", 1 } },
result = "logistic-chest-active-provider"
},
["basic-accumulator"] = {
enabled = "false",
type = "recipe",
name = "basic-accumulator",
ingredients = { { "iron-plate", 2 }, { "battery", 5 } },
result = "basic-accumulator"
},
["big-electric-pole"] = {
enabled = "false",
type = "recipe",
name = "big-electric-pole",
ingredients = { { "steel-plate", 5 }, { "copper-plate", 5 } },
result = "big-electric-pole"
},
["logistic-robot"] = {
enabled = "false",
type = "recipe",
name = "logistic-robot",
ingredients = { { "flying-robot-frame", 1 }, { "advanced-circuit", 2 } },
result = "logistic-robot"
},
["processing-unit"] = {
enabled = "false",
type = "recipe",
name = "processing-unit",
category = "crafting-with-fluid",
result = "processing-unit",
energy_required = 15,
ingredients = { { "electronic-circuit", 20 }, { "advanced-circuit", 2 }, {
type = "fluid",
name = "sulfuric-acid",
amount = 0.5
} }
},
["sulfuric-acid"] = {
enabled = "false",
type = "recipe",
name = "sulfuric-acid",
category = "chemistry",
ingredients = { {
type = "item",
name = "sulfur",
amount = 5
}, {
type = "item",
name = "iron-plate",
amount = 1
}, {
type = "fluid",
name = "water",
amount = 10
} },
energy_required = 1,
results = { {
type = "fluid",
name = "sulfuric-acid",
amount = 5
} }
},
blueprint = {
enabled = "false",
type = "recipe",
name = "blueprint",
result = "blueprint",
energy_required = 1,
ingredients = { { "advanced-circuit", 1 } }
},
["logistic-chest-passive-provider"] = {
enabled = "false",
type = "recipe",
name = "logistic-chest-passive-provider",
ingredients = { { "smart-chest", 1 }, { "advanced-circuit", 1 } },
result = "logistic-chest-passive-provider"
},
["construction-robot"] = {
enabled = "false",
type = "recipe",
name = "construction-robot",
ingredients = { { "flying-robot-frame", 1 }, { "electronic-circuit", 2 } },
result = "construction-robot"
},
["power-armor-mk2"] = {
enabled = "false",
type = "recipe",
name = "power-armor-mk2",
result = "power-armor-mk2",
energy_required = 25,
ingredients = { { "effectivity-module-3", 5 }, { "speed-module-3", 5 }, { "processing-unit", 200 }, { "steel-plate", 50 }, { "alien-artifact", 50 } }
},
["logistic-chest-storage"] = {
enabled = "false",
type = "recipe",
name = "logistic-chest-storage",
ingredients = { { "smart-chest", 1 }, { "advanced-circuit", 1 } },
result = "logistic-chest-storage"
},
["repair-pack"] = {
result = "repair-pack",
type = "recipe",
name = "repair-pack",
ingredients = { { "electronic-circuit", 1 }, { "iron-gear-wheel", 1 } }
},
["advanced-circuit"] = {
enabled = "false",
type = "recipe",
name = "advanced-circuit",
result = "advanced-circuit",
energy_required = 8,
ingredients = { { "electronic-circuit", 2 }, { "plastic-bar", 2 }, { "copper-cable", 4 } }
},
["slowdown-capsule"] = {
enabled = "false",
type = "recipe",
name = "slowdown-capsule",
result = "slowdown-capsule",
energy_required = 8,
ingredients = { { "steel-plate", 2 }, { "electronic-circuit", 2 }, { "coal", 5 } }
},
["basic-armor"] = {
enabled = "false",
type = "recipe",
name = "basic-armor",
result = "basic-armor",
energy_required = 3,
ingredients = { { "iron-plate", 40 } }
},
["fast-splitter"] = {
enabled = "false",
type = "recipe",
name = "fast-splitter",
result = "fast-splitter",
energy_required = 2,
ingredients = { { "electronic-circuit", 10 }, { "iron-gear-wheel", 10 }, { "fast-transport-belt", 4 } }
},
["basic-laser-defense-equipment"] = {
enabled = "false",
type = "recipe",
name = "basic-laser-defense-equipment",
result = "basic-laser-defense-equipment",
energy_required = 10,
ingredients = { { "processing-unit", 1 }, { "steel-plate", 5 }, { "laser-turret", 5 } }
},
["defender-capsule"] = {
enabled = "false",
type = "recipe",
name = "defender-capsule",
result = "defender-capsule",
energy_required = 8,
ingredients = { { "piercing-bullet-magazine", 1 }, { "electronic-circuit", 2 }, { "iron-gear-wheel", 3 } }
},
["speed-module-3"] = {
enabled = "false",
type = "recipe",
name = "speed-module-3",
result = "speed-module-3",
ingredients = { { "speed-module-2", 4 }, { "advanced-circuit", 5 }, { "processing-unit", 5 }, { "alien-artifact", 1 } },
energy_required = 60
},
["player-port"] = {
enabled = "false",
type = "recipe",
name = "player-port",
ingredients = { { "electronic-circuit", 10 }, { "iron-gear-wheel", 5 }, { "iron-plate", 1 } },
result = "player-port"
},
["express-transport-belt-to-ground"] = {
enabled = "false",
type = "recipe",
name = "express-transport-belt-to-ground",
result = "express-transport-belt-to-ground",
ingredients = { { "iron-gear-wheel", 40 }, { "fast-transport-belt-to-ground", 2 } },
result_count = 2
},
["fast-transport-belt-to-ground"] = {
enabled = "false",
type = "recipe",
name = "fast-transport-belt-to-ground",
result = "fast-transport-belt-to-ground",
ingredients = { { "iron-gear-wheel", 20 }, { "basic-transport-belt-to-ground", 2 } },
result_count = 2
},
["green-wire"] = {
enabled = "false",
type = "recipe",
name = "green-wire",
ingredients = { { "electronic-circuit", 1 }, { "copper-cable", 1 } },
result = "green-wire"
},
rocket = {
enabled = "false",
type = "recipe",
name = "rocket",
result = "rocket",
energy_required = 8,
ingredients = { { "electronic-circuit", 1 }, { "explosives", 2 }, { "iron-plate", 2 } }
},
["distractor-capsule"] = {
enabled = "false",
type = "recipe",
name = "distractor-capsule",
result = "distractor-capsule",
energy_required = 15,
ingredients = { { "defender-capsule", 4 }, { "advanced-circuit", 3 } }
},
["steel-chest"] = {
enabled = "false",
type = "recipe",
name = "steel-chest",
ingredients = { { "steel-plate", 8 } },
result = "steel-chest"
},
["iron-gear-wheel"] = {
result = "iron-gear-wheel",
type = "recipe",
name = "iron-gear-wheel",
ingredients = { { "iron-plate", 2 } }
},
["alien-science-pack"] = {
enabled = "false",
type = "recipe",
name = "alien-science-pack",
result_count = 10,
result = "alien-science-pack",
energy_required = 12,
ingredients = { { "alien-artifact", 1 } }
},
["assembling-machine-1"] = {
enabled = "false",
type = "recipe",
name = "assembling-machine-1",
ingredients = { { "electronic-circuit", 3 }, { "iron-gear-wheel", 5 }, { "iron-plate", 9 } },
result = "assembling-machine-1"
},
["burner-inserter"] = {
result = "burner-inserter",
type = "recipe",
name = "burner-inserter",
ingredients = { { "iron-plate", 1 }, { "iron-gear-wheel", 1 } }
},
["rocket-launcher"] = {
enabled = "false",
type = "recipe",
name = "rocket-launcher",
result = "rocket-launcher",
energy_required = 5,
ingredients = { { "iron-plate", 5 }, { "iron-gear-wheel", 5 }, { "electronic-circuit", 5 } }
},
["stone-brick"] = {
enabled = "true",
type = "recipe",
name = "stone-brick",
category = "smelting",
result = "stone-brick",
energy_required = 3.5,
ingredients = { { "stone", 2 } }
},
["science-pack-3"] = {
enabled = "false",
type = "recipe",
name = "science-pack-3",
result = "science-pack-3",
energy_required = 12,
ingredients = { { "battery", 1 }, { "advanced-circuit", 1 }, { "smart-inserter", 1 }, { "steel-plate", 1 } }
},
["basic-grenade"] = {
enabled = "false",
type = "recipe",
name = "basic-grenade",
result = "basic-grenade",
energy_required = 8,
ingredients = { { "iron-plate", 5 }, { "coal", 10 } }
},
["offshore-pump"] = {
result = "offshore-pump",
type = "recipe",
name = "offshore-pump",
ingredients = { { "electronic-circuit", 2 }, { "pipe", 1 }, { "iron-gear-wheel", 1 } }
},
["basic-mining-drill"] = {
type = "recipe",
name = "basic-mining-drill",
result = "basic-mining-drill",
energy_required = 2,
ingredients = { { "electronic-circuit", 3 }, { "iron-gear-wheel", 5 }, { "iron-plate", 10 } }
},
["railgun-dart"] = {
enabled = "false",
type = "recipe",
name = "railgun-dart",
result = "railgun-dart",
energy_required = 8,
ingredients = { { "steel-plate", 5 }, { "electronic-circuit", 5 } }
},
["science-pack-1"] = {
type = "recipe",
name = "science-pack-1",
result = "science-pack-1",
energy_required = 5,
ingredients = { { "copper-plate", 1 }, { "iron-gear-wheel", 1 } }
},
["steam-engine"] = {
result = "steam-engine",
type = "recipe",
name = "steam-engine",
ingredients = { { "iron-gear-wheel", 5 }, { "pipe", 5 }, { "iron-plate", 5 } }
},
["iron-plate"] = {
type = "recipe",
name = "iron-plate",
category = "smelting",
result = "iron-plate",
energy_required = 3.5,
ingredients = { { "iron-ore", 1 } }
},
["iron-chest"] = {
enabled = "true",
type = "recipe",
name = "iron-chest",
ingredients = { { "iron-plate", 8 } },
result = "iron-chest"
},
["science-pack-2"] = {
type = "recipe",
name = "science-pack-2",
result = "science-pack-2",
energy_required = 6,
ingredients = { { "basic-inserter", 1 }, { "basic-transport-belt", 1 } }
},
["productivity-module-3"] = {
enabled = "false",
type = "recipe",
name = "productivity-module-3",
result = "productivity-module-3",
ingredients = { { "productivity-module-2", 5 }, { "advanced-circuit", 5 }, { "processing-unit", 5 }, { "alien-artifact", 1 } },
energy_required = 60
},
["wooden-chest"] = {
result = "wooden-chest",
type = "recipe",
name = "wooden-chest",
ingredients = { { "wood", 4 } }
},
["basic-modular-armor"] = {
enabled = "false",
type = "recipe",
name = "basic-modular-armor",
result = "basic-modular-armor",
energy_required = 15,
ingredients = { { "advanced-circuit", 30 }, { "processing-unit", 5 }, { "steel-plate", 50 } }
},
["productivity-module-2"] = {
enabled = "false",
type = "recipe",
name = "productivity-module-2",
result = "productivity-module-2",
ingredients = { { "productivity-module", 4 }, { "advanced-circuit", 5 }, { "processing-unit", 5 } },
energy_required = 30
},
["heavy-oil-cracking"] = {
enabled = "false",
type = "recipe",
subgroup = "fluid",
order = "b[fluid-chemistry]-a[heavy-oil-cracking]",
main_product = "",
energy_required = 5,
name = "heavy-oil-cracking",
category = "chemistry",
icon = "__base__/graphics/icons/fluid/heavy-oil-cracking.png",
ingredients = { {
type = "fluid",
name = "heavy-oil",
amount = 4
}, {
type = "fluid",
name = "water",
amount = 3
} },
results = { {
type = "fluid",
name = "light-oil",
amount = 3
} }
},
["fill-crude-oil-barrel"] = {
enabled = "false",
type = "recipe",
subgroup = "barrel",
order = "b[fill-crude-oil-barrel]",
energy_required = 1,
name = "fill-crude-oil-barrel",
category = "crafting-with-fluid",
ingredients = { {
type = "fluid",
name = "crude-oil",
amount = 25
}, {
type = "item",
name = "empty-barrel",
amount = 1
} },
icon = "__base__/graphics/icons/fluid/fill-crude-oil-barrel.png",
results = { {
type = "item",
name = "crude-oil-barrel",
amount = 1
} }
},
lab = {
type = "recipe",
name = "lab",
result = "lab",
energy_required = 5,
ingredients = { { "electronic-circuit", 10 }, { "iron-gear-wheel", 10 }, { "basic-transport-belt", 4 } }
},
["iron-stick"] = {
result_count = 2,
type = "recipe",
name = "iron-stick",
ingredients = { { "iron-plate", 1 } },
result = "iron-stick"
},
["heavy-armor"] = {
enabled = "false",
type = "recipe",
name = "heavy-armor",
result = "heavy-armor",
energy_required = 8,
ingredients = { { "copper-plate", 100 }, { "steel-plate", 50 } }
},
["piercing-shotgun-shell"] = {
enabled = "false",
type = "recipe",
name = "piercing-shotgun-shell",
result = "piercing-shotgun-shell",
energy_required = 8,
ingredients = { { "copper-plate", 2 }, { "steel-plate", 2 } }
},
["empty-barrel"] = {
enabled = "false",
type = "recipe",
name = "empty-barrel",
category = "crafting",
subgroup = "barrel",
ingredients = { {
type = "item",
name = "steel-plate",
amount = 1
} },
energy_required = 1,
results = { {
type = "item",
name = "empty-barrel",
amount = 1
} }
},
sulfur = {
enabled = "false",
type = "recipe",
name = "sulfur",
category = "chemistry",
ingredients = { {
type = "fluid",
name = "petroleum-gas",
amount = 3
}, {
type = "fluid",
name = "water",
amount = 3
} },
energy_required = 1,
results = { {
type = "item",
name = "sulfur",
amount = 2
} }
},
["battery-equipment"] = {
enabled = "false",
type = "recipe",
name = "battery-equipment",
result = "battery-equipment",
energy_required = 10,
ingredients = { { "battery", 5 }, { "steel-plate", 10 } }
},
["small-lamp"] = {
enabled = "false",
type = "recipe",
name = "small-lamp",
ingredients = { { "electronic-circuit", 1 }, { "iron-stick", 3 }, { "iron-plate", 1 } },
result = "small-lamp"
}
},
["deconstruction-item"] = {
["deconstruction-planner"] = {
flags = { "goes-to-quickbar" },
type = "deconstruction-item",
name = "deconstruction-planner",
order = "c[automated-construction]-b[deconstruction-planner]",
stack_size = 1,
icon = "__base__/graphics/icons/deconstruction-planner.png",
subgroup = "tool"
}
},
["transport-belt-to-ground"] = {
["fast-transport-belt-to-ground"] = {
corpse = "small-remnants",
underground_sprite = {
x = 32,
filename = "__core__/graphics/arrows/underground-lines.png",
height = 32,
priority = "high",
width = 32
},
fast_replaceable_group = "transport-belt-to-ground",
collision_box = { { -0.4, -0.15 }, { 0.4, 0.1 } },
ending_patch = {
height = 40,
priority = "extra-high",
width = 40,
sheet = "__base__/graphics/entity/basic-transport-belt/start-end-integration-patches.png"
},
selection_box = { { -0.5, -0.25 }, { 0.5, 0.75 } },
distance_to_enter = 0.35,
speed = 0.0625,
icon = "__base__/graphics/icons/fast-transport-belt-to-ground.png",
belt_vertical = {
y = 40,
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
ending_bottom = {
y = 120,
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
type = "transport-belt-to-ground",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 4,
offset_deviation = { { -0.4, -0.15 }, { 0.4, 0.1 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
structure = {
direction_out = {
height = 43,
shift = { 0.26, 0 },
priority = "extra-high",
width = 57,
sheet = "__base__/graphics/entity/fast-transport-belt-to-ground/fast-transport-belt-to-ground-structure.png"
},
direction_in = {
y = 43,
height = 43,
shift = { 0.26, 0 },
priority = "extra-high",
width = 57,
sheet = "__base__/graphics/entity/fast-transport-belt-to-ground/fast-transport-belt-to-ground-structure.png"
}
},
starting_side = {
y = 280,
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
starting_bottom = {
y = 240,
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
ending_top = {
y = 80,
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
minable = {
result = "fast-transport-belt-to-ground",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "player-creation", "fast-replaceable-no-build-while-moving" },
ending_side = {
y = 160,
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
name = "fast-transport-belt-to-ground",
resistances = { {
percent = 60,
type = "fire"
} },
belt_horizontal = {
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
max_health = 60,
starting_top = {
y = 200,
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
animation_speed_coefficient = 32
},
["express-transport-belt-to-ground"] = {
corpse = "small-remnants",
underground_sprite = {
x = 32,
filename = "__core__/graphics/arrows/underground-lines.png",
height = 32,
priority = "high",
width = 32
},
fast_replaceable_group = "transport-belt-to-ground",
collision_box = { { -0.4, -0.15 }, { 0.4, 0.1 } },
ending_patch = {
height = 40,
priority = "extra-high",
width = 40,
sheet = "__base__/graphics/entity/basic-transport-belt/start-end-integration-patches.png"
},
selection_box = { { -0.5, -0.25 }, { 0.5, 0.75 } },
distance_to_enter = 0.35,
speed = 0.09375,
icon = "__base__/graphics/icons/express-transport-belt-to-ground.png",
belt_vertical = {
y = 40,
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
ending_bottom = {
y = 120,
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
type = "transport-belt-to-ground",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 4,
offset_deviation = { { -0.4, -0.15 }, { 0.4, 0.1 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
structure = {
direction_out = {
height = 43,
shift = { 0.26, 0 },
priority = "extra-high",
width = 57,
sheet = "__base__/graphics/entity/express-transport-belt-to-ground/express-transport-belt-to-ground-structure.png"
},
direction_in = {
y = 43,
height = 43,
shift = { 0.26, 0 },
priority = "extra-high",
width = 57,
sheet = "__base__/graphics/entity/express-transport-belt-to-ground/express-transport-belt-to-ground-structure.png"
}
},
starting_side = {
y = 280,
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
starting_bottom = {
y = 240,
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
ending_top = {
y = 80,
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
minable = {
result = "express-transport-belt-to-ground",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "player-creation", "fast-replaceable-no-build-while-moving" },
ending_side = {
y = 160,
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
name = "express-transport-belt-to-ground",
resistances = { {
percent = 60,
type = "fire"
} },
belt_horizontal = {
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
max_health = 60,
starting_top = {
y = 200,
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
animation_speed_coefficient = 32
},
["basic-transport-belt-to-ground"] = {
corpse = "small-remnants",
underground_sprite = {
x = 32,
filename = "__core__/graphics/arrows/underground-lines.png",
height = 32,
priority = "high",
width = 32
},
fast_replaceable_group = "transport-belt-to-ground",
max_distance = 5,
ending_patch = {
height = 40,
priority = "extra-high",
width = 40,
sheet = "__base__/graphics/entity/basic-transport-belt/start-end-integration-patches.png"
},
selection_box = { { -0.5, -0.25 }, { 0.5, 0.75 } },
distance_to_enter = 0.35,
speed = 0.03125,
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 4,
offset_deviation = { { -0.4, -0.15 }, { 0.4, 0.1 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
icon = "__base__/graphics/icons/basic-transport-belt-to-ground.png",
belt_vertical = {
y = 40,
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
ending_bottom = {
y = 120,
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
type = "transport-belt-to-ground",
structure = {
direction_out = {
height = 43,
shift = { 0.26, 0 },
priority = "extra-high",
width = 57,
sheet = "__base__/graphics/entity/basic-transport-belt-to-ground/basic-transport-belt-to-ground-structure.png"
},
direction_in = {
y = 43,
height = 43,
shift = { 0.26, 0 },
priority = "extra-high",
width = 57,
sheet = "__base__/graphics/entity/basic-transport-belt-to-ground/basic-transport-belt-to-ground-structure.png"
}
},
starting_side = {
y = 280,
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
collision_box = { { -0.4, -0.15 }, { 0.4, 0.1 } },
starting_bottom = {
y = 240,
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
ending_side = {
y = 160,
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
minable = {
result = "basic-transport-belt-to-ground",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "player-creation", "fast-replaceable-no-build-while-moving" },
ending_top = {
y = 80,
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
name = "basic-transport-belt-to-ground",
resistances = { {
percent = 60,
type = "fire"
} },
belt_horizontal = {
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
max_health = 70,
starting_top = {
y = 200,
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
animation_speed_coefficient = 32
}
},
locomotive = {
["diesel-locomotive"] = {
corpse = "medium-remnants",
front_light = { {
type = "oriented",
intensity = 0.6,
picture = {
filename = "__core__/graphics/light-cone.png",
scale = 2,
priority = "medium",
height = 200,
width = 200
},
shift = { -0.6, -16 },
minimum_darkness = 0.3,
size = 2
}, {
type = "oriented",
intensity = 0.6,
picture = {
filename = "__core__/graphics/light-cone.png",
scale = 2,
priority = "medium",
height = 200,
width = 200
},
shift = { 0.6, -16 },
minimum_darkness = 0.3,
size = 2
} },
connection_distance = 3.3,
max_speed = 1.2,
pictures = {
frame_height = 248,
line_length = 4,
axially_symmetrical = false,
frame_width = 346,
lines_per_file = 8,
shift = { 0.9, -0.45 },
priority = "very-low",
filenames = { "__base__/graphics/entity/diesel-locomotive/diesel-locomotive-01.png", "__base__/graphics/entity/diesel-locomotive/diesel-locomotive-02.png", "__base__/graphics/entity/diesel-locomotive/diesel-locomotive-03.png", "__base__/graphics/entity/diesel-locomotive/diesel-locomotive-04.png", "__base__/graphics/entity/diesel-locomotive/diesel-locomotive-05.png", "__base__/graphics/entity/diesel-locomotive/diesel-locomotive-06.png", "__base__/graphics/entity/diesel-locomotive/diesel-locomotive-07.png", "__base__/graphics/entity/diesel-locomotive/diesel-locomotive-08.png" },
direction_count = 256
},
selection_box = { { -0.85, -2.6 }, { 0.9, 2.5 } },
weight = 2000,
icon = "__base__/graphics/icons/diesel-locomotive.png",
friction_force = 0.0015,
max_power = "600kW",
minable = {
mining_time = 1,
result = "diesel-locomotive"
},
flags = { "placeable-neutral", "player-creation", "placeable-off-grid", "not-on-map" },
name = "diesel-locomotive",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 93,
offset_deviation = { { -0.6, -2.6 }, { 0.6, 2.6 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
max_health = 1000,
close_sound = {
filename = "__base__/sound/car-door-close.ogg",
volume = 0.7
},
air_resistance = 0.002,
braking_force = 10,
collision_box = { { -0.6, -2.6 }, { 0.6, 2.6 } },
drawing_box = { { -1, -4 }, { 1, 3 } },
back_light = { {
minimum_darkness = 0.3,
intensity = 0.6,
color = {
r = 1
},
shift = { -0.6, 3.5 },
size = 2
}, {
minimum_darkness = 0.3,
intensity = 0.6,
color = {
r = 1
},
shift = { 0.6, 3.5 },
size = 2
} },
drive_over_tie_trigger = {
sound = { {
filename = "__base__/sound/train-tie-1.ogg",
volume = 0.6
}, {
filename = "__base__/sound/train-tie-2.ogg",
volume = 0.6
}, {
filename = "__base__/sound/train-tie-3.ogg",
volume = 0.6
}, {
filename = "__base__/sound/train-tie-4.ogg",
volume = 0.6
} },
type = "play-sound"
},
joint_distance = 4.6,
rail_category = "regular",
energy_source = {
fuel_inventory_size = 3,
type = "burner",
smoke = { {
deviation = { 0.1, 0.1 },
slow_down_factor = 3,
starting_vertical_speed_deviation = 0.06,
starting_vertical_speed = 0.2,
starting_frame_speed_deviation = 5,
height_deviation = 0.2,
starting_frame_deviation = 5,
name = "smoke",
position = { 0, 0 },
height = 2,
starting_frame_speed = 0,
starting_frame = 1,
frequency = 210
} },
effectivity = 1
},
type = "locomotive",
tie_distance = 50,
sound_minimum_speed = 0.5,
open_sound = {
filename = "__base__/sound/car-door-open.ogg",
volume = 0.7
},
working_sound = {
sound = {
filename = "__base__/sound/train-engine.ogg",
volume = 0.4
},
match_speed_to_activity = true
},
crash_trigger = {
sound = { {
filename = "__base__/sound/car-crash.ogg",
volume = 0.8
} },
type = "play-sound"
},
stop_trigger = { {
entity_name = "smoke-train-stop",
type = "create-smoke",
offset_deviation = { { -0.75, -2.7 }, { -0.3, 2.7 } },
initial_height = 0,
speed = { -0.03, 0 },
repeat_count = 125,
speed_multiplier = 0.75,
speed_multiplier_deviation = 1.1
}, {
entity_name = "smoke-train-stop",
type = "create-smoke",
offset_deviation = { { 0.3, -2.7 }, { 0.75, 2.7 } },
initial_height = 0,
speed = { 0.03, 0 },
repeat_count = 125,
speed_multiplier = 0.75,
speed_multiplier_deviation = 1.1
}, {
sound = { {
filename = "__base__/sound/train-breaks.ogg",
volume = 0.6
} },
type = "play-sound"
} },
stand_by_light = { {
minimum_darkness = 0.3,
intensity = 0.5,
color = {
b = 1
},
shift = { -0.6, -3.5 },
size = 2
}, {
minimum_darkness = 0.3,
intensity = 0.5,
color = {
b = 1
},
shift = { 0.6, -3.5 },
size = 2
} },
energy_per_hit_point = 5,
dying_explosion = "huge-explosion"
}
},
armor = {
["heavy-armor"] = {
durability = 5000,
type = "armor",
subgroup = "armor",
order = "b[heavy-armor]",
flags = { "goes-to-main-inventory" },
name = "heavy-armor",
resistances = { {
decrease = 6,
type = "physical",
percent = 30
}, {
decrease = 10,
type = "explosion",
percent = 30
}, {
decrease = 5,
type = "acid",
percent = 30
} },
icon = "__base__/graphics/icons/heavy-armor.png",
stack_size = 10
},
["power-armor-mk2"] = {
durability = 20000,
type = "armor",
subgroup = "armor",
order = "e[power-armor-mk2]",
flags = { "goes-to-main-inventory" },
name = "power-armor-mk2",
resistances = { {
decrease = 10,
type = "physical",
percent = 40
}, {
decrease = 10,
type = "acid",
percent = 40
}, {
decrease = 20,
type = "explosion",
percent = 50
} },
equipment_grid = {
height = 10,
width = 10
},
icon = "__base__/graphics/icons/power-armor-mk2.png",
stack_size = 1
},
["basic-modular-armor"] = {
durability = 10000,
type = "armor",
subgroup = "armor",
order = "c[basic-modular-armor]",
flags = { "goes-to-main-inventory" },
name = "basic-modular-armor",
resistances = { {
decrease = 6,
type = "physical",
percent = 30
}, {
decrease = 5,
type = "acid",
percent = 30
}, {
decrease = 10,
type = "explosion",
percent = 30
} },
equipment_grid = {
height = 5,
width = 5
},
icon = "__base__/graphics/icons/basic-modular-armor.png",
stack_size = 1
},
["power-armor"] = {
durability = 15000,
type = "armor",
subgroup = "armor",
order = "d[power-armor]",
flags = { "goes-to-main-inventory" },
name = "power-armor",
resistances = { {
decrease = 8,
type = "physical",
percent = 30
}, {
decrease = 7,
type = "acid",
percent = 30
}, {
decrease = 15,
type = "explosion",
percent = 30
} },
equipment_grid = {
height = 7,
width = 7
},
icon = "__base__/graphics/icons/power-armor.png",
stack_size = 1
},
["basic-armor"] = {
durability = 1000,
type = "armor",
subgroup = "armor",
order = "a[basic-armor]",
flags = { "goes-to-main-inventory" },
name = "basic-armor",
resistances = { {
decrease = 3,
type = "physical",
percent = 20
}, {
decrease = 3,
type = "acid",
percent = 30
}, {
decrease = 2,
type = "explosion",
percent = 20
} },
icon = "__base__/graphics/icons/basic-armor.png",
stack_size = 10
}
},
blueprint = {
blueprint = {
flags = { "goes-to-quickbar" },
type = "blueprint",
name = "blueprint",
item_to_clear = "electronic-circuit",
order = "c[automated-construction]-a[blueprint]",
stack_size = 1,
icon = "__base__/graphics/icons/blueprint.png",
subgroup = "tool"
}
},
["damage-type"] = {
acid = {
name = "acid",
type = "damage-type"
},
physical = {
name = "physical",
type = "damage-type"
},
laser = {
name = "laser",
type = "damage-type"
},
poison = {
name = "poison",
type = "damage-type"
},
explosion = {
name = "explosion",
type = "damage-type"
},
fire = {
name = "fire",
type = "damage-type"
}
},
container = {
["big-ship-wreck-3"] = {
type = "container",
subgroup = "wrecks",
picture = {
height = 212,
shift = { 0.5, 0.6 },
filename = "__base__/graphics/entity/ship-wreck/big-ship-wreck-3.png",
width = 256
},
enable_inventory_bar = false,
collision_box = { { -0.9, -0.9 }, { 0.9, 0.9 } },
flags = { "placeable-neutral" },
selection_box = { { -2, -1.5 }, { 2, 1.5 } },
name = "big-ship-wreck-3",
inventory_size = 3,
max_health = 50,
icon = "__base__/graphics/icons/ship-wreck/big-ship-wreck-3.png",
order = "d[remnants]-d[ship-wreck]-a[big]-c"
},
["steel-chest"] = {
corpse = "small-remnants",
type = "container",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 7,
offset_deviation = { { -0.35, -0.35 }, { 0.35, 0.35 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
fast_replaceable_group = "container",
picture = {
filename = "__base__/graphics/entity/steel-chest/steel-chest.png",
height = 34,
priority = "extra-high",
shift = { 0.2, 0 },
width = 48
},
collision_box = { { -0.35, -0.35 }, { 0.35, 0.35 } },
inventory_size = 48,
minable = {
mining_time = 1,
result = "steel-chest"
},
flags = { "placeable-neutral", "player-creation" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "steel-chest",
resistances = { {
percent = 90,
type = "fire"
} },
close_sound = {
filename = "__base__/sound/metallic-chest-close.ogg",
volume = 0.7
},
max_health = 200,
icon = "__base__/graphics/icons/steel-chest.png",
open_sound = {
filename = "__base__/sound/metallic-chest-open.ogg",
volume = 0.65
}
},
["wooden-chest"] = {
corpse = "small-remnants",
type = "container",
fast_replaceable_group = "container",
close_sound = {
filename = "__base__/sound/wooden-chest-close.ogg"
},
collision_box = { { -0.35, -0.35 }, { 0.35, 0.35 } },
picture = {
filename = "__base__/graphics/entity/wooden-chest/wooden-chest.png",
height = 33,
priority = "extra-high",
shift = { 0.3, 0 },
width = 46
},
minable = {
mining_time = 1,
result = "wooden-chest"
},
flags = { "placeable-neutral", "player-creation" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "wooden-chest",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 7,
offset_deviation = { { -0.35, -0.35 }, { 0.35, 0.35 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
inventory_size = 16,
max_health = 50,
icon = "__base__/graphics/icons/wooden-chest.png",
open_sound = {
filename = "__base__/sound/wooden-chest-open.ogg"
}
},
["iron-chest"] = {
corpse = "small-remnants",
type = "container",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 7,
offset_deviation = { { -0.35, -0.35 }, { 0.35, 0.35 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
fast_replaceable_group = "container",
picture = {
filename = "__base__/graphics/entity/iron-chest/iron-chest.png",
height = 34,
priority = "extra-high",
shift = { 0.2, 0 },
width = 48
},
collision_box = { { -0.35, -0.35 }, { 0.35, 0.35 } },
inventory_size = 32,
minable = {
mining_time = 1,
result = "iron-chest"
},
flags = { "placeable-neutral", "player-creation" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "iron-chest",
resistances = { {
percent = 80,
type = "fire"
} },
close_sound = {
filename = "__base__/sound/metallic-chest-close.ogg",
volume = 0.7
},
max_health = 100,
icon = "__base__/graphics/icons/iron-chest.png",
open_sound = {
filename = "__base__/sound/metallic-chest-open.ogg",
volume = 0.65
}
},
["big-ship-wreck-2"] = {
type = "container",
subgroup = "wrecks",
picture = {
height = 129,
shift = { -0.5, 0.6 },
filename = "__base__/graphics/entity/ship-wreck/big-ship-wreck-2.png",
width = 164
},
enable_inventory_bar = false,
collision_box = { { -1.4, -1.2 }, { 1.4, 1.2 } },
flags = { "placeable-neutral" },
selection_box = { { -2, -1.5 }, { 2, 1.5 } },
name = "big-ship-wreck-2",
inventory_size = 3,
max_health = 50,
icon = "__base__/graphics/icons/ship-wreck/big-ship-wreck-2.png",
order = "d[remnants]-d[ship-wreck]-a[big]-b"
},
["space-module-wreck"] = {
type = "container",
subgroup = "wrecks",
picture = {
height = 96,
filename = "__base__/graphics/entity/space-module-wreck/wreck.png",
width = 168
},
order = "c-f",
collision_box = { { -2.2, -1 }, { 2.2, 1 } },
flags = { "placeable-neutral" },
selection_box = { { -2.7, -1.5 }, { 2.7, 1.5 } },
name = "space-module-wreck",
enable_inventory_bar = false,
max_health = 50,
icon = "__base__/graphics/icons/space-module-wreck.png",
inventory_size = 4
},
["big-ship-wreck-1"] = {
type = "container",
subgroup = "wrecks",
picture = {
height = 212,
shift = { 0.7, 0 },
filename = "__base__/graphics/entity/ship-wreck/big-ship-wreck-1.png",
width = 256
},
enable_inventory_bar = false,
collision_box = { { -2.2, -1.5 }, { 2.2, 1.5 } },
flags = { "placeable-neutral" },
selection_box = { { -2.7, -1.5 }, { 2.7, 1.5 } },
name = "big-ship-wreck-1",
inventory_size = 3,
max_health = 50,
icon = "__base__/graphics/icons/ship-wreck/big-ship-wreck-1.png",
order = "d[remnants]-d[ship-wreck]-a[big]-a"
}
},
furnace = {
["electric-furnace"] = {
corpse = "big-remnants",
fast_replaceable_group = "furnace",
collision_box = { { -1.2, -1.2 }, { 1.2, 1.2 } },
selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
source_inventory_size = 1,
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 86,
offset_deviation = { { -1.2, -1.2 }, { 1.2, 1.2 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
icon = "__base__/graphics/icons/electric-furnace.png",
light = {
intensity = 1,
size = 10
},
off_animation = {
frame_width = 131,
filename = "__base__/graphics/entity/electric-furnace/electric-furnace.png",
animation_speed = 0.5,
shift = { 0.5, 0.05 },
priority = "high",
frame_count = 1,
frame_height = 102
},
type = "furnace",
result_inventory_size = 1,
working_sound = {
sound = {
filename = "__base__/sound/electric-furnace.ogg",
volume = 0.7
},
apparent_volume = 1.5
},
energy_source = {
emissions = 0.005,
type = "electric",
usage_priority = "secondary-input"
},
smelting_speed = 2,
smelting_categories = { "smelting" },
minable = {
mining_time = 1,
result = "electric-furnace"
},
flags = { "placeable-neutral", "placeable-player", "player-creation" },
smelting_energy_consumption = "180kW",
name = "electric-furnace",
resistances = { {
percent = 80,
type = "fire"
} },
on_animation = {
frame_count = 12,
x = 131,
filename = "__base__/graphics/entity/electric-furnace/electric-furnace.png",
animation_speed = 0.5,
shift = { 0.5, 0.05 },
priority = "high",
frame_height = 102,
frame_width = 131
},
max_health = 150,
module_slots = 2,
dying_explosion = "huge-explosion"
},
["steel-furnace"] = {
corpse = "medium-remnants",
fast_replaceable_group = "furnace",
collision_box = { { -0.7, -0.7 }, { 0.7, 0.7 } },
selection_box = { { -0.8, -1 }, { 0.8, 1 } },
source_inventory_size = 1,
icon = "__base__/graphics/icons/steel-furnace.png",
result_inventory_size = 1,
type = "furnace",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 29,
offset_deviation = { { -0.7, -0.7 }, { 0.7, 0.7 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
fire_animation = {
frame_width = 36,
filename = "__base__/graphics/entity/steel-furnace/steel-furnace-fire.png",
shift = { -0.05, 0.65 },
priority = "high",
frame_count = 12,
frame_height = 19
},
off_animation = {
frame_width = 91,
filename = "__base__/graphics/entity/steel-furnace/steel-furnace.png",
shift = { 0.5, 0.05 },
priority = "high",
frame_count = 1,
frame_height = 69
},
energy_source = {
emissions = 0.02,
type = "burner",
smoke = { {
name = "smoke",
deviation = { 0.1, 0.1 },
position = { 0, 0 },
starting_vertical_speed = 0.05,
frequency = 0.5
} },
fuel_inventory_size = 1,
effectivity = 1
},
smelting_categories = { "smelting" },
minable = {
mining_time = 1,
result = "steel-furnace"
},
flags = { "placeable-neutral", "placeable-player", "player-creation" },
smelting_energy_consumption = "180kW",
name = "steel-furnace",
resistances = { {
percent = 100,
type = "fire"
} },
on_animation = {
frame_width = 91,
filename = "__base__/graphics/entity/steel-furnace/steel-furnace.png",
shift = { 0.5, 0.05 },
priority = "high",
frame_count = 1,
frame_height = 69
},
max_health = 200,
smelting_speed = 2,
working_sound = {
sound = {
filename = "__base__/sound/furnace.ogg"
}
}
},
["stone-furnace"] = {
corpse = "medium-remnants",
fast_replaceable_group = "furnace",
collision_box = { { -0.7, -0.7 }, { 0.7, 0.7 } },
selection_box = { { -0.8, -1 }, { 0.8, 1 } },
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 29,
offset_deviation = { { -0.7, -0.7 }, { 0.7, 0.7 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
repair_sound = {
filename = "__base__/sound/manual-repair-simple.ogg"
},
source_inventory_size = 1,
fire_animation = {
frame_width = 23,
filename = "__base__/graphics/entity/stone-furnace/stone-furnace-fire.png",
shift = { 0.078125, 0.5234375 },
priority = "extra-high",
frame_count = 12,
frame_height = 27
},
icon = "__base__/graphics/icons/stone-furnace.png",
result_inventory_size = 1,
off_animation = {
frame_width = 81,
filename = "__base__/graphics/entity/stone-furnace/stone-furnace.png",
shift = { 0.5, 0.05 },
priority = "extra-high",
frame_count = 1,
frame_height = 64
},
type = "furnace",
mined_sound = {
filename = "__base__/sound/deconstruct-bricks.ogg"
},
energy_source = {
fuel_inventory_size = 1,
type = "burner",
smoke = { {
name = "smoke",
deviation = { 0.1, 0.1 },
position = { 0, 0 },
starting_vertical_speed = 0.05,
frequency = 0.5
} },
emissions = 0.01,
effectivity = 1
},
smelting_speed = 1,
working_sound = {
sound = {
filename = "__base__/sound/furnace.ogg"
}
},
smelting_categories = { "smelting" },
minable = {
mining_time = 1,
result = "stone-furnace"
},
flags = { "placeable-neutral", "placeable-player", "player-creation" },
smelting_energy_consumption = "180kW",
name = "stone-furnace",
resistances = { {
percent = 80,
type = "fire"
}, {
percent = 30,
type = "explosion"
} },
on_animation = {
frame_width = 81,
filename = "__base__/graphics/entity/stone-furnace/stone-furnace.png",
shift = { 0.5, 0.05 },
priority = "extra-high",
frame_count = 1,
frame_height = 64
},
max_health = 150,
close_sound = {
filename = "__base__/sound/machine-close.ogg",
volume = 0.75
},
open_sound = {
filename = "__base__/sound/machine-open.ogg",
volume = 0.85
}
}
},
["map-settings"] = {
["map-settings"] = {
enemy_evolution = {
enabled = true,
pollution_factor = 3e-05,
destroy_factor = 0.005,
time_factor = 8e-06
},
type = "map-settings",
enemy_expansion = {
enabled = true,
settler_group_min_size = 5,
settler_group_max_size = 20,
min_player_base_distance = 3,
min_expansion_cooldown = 18000,
max_expansion_cooldown = 216000,
max_expansion_distance = 7,
min_base_spacing = 3
},
pollution = {
enabled = true,
ageing = 0.55,
min_to_show_per_chunk = 700,
min_to_diffuse = 15,
expected_max_per_chunk = 7000,
diffusion_ratio = 0.02
},
steering = {
default = {
separation_factor = 1.2,
radius = 1.2,
separation_force = 0.005,
force_unit_fuzzy_goto_behavior = false
},
moving = {
separation_factor = 3,
radius = 3,
separation_force = 0.01,
force_unit_fuzzy_goto_behavior = false
}
},
unit_group = {
max_wait_time_for_late_members = 7200,
min_group_radius = 5,
max_group_gathering_time = 36000,
tick_tolerance_when_member_arrives = 60,
min_group_gathering_time = 3600,
max_member_speedup_when_behind = 1.4,
max_group_radius = 30
},
name = "map-settings",
max_failed_behavior_count = 10,
path_finder = {
direct_distance_to_consider_short_request = 100,
short_cache_min_cacheable_distance = 10,
max_clients_to_accept_short_new_request = 10,
short_cache_size = 5,
short_cache_path_max_age = 600,
general_entity_collision_penalty = 10,
use_path_cache = true,
enemy_with_different_destination_collision_penalty = 30,
cache_max_age_spacing = 600,
long_cache_path_max_age = 108000,
goal_pressure_ratio = 2,
cache_accept_path_end_distance_ratio = 0.15,
long_cache_min_cacheable_distance = 30,
short_cache_min_algo_steps_to_cache = 50,
cache_last_connection_point = 50,
max_clients_to_accept_any_new_request = 10,
cache_keep_path_threshold = 0.5,
cache_path_end_distance_rating_multiplier = 20,
cache_absolute_path_credit = 1,
cache_path_start_distance_rating_multiplier = 10,
long_cache_size = 25,
cache_accept_path_start_distance_ratio = 0.2,
cache_per_node_path_credit = 0.001,
max_steps_worked_per_tick = 100,
cache_ageing = 0.05,
cache_max_connect_to_cache_steps = 100,
cache_num_connection_points = 5,
stale_enemy_with_same_destination_collision_penalty = 30,
fwd2bwd_ratio = 5,
cache_last_connection_point_ratio = 0.2,
ignore_moving_enemy_collision_distance = 5
}
}
},
sticker = {
["slowdown-sticker"] = {
flags = {},
type = "sticker",
name = "slowdown-sticker",
animation = {
frame_width = 11,
filename = "__base__/graphics/entity/slowdown-sticker/slowdown-sticker.png",
animation_speed = 0.4,
priority = "extra-high",
frame_count = 13,
frame_height = 11
},
magnitude = 0.5,
duration_in_ticks = 1800
}
},
tile = {
grass = {
autoplace = {
peaks = { {
octaves_difference = -1,
noise_persistence = 0.7,
influence = 0.1,
noise_layer = "grass"
}, {
temperature_max_range = 22.5,
water_optimal = 0.6,
influence = 1,
water_range = 0.2,
water_max_range = 0.3,
min_influence = 0,
temperature_range = 17.5,
temperature_optimal = 17.5
} }
},
type = "tile",
name = "grass",
collision_mask = { "ground-tile" },
map_color = {
b = 17,
g = 51,
r = 61
},
layer = 20,
variants = {
side = {
count = 8,
picture = "__base__/graphics/terrain/grass/grass-side.png"
},
outer_corner = {
count = 8,
picture = "__base__/graphics/terrain/grass/grass-outer-corner.png"
},
main = { {
size = 1,
count = 16,
picture = "__base__/graphics/terrain/grass/grass1.png"
}, {
count = 20,
picture = "__base__/graphics/terrain/grass/grass2.png",
weights = { 0.15, 0.15, 0.15, 0.15, 0.018, 0.02, 0.015, 0.025, 0.015, 0.02, 0.025, 0.015, 0.025, 0.025, 0.01, 0.025, 0.02, 0.025, 0.025, 0.01 },
probability = 0.91,
size = 2
}, {
count = 20,
picture = "__base__/graphics/terrain/grass/grass4.png",
line_length = 10,
weights = { 0.1, 0.8, 0.8, 0.1, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 },
probability = 1,
size = 4
} },
inner_corner = {
count = 8,
picture = "__base__/graphics/terrain/grass/grass-inner-corner.png"
}
},
walking_sound = { {
filename = "__base__/sound/walking/grass-01.ogg",
volume = 0.8
}, {
filename = "__base__/sound/walking/grass-02.ogg",
volume = 0.8
}, {
filename = "__base__/sound/walking/grass-03.ogg",
volume = 0.8
}, {
filename = "__base__/sound/walking/grass-04.ogg",
volume = 0.8
} }
},
sand = {
autoplace = {
peaks = { {
octaves_difference = -1,
noise_persistence = 0.7,
influence = 0.1,
noise_layer = "sand"
}, {
temperature_max_range = 22.5,
water_optimal = 0.1,
influence = 1,
water_range = 0.1,
water_max_range = 0.2,
min_influence = 0,
temperature_range = 17.5,
temperature_optimal = 17.5
} }
},
type = "tile",
name = "sand",
collision_mask = { "ground-tile" },
map_color = {
b = 54,
g = 126,
r = 160
},
layer = 35,
variants = {
side = {
count = 8,
picture = "__base__/graphics/terrain/sand/sand-side.png"
},
outer_corner = {
count = 8,
picture = "__base__/graphics/terrain/sand/sand-outer-corner.png"
},
main = { {
size = 1,
count = 16,
picture = "__base__/graphics/terrain/sand/sand1.png"
}, {
count = 16,
picture = "__base__/graphics/terrain/sand/sand2.png",
weights = { 0.025, 0.01, 0.013, 0.025, 0.025, 0.1, 0.1, 0.005, 0.01, 0.01, 0.005, 0.005, 0.001, 0.015, 0.02, 0.02 },
probability = 0.39,
size = 2
}, {
count = 22,
picture = "__base__/graphics/terrain/sand/sand4.png",
line_length = 11,
weights = { 0.09, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.025, 0.125, 0.005, 0.01, 0.1, 0.1, 0.01, 0.02, 0.02, 0.01, 0.1, 0.025, 0.1, 0.1, 0.1 },
probability = 1,
size = 4
} },
inner_corner = {
count = 8,
picture = "__base__/graphics/terrain/sand/sand-inner-corner.png"
}
},
walking_sound = { {
filename = "__base__/sound/walking/sand-01.ogg",
volume = 0.8
}, {
filename = "__base__/sound/walking/sand-02.ogg",
volume = 0.8
}, {
filename = "__base__/sound/walking/sand-03.ogg",
volume = 0.8
}, {
filename = "__base__/sound/walking/sand-04.ogg",
volume = 0.8
} }
},
["water-green"] = {
autoplace = {
peaks = { {
elevation_max_range = 5000,
elevation_range = 5000,
influence = 1000,
elevation_optimal = -5000
}, {
temperature_max_range = 15,
water_optimal = 0.85,
influence = 1,
water_range = 0.15,
water_max_range = 0.25,
min_influence = 0,
temperature_range = 10,
temperature_optimal = 25
} }
},
type = "tile",
name = "water-green",
collision_mask = { "water-tile", "item-layer", "resource-layer", "player-layer", "doodad-layer" },
map_color = {
b = 18,
g = 48,
r = 31
},
layer = 40,
variants = {
side = {
count = 8,
picture = "__base__/graphics/terrain/water-green/water-green-side.png"
},
outer_corner = {
count = 6,
picture = "__base__/graphics/terrain/water-green/water-green-outer-corner.png"
},
main = { {
size = 1,
count = 8,
picture = "__base__/graphics/terrain/water-green/water-green1.png"
}, {
size = 2,
count = 8,
picture = "__base__/graphics/terrain/water-green/water-green2.png"
}, {
size = 4,
count = 6,
picture = "__base__/graphics/terrain/water-green/water-green4.png"
} },
inner_corner = {
count = 6,
picture = "__base__/graphics/terrain/water-green/water-green-inner-corner.png"
}
},
allowed_neighbors = { "grass" }
},
["sand-dark"] = {
autoplace = {
peaks = { {
octaves_difference = -1,
noise_persistence = 0.7,
influence = 0.1,
noise_layer = "sand-dark"
}, {
temperature_max_range = 25,
water_optimal = 0.2,
influence = 1,
water_range = 0.1,
water_max_range = 0.2,
min_influence = 0,
temperature_range = 20,
temperature_optimal = 15
} }
},
type = "tile",
name = "sand-dark",
collision_mask = { "ground-tile" },
map_color = {
b = 39,
g = 104,
r = 139
},
layer = 36,
variants = {
side = {
count = 8,
picture = "__base__/graphics/terrain/sand-dark/sand-dark-side.png"
},
outer_corner = {
count = 8,
picture = "__base__/graphics/terrain/sand-dark/sand-dark-outer-corner.png"
},
main = { {
size = 1,
count = 16,
picture = "__base__/graphics/terrain/sand-dark/sand-dark1.png"
}, {
count = 16,
picture = "__base__/graphics/terrain/sand-dark/sand-dark2.png",
weights = { 0.025, 0.01, 0.013, 0.025, 0.025, 0.1, 0.1, 0.005, 0.01, 0.01, 0.005, 0.005, 0.001, 0.015, 0.02, 0.02 },
probability = 0.39,
size = 2
}, {
count = 22,
picture = "__base__/graphics/terrain/sand-dark/sand-dark4.png",
line_length = 11,
weights = { 0.09, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.025, 0.125, 0.005, 0.01, 0.1, 0.1, 0.01, 0.02, 0.02, 0.01, 0.1, 0.025, 0.1, 0.1, 0.1 },
probability = 1,
size = 4
} },
inner_corner = {
count = 8,
picture = "__base__/graphics/terrain/sand-dark/sand-dark-inner-corner.png"
}
},
walking_sound = { {
filename = "__base__/sound/walking/sand-01.ogg",
volume = 0.8
}, {
filename = "__base__/sound/walking/sand-02.ogg",
volume = 0.8
}, {
filename = "__base__/sound/walking/sand-03.ogg",
volume = 0.8
}, {
filename = "__base__/sound/walking/sand-04.ogg",
volume = 0.8
} }
},
water = {
autoplace = {
peaks = { {
elevation_max_range = 5000,
elevation_range = 5000,
influence = 1000,
elevation_optimal = -5000
}, {
influence = 1
} }
},
type = "tile",
name = "water",
collision_mask = { "water-tile", "item-layer", "resource-layer", "player-layer", "doodad-layer" },
map_color = {
b = 0.4196,
g = 0.3568,
r = 0.0941
},
layer = 40,
variants = {
side = {
count = 8,
picture = "__base__/graphics/terrain/water/water-side.png"
},
outer_corner = {
count = 6,
picture = "__base__/graphics/terrain/water/water-outer-corner.png"
},
main = { {
size = 1,
count = 8,
picture = "__base__/graphics/terrain/water/water1.png"
}, {
size = 2,
count = 8,
picture = "__base__/graphics/terrain/water/water2.png"
}, {
size = 4,
count = 6,
picture = "__base__/graphics/terrain/water/water4.png"
} },
inner_corner = {
count = 6,
picture = "__base__/graphics/terrain/water/water-inner-corner.png"
}
},
allowed_neighbors = { "grass" }
},
["grass-medium"] = {
autoplace = {
peaks = { {
octaves_difference = -1,
noise_persistence = 0.7,
influence = 0.1,
noise_layer = "grass-medium"
}, {
temperature_max_range = 17.5,
water_optimal = 0.85,
influence = 1,
water_range = 0.15,
water_max_range = 0.25,
min_influence = 0,
temperature_range = 12.5,
temperature_optimal = 22.5
} }
},
type = "tile",
name = "grass-medium",
collision_mask = { "ground-tile" },
map_color = {
b = 19,
g = 47,
r = 58
},
layer = 5,
variants = {
side = {
count = 8,
picture = "__base__/graphics/terrain/grass-medium/grass-medium-side.png"
},
outer_corner = {
count = 8,
picture = "__base__/graphics/terrain/grass-medium/grass-medium-outer-corner.png"
},
main = { {
size = 1,
count = 8,
picture = "__base__/graphics/terrain/grass-medium/grass-medium1.png"
}, {
count = 20,
picture = "__base__/graphics/terrain/grass-medium/grass-medium2.png",
weights = { 0.15, 0.15, 0.15, 0.15, 0.018, 0.02, 0.015, 0.025, 0.015, 0.02, 0.025, 0.015, 0.025, 0.025, 0.01, 0.025, 0.02, 0.025, 0.025, 0.01 },
probability = 0.91,
size = 2
}, {
count = 20,
picture = "__base__/graphics/terrain/grass-medium/grass-medium4.png",
line_length = 10,
weights = { 0.1, 0.8, 0.8, 0.1, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 },
probability = 1,
size = 4
} },
inner_corner = {
count = 8,
picture = "__base__/graphics/terrain/grass-medium/grass-medium-inner-corner.png"
}
},
walking_sound = { {
filename = "__base__/sound/walking/grass-01.ogg",
volume = 0.8
}, {
filename = "__base__/sound/walking/grass-02.ogg",
volume = 0.8
}, {
filename = "__base__/sound/walking/grass-03.ogg",
volume = 0.8
}, {
filename = "__base__/sound/walking/grass-04.ogg",
volume = 0.8
} }
},
dirt = {
autoplace = {
peaks = { {
octaves_difference = -1,
noise_persistence = 0.7,
influence = 0.1,
noise_layer = "dirt"
}, {
temperature_max_range = 27.5,
water_optimal = 0.2,
influence = 0.95,
water_range = 0.2,
water_max_range = 0.3,
min_influence = 0,
temperature_range = 22.5,
temperature_optimal = 12.5
} }
},
type = "tile",
name = "dirt",
collision_mask = { "ground-tile" },
map_color = {
b = 34,
g = 91,
r = 132
},
layer = 25,
variants = {
side = {
count = 8,
picture = "__base__/graphics/terrain/dirt/dirt-side.png"
},
outer_corner = {
count = 8,
picture = "__base__/graphics/terrain/dirt/dirt-outer-corner.png"
},
main = { {
size = 1,
weights = { 0.085, 0.085, 0.085, 0.085, 0.087, 0.085, 0.065, 0.085, 0.045, 0.045, 0.045, 0.045, 0.005, 0.025, 0.045, 0.045, 0.005, 0.005, 0.005, 0.005, 0.003, 0.005 },
count = 22,
picture = "__base__/graphics/terrain/dirt/dirt1.png"
}, {
count = 30,
picture = "__base__/graphics/terrain/dirt/dirt2.png",
weights = { 0.07, 0.07, 0.025, 0.07, 0.07, 0.07, 0.007, 0.025, 0.07, 0.05, 0.015, 0.026, 0.03, 0.005, 0.07, 0.027, 0.022, 0.032, 0.02, 0.02, 0.03, 0.005, 0.01, 0.002, 0.013, 0.007, 0.007, 0.01, 0.03, 0.03 },
probability = 1,
size = 2
}, {
count = 21,
picture = "__base__/graphics/terrain/dirt/dirt4.png",
line_length = 11,
weights = { 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.015, 0.07, 0.07, 0.07, 0.015, 0.05, 0.07, 0.07, 0.065, 0.07, 0.07, 0.05, 0.05, 0.05, 0.05 },
probability = 1,
size = 4
} },
inner_corner = {
count = 8,
picture = "__base__/graphics/terrain/dirt/dirt-inner-corner.png"
}
},
walking_sound = { {
filename = "__base__/sound/walking/dirt-02.ogg",
volume = 0.8
}, {
filename = "__base__/sound/walking/dirt-03.ogg",
volume = 0.8
}, {
filename = "__base__/sound/walking/dirt-04.ogg",
volume = 0.8
} }
},
deepwater = {
autoplace = {
peaks = { {
elevation_max_range = 5000,
elevation_range = 5000,
influence = 1250,
elevation_optimal = -5250
}, {
influence = 1
} }
},
type = "tile",
name = "deepwater",
collision_mask = { "water-tile", "resource-layer", "item-layer", "player-layer", "doodad-layer" },
map_color = {
b = 0.345,
g = 0.2823,
r = 0.0941
},
layer = 45,
variants = {
side = {
count = 8,
picture = "__base__/graphics/terrain/deepwater/deepwater-side.png"
},
outer_corner = {
count = 6,
picture = "__base__/graphics/terrain/deepwater/deepwater-outer-corner.png"
},
main = { {
size = 1,
count = 8,
picture = "__base__/graphics/terrain/deepwater/deepwater1.png"
}, {
size = 2,
count = 8,
picture = "__base__/graphics/terrain/deepwater/deepwater2.png"
}, {
size = 4,
count = 6,
picture = "__base__/graphics/terrain/deepwater/deepwater4.png"
} },
inner_corner = {
count = 6,
picture = "__base__/graphics/terrain/deepwater/deepwater-inner-corner.png"
}
},
allowed_neighbors = { "water" }
},
["out-of-map"] = {
type = "tile",
name = "out-of-map",
collision_mask = { "ground-tile", "water-tile", "resource-layer", "floor-layer", "item-layer", "object-layer", "player-layer", "doodad-layer" },
layer = 60,
variants = {
side = {
count = 0,
picture = "__base__/graphics/terrain/out-of-map-side.png"
},
outer_corner = {
count = 0,
picture = "__base__/graphics/terrain/out-of-map-outer-corner.png"
},
main = { {
size = 1,
count = 1,
picture = "__base__/graphics/terrain/out-of-map.png"
} },
inner_corner = {
count = 0,
picture = "__base__/graphics/terrain/out-of-map-inner-corner.png"
}
},
map_color = {
b = 0,
g = 0,
r = 0
}
},
["dirt-dark"] = {
autoplace = {
peaks = { {
octaves_difference = -1,
noise_persistence = 0.7,
influence = 0.1,
noise_layer = "dirt-dark"
}, {
temperature_max_range = 27.5,
water_optimal = 0.2,
influence = 0.5,
water_range = 0.2,
water_max_range = 0.3,
min_influence = 0,
temperature_range = 22.5,
temperature_optimal = 12.5
} }
},
type = "tile",
name = "dirt-dark",
collision_mask = { "ground-tile" },
map_color = {
b = 29,
g = 80,
r = 115
},
layer = 26,
variants = {
side = {
count = 8,
picture = "__base__/graphics/terrain/dirt-dark/dirt-dark-side.png"
},
outer_corner = {
count = 8,
picture = "__base__/graphics/terrain/dirt-dark/dirt-dark-outer-corner.png"
},
main = { {
size = 1,
weights = { 0.085, 0.085, 0.085, 0.085, 0.087, 0.085, 0.065, 0.085, 0.045, 0.045, 0.045, 0.045, 0.005, 0.025, 0.045, 0.045, 0.005, 0.005, 0.005, 0.005, 0.003, 0.005 },
count = 22,
picture = "__base__/graphics/terrain/dirt-dark/dirt-dark1.png"
}, {
count = 30,
picture = "__base__/graphics/terrain/dirt-dark/dirt-dark2.png",
weights = { 0.07, 0.07, 0.025, 0.07, 0.07, 0.07, 0.007, 0.025, 0.07, 0.05, 0.015, 0.026, 0.03, 0.005, 0.07, 0.027, 0.022, 0.032, 0.02, 0.02, 0.03, 0.005, 0.01, 0.002, 0.013, 0.007, 0.007, 0.01, 0.03, 0.03 },
probability = 0.94,
size = 2
}, {
count = 21,
picture = "__base__/graphics/terrain/dirt-dark/dirt-dark4.png",
line_length = 11,
weights = { 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.015, 0.07, 0.07, 0.07, 0.015, 0.05, 0.07, 0.07, 0.065, 0.07, 0.07, 0.05, 0.05, 0.05, 0.05 },
probability = 1,
size = 4
} },
inner_corner = {
count = 8,
picture = "__base__/graphics/terrain/dirt-dark/dirt-dark-inner-corner.png"
}
},
walking_sound = { {
filename = "__base__/sound/walking/dirt-02.ogg",
volume = 0.8
}, {
filename = "__base__/sound/walking/dirt-03.ogg",
volume = 0.8
}, {
filename = "__base__/sound/walking/dirt-04.ogg",
volume = 0.8
} }
},
["deepwater-green"] = {
autoplace = {
peaks = { {
elevation_max_range = 5000,
elevation_range = 5000,
influence = 1250,
elevation_optimal = -5250
}, {
temperature_max_range = 15,
water_optimal = 0.85,
influence = 1,
water_range = 0.15,
water_max_range = 0.25,
min_influence = 0,
temperature_range = 10,
temperature_optimal = 25
} }
},
type = "tile",
name = "deepwater-green",
collision_mask = { "water-tile", "resource-layer", "item-layer", "player-layer", "doodad-layer" },
map_color = {
b = 0.066,
g = 0.149,
r = 0.0941
},
layer = 45,
variants = {
side = {
count = 8,
picture = "__base__/graphics/terrain/deepwater-green/deepwater-green-side.png"
},
outer_corner = {
count = 6,
picture = "__base__/graphics/terrain/deepwater-green/deepwater-green-outer-corner.png"
},
main = { {
size = 1,
count = 8,
picture = "__base__/graphics/terrain/deepwater-green/deepwater-green1.png"
}, {
size = 2,
count = 8,
picture = "__base__/graphics/terrain/deepwater-green/deepwater-green2.png"
}, {
size = 4,
count = 6,
picture = "__base__/graphics/terrain/deepwater-green/deepwater-green4.png"
} },
inner_corner = {
count = 6,
picture = "__base__/graphics/terrain/deepwater-green/deepwater-green-inner-corner.png"
}
},
allowed_neighbors = { "water-green" }
},
["grass-dry"] = {
autoplace = {
peaks = { {
octaves_difference = -1,
noise_persistence = 0.7,
influence = 0.1,
noise_layer = "grass-dry"
}, {
temperature_max_range = 17.5,
water_optimal = 0.4,
influence = 1,
water_range = 0.1,
water_max_range = 0.2,
min_influence = 0,
temperature_range = 12.5,
temperature_optimal = 22.5
}, {
temperature_max_range = 12.5,
water_optimal = 0.35,
influence = 1,
water_range = 0.25,
water_max_range = 0.35,
min_influence = 0,
temperature_range = 7.5,
temperature_optimal = -2.5
} }
},
type = "tile",
name = "grass-dry",
collision_mask = { "ground-tile" },
map_color = {
b = 14,
g = 38,
r = 53
},
layer = 4,
variants = {
side = {
count = 8,
picture = "__base__/graphics/terrain/grass-dry/grass-dry-side.png"
},
outer_corner = {
count = 8,
picture = "__base__/graphics/terrain/grass-dry/grass-dry-outer-corner.png"
},
main = { {
size = 1,
count = 8,
picture = "__base__/graphics/terrain/grass-dry/grass-dry1.png"
}, {
count = 16,
picture = "__base__/graphics/terrain/grass-dry/grass-dry2.png",
weights = { 0.018, 0.02, 0.015, 0.025, 0.015, 0.02, 0.025, 0.015, 0.025, 0.025, 0.01, 0.025, 0.02, 0.025, 0.025, 0.01 },
probability = 0.91,
size = 2
}, {
count = 20,
picture = "__base__/graphics/terrain/grass-dry/grass-dry4.png",
line_length = 10,
weights = { 0.1, 0.8, 0.8, 0.1, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 },
probability = 1,
size = 4
} },
inner_corner = {
count = 8,
picture = "__base__/graphics/terrain/grass-dry/grass-dry-inner-corner.png"
}
},
walking_sound = { {
filename = "__base__/sound/walking/grass-01.ogg",
volume = 0.8
}, {
filename = "__base__/sound/walking/grass-02.ogg",
volume = 0.8
}, {
filename = "__base__/sound/walking/grass-03.ogg",
volume = 0.8
}, {
filename = "__base__/sound/walking/grass-04.ogg",
volume = 0.8
} }
}
},
["electric-pole"] = {
substation = {
corpse = "medium-remnants",
green_wire_picture = {
height = 46,
priority = "high",
filename = "__base__/graphics/entity/small-electric-pole/green-wire.png",
width = 224
},
radius_visualisation_picture = {
height = 12,
filename = "__base__/graphics/entity/small-electric-pole/electric-pole-radius-visualization.png",
width = 12
},
collision_box = { { -0.9, -0.9 }, { 0.9, 0.9 } },
drawing_box = { { -1, -1.5 }, { 1, 1 } },
selection_box = { { -1, -1 }, { 1, 1 } },
supply_area_distance = 7,
icon = "__base__/graphics/icons/substation.png",
type = "electric-pole",
copper_wire_picture = {
height = 46,
priority = "high",
filename = "__base__/graphics/entity/small-electric-pole/copper-wire.png",
width = 224
},
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 48,
offset_deviation = { { -0.9, -0.9 }, { 0.9, 0.9 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
red_wire_picture = {
height = 46,
priority = "high",
filename = "__base__/graphics/entity/small-electric-pole/red-wire.png",
width = 224
},
wire_shadow_picture = {
height = 46,
priority = "high",
filename = "__base__/graphics/entity/small-electric-pole/wire-shadow.png",
width = 224
},
minable = {
result = "substation",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "player-creation" },
connection_points = { {
wire = {
red = { 0.35, -2.65 },
copper = { -0.23, -2.65 },
green = { -0.85, -2.65 }
},
shadow = {
red = { 2.65, -0.6 },
copper = { 1.9, -0.6 },
green = { 1.3, -0.6 }
}
}, {
wire = {
red = { 0.17, -2.47 },
copper = { -0.26, -2.71 },
green = { -0.67, -3 }
},
shadow = {
red = { 2.5, -0.35 },
copper = { 1.9, -0.6 },
green = { 1.2, -0.8 }
}
}, {
wire = {
red = { -0.23, -2.35 },
copper = { -0.23, -2.7 },
green = { -0.23, -3.2 }
},
shadow = {
red = { 1.9, -0.3 },
copper = { 1.9, -0.6 },
green = { 1.9, -0.9 }
}
}, {
wire = {
red = { 0.25, -2.98 },
copper = { -0.2, -2.7 },
green = { -0.62, -2.45 }
},
shadow = {
red = { 2.4, -1.15 },
copper = { 1.8, -0.7 },
green = { 1.3, -0.6 }
}
} },
name = "substation",
resistances = { {
percent = 90,
type = "fire"
} },
working_sound = {
sound = {
filename = "__base__/sound/substation.ogg"
},
apparent_volume = 1.5
},
max_health = 200,
pictures = {
axially_symmetrical = false,
frame_width = 132,
filename = "__base__/graphics/entity/substation/substation.png",
shift = { 0.9, -1 },
priority = "high",
direction_count = 4,
frame_height = 144
},
maximum_wire_distance = 14
},
["medium-electric-pole"] = {
corpse = "small-remnants",
green_wire_picture = {
height = 46,
priority = "high",
filename = "__base__/graphics/entity/small-electric-pole/green-wire.png",
width = 224
},
radius_visualisation_picture = {
height = 12,
filename = "__base__/graphics/entity/small-electric-pole/electric-pole-radius-visualization.png",
width = 12
},
collision_box = { { -0.15, -0.15 }, { 0.15, 0.15 } },
drawing_box = { { -0.5, -2.8 }, { 0.5, 0.5 } },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
supply_area_distance = 3.5,
icon = "__base__/graphics/icons/medium-electric-pole.png",
type = "electric-pole",
copper_wire_picture = {
height = 46,
priority = "high",
filename = "__base__/graphics/entity/small-electric-pole/copper-wire.png",
width = 224
},
red_wire_picture = {
height = 46,
priority = "high",
filename = "__base__/graphics/entity/small-electric-pole/red-wire.png",
width = 224
},
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 4,
offset_deviation = { { -0.15, -0.15 }, { 0.15, 0.15 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
minable = {
result = "medium-electric-pole",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "player-creation" },
wire_shadow_picture = {
height = 46,
priority = "high",
filename = "__base__/graphics/entity/small-electric-pole/wire-shadow.png",
width = 224
},
name = "medium-electric-pole",
resistances = { {
percent = 100,
type = "fire"
} },
connection_points = { {
wire = {
red = { 0.25, -2.5 },
copper = { -0.03, -2.5 },
green = { -0.35, -2.5 }
},
shadow = {
red = { 3.05, 0.4 },
copper = { 2.55, 0.4 },
green = { 2, 0.4 }
}
}, {
wire = {
red = { 0.25, -2.55 },
copper = { 0.05, -2.75 },
green = { -0.15, -2.9 }
},
shadow = {
red = { 3.25, 0.35 },
copper = { 2.9, 0.1 },
green = { 2.6, -0.15 }
}
}, {
wire = {
red = { -0.43, -2.2 },
copper = { -0.43, -2.4 },
green = { -0.43, -2.63 }
},
shadow = {
red = { 1.5, 0.1 },
copper = { 1.5, -0.2 },
green = { 1.5, -0.55 }
}
}, {
wire = {
red = { -0.24, -2.55 },
copper = { 0, -2.7 },
green = { 0.22, -2.85 }
},
shadow = {
red = { 2.45, 0.4 },
copper = { 2.88, 0.2 },
green = { 3.2, -0.1 }
}
} },
max_health = 100,
pictures = {
axially_symmetrical = false,
frame_width = 136,
filename = "__base__/graphics/entity/medium-electric-pole/medium-electric-pole.png",
shift = { 1.4, -1 },
priority = "high",
direction_count = 4,
frame_height = 122
},
maximum_wire_distance = 9
},
["big-electric-pole"] = {
corpse = "medium-remnants",
green_wire_picture = {
height = 46,
priority = "high",
filename = "__base__/graphics/entity/small-electric-pole/green-wire.png",
width = 224
},
radius_visualisation_picture = {
height = 12,
filename = "__base__/graphics/entity/small-electric-pole/electric-pole-radius-visualization.png",
width = 12
},
collision_box = { { -0.7, -0.7 }, { 0.7, 0.7 } },
drawing_box = { { -2.8, -0.5 }, { 0.5, 0.5 } },
selection_box = { { -1, -1 }, { 1, 1 } },
supply_area_distance = 2,
icon = "__base__/graphics/icons/big-electric-pole.png",
type = "electric-pole",
copper_wire_picture = {
height = 46,
priority = "high",
filename = "__base__/graphics/entity/small-electric-pole/copper-wire.png",
width = 224
},
red_wire_picture = {
height = 46,
priority = "high",
filename = "__base__/graphics/entity/small-electric-pole/red-wire.png",
width = 224
},
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 29,
offset_deviation = { { -0.7, -0.7 }, { 0.7, 0.7 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
minable = {
result = "big-electric-pole",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "player-creation" },
wire_shadow_picture = {
height = 46,
priority = "high",
filename = "__base__/graphics/entity/small-electric-pole/wire-shadow.png",
width = 224
},
name = "big-electric-pole",
resistances = { {
percent = 100,
type = "fire"
} },
connection_points = { {
wire = {
red = { 0.6, -3.1 },
copper = { 0, -3.1 },
green = { -0.6, -3.1 }
},
shadow = {
red = { 3.6, 0 },
copper = { 2.7, 0 },
green = { 1.8, 0 }
}
}, {
wire = {
red = { 0.3, -2.87 },
copper = { -0.08, -3.15 },
green = { -0.55, -3.5 }
},
shadow = {
red = { 3.8, 0.6 },
copper = { 3.1, 0.2 },
green = { 2.3, -0.3 }
}
}, {
wire = {
red = { -0.1, -2.8 },
copper = { -0.1, -3.1 },
green = { -0.1, -3.55 }
},
shadow = {
red = { 3, 0.8 },
copper = { 2.9, 0.06 },
green = { 3, -0.6 }
}
}, {
wire = {
red = { -0.54, -3 },
copper = { 0, -3.25 },
green = { 0.45, -3.55 }
},
shadow = {
red = { 2.35, 0.6 },
copper = { 3.1, 0.2 },
green = { 3.8, -0.3 }
}
} },
max_health = 150,
pictures = {
axially_symmetrical = false,
frame_width = 168,
filename = "__base__/graphics/entity/big-electric-pole/big-electric-pole.png",
shift = { 1.6, -1.1 },
priority = "high",
direction_count = 4,
frame_height = 165
},
maximum_wire_distance = 30
},
["small-electric-pole"] = {
corpse = "small-remnants",
green_wire_picture = {
height = 46,
priority = "high",
filename = "__base__/graphics/entity/small-electric-pole/green-wire.png",
width = 224
},
radius_visualisation_picture = {
height = 12,
filename = "__base__/graphics/entity/small-electric-pole/electric-pole-radius-visualization.png",
width = 12
},
collision_box = { { -0.15, -0.15 }, { 0.15, 0.15 } },
drawing_box = { { -0.5, -2.3 }, { 0.5, 0.5 } },
selection_box = { { -0.4, -0.4 }, { 0.4, 0.4 } },
supply_area_distance = 2.5,
icon = "__base__/graphics/icons/small-electric-pole.png",
type = "electric-pole",
copper_wire_picture = {
height = 46,
priority = "high",
filename = "__base__/graphics/entity/small-electric-pole/copper-wire.png",
width = 224
},
red_wire_picture = {
height = 46,
priority = "high",
filename = "__base__/graphics/entity/small-electric-pole/red-wire.png",
width = 224
},
minable = {
result = "small-electric-pole",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "player-creation" },
wire_shadow_picture = {
height = 46,
priority = "high",
filename = "__base__/graphics/entity/small-electric-pole/wire-shadow.png",
width = 224
},
name = "small-electric-pole",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 4,
offset_deviation = { { -0.15, -0.15 }, { 0.15, 0.15 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
connection_points = { {
wire = {
green = { 0.4, -2.7 },
copper = { 0, -2.7 },
red = { -0.4, -2.7 }
},
shadow = {
green = { 3.1, 0 },
copper = { 2.7, 0 },
red = { 2.3, 0 }
}
}, {
wire = {
green = { 0.2, -2.6 },
copper = { -0.04, -2.8 },
red = { -0.3, -2.9 }
},
shadow = {
green = { 3, 0.12 },
copper = { 2.7, -0.05 },
red = { 2.2, -0.35 }
}
}, {
wire = {
green = { 0, -2.4 },
copper = { -0.2, -2.7 },
red = { -0.05, -2.95 }
},
shadow = {
green = { 2.5, 0.25 },
copper = { 2.5, -0.1 },
red = { 2.55, -0.45 }
}
}, {
wire = {
green = { -0.3, -2.5 },
copper = { 0, -2.7 },
red = { 0.3, -2.85 }
},
shadow = {
green = { 1.75, 0.2 },
copper = { 2.3, -0.1 },
red = { 2.65, -0.4 }
}
} },
max_health = 35,
pictures = {
frame_width = 123,
filename = "__base__/graphics/entity/small-electric-pole/small-electric-pole.png",
direction_count = 4,
shift = { 1.4, -1.1 },
priority = "extra-high",
axially_symetric = false,
frame_height = 124
},
maximum_wire_distance = 7.5
}
},
tree = {
["green-thin-tree"] = {
type = "tree",
subgroup = "trees",
order = "a[tree]-a[thin-tree]-a[green]",
collision_box = { { -0.4, -0.7 }, { 0.4, 0.9 } },
drawing_box = { { -0.7, -2.3 }, { 2, 0.9 } },
minable = {
result = "raw-wood",
mining_time = 2,
count = 5,
mining_particle = "wooden-particle"
},
flags = { "placeable-neutral", "placeable-off-grid", "breaths-air" },
selection_box = { { -0.9, -2.2 }, { 0.9, 0.9 } },
name = "green-thin-tree",
emissions_per_tick = -0.0005,
pictures = { {
height = 148,
shift = { 1.7, -0.4 },
filename = "__base__/graphics/entity/tree/green-thin-tree/green-thin-tree-01.png",
width = 197
}, {
height = 138,
shift = { 1.55, -0.1 },
filename = "__base__/graphics/entity/tree/green-thin-tree/green-thin-tree-02.png",
width = 186
}, {
height = 148,
shift = { 1.25, -0.05 },
filename = "__base__/graphics/entity/tree/green-thin-tree/green-thin-tree-03.png",
width = 170
}, {
height = 148,
shift = { 1.2, -0.4 },
filename = "__base__/graphics/entity/tree/green-thin-tree/green-thin-tree-04.png",
width = 184
}, {
height = 170,
shift = { 0.8, -0.3 },
filename = "__base__/graphics/entity/tree/green-thin-tree/green-thin-tree-05.png",
width = 172
}, {
height = 170,
shift = { 1, -0.7 },
filename = "__base__/graphics/entity/tree/green-thin-tree/green-thin-tree-06.png",
width = 174
}, {
height = 186,
shift = { 2.05, -0.4 },
filename = "__base__/graphics/entity/tree/green-thin-tree/green-thin-tree-07.png",
width = 238
}, {
height = 162,
shift = { 0.85, -0.15 },
filename = "__base__/graphics/entity/tree/green-thin-tree/green-thin-tree-08.png",
width = 185
} },
max_health = 50,
icon = "__base__/graphics/icons/green-thin-tree.png",
autoplace = {
order = "a[tree]-b[forest]",
sharpness = 0.4,
peaks = { {
influence = -0.1
}, {
noise_octaves_difference = -1,
noise_persistence = 0.5,
influence = 0.4,
noise_layer = "trees"
}, {
temperature_max_range = 22.5,
water_optimal = 0.75,
influence = 0.3,
water_range = 0.25,
water_max_range = 0.35,
min_influence = 0,
temperature_range = 17.5,
temperature_optimal = 17.5
} }
}
},
["dark-thin-tree"] = {
type = "tree",
subgroup = "trees",
order = "a[tree]-a[thin-tree]-d[dark]",
collision_box = { { -0.4, -0.7 }, { 0.4, 0.9 } },
pictures = { {
height = 148,
shift = { 1.7, -0.4 },
filename = "__base__/graphics/entity/tree/dark-thin-tree/dark-thin-tree-01.png",
width = 197
}, {
height = 138,
shift = { 1.55, -0.1 },
filename = "__base__/graphics/entity/tree/dark-thin-tree/dark-thin-tree-02.png",
width = 186
}, {
height = 148,
shift = { 1.25, -0.05 },
filename = "__base__/graphics/entity/tree/dark-thin-tree/dark-thin-tree-03.png",
width = 170
}, {
height = 148,
shift = { 1.2, -0.4 },
filename = "__base__/graphics/entity/tree/dark-thin-tree/dark-thin-tree-04.png",
width = 184
}, {
height = 170,
shift = { 0.8, -0.3 },
filename = "__base__/graphics/entity/tree/dark-thin-tree/dark-thin-tree-05.png",
width = 172
}, {
height = 170,
shift = { 1, -0.7 },
filename = "__base__/graphics/entity/tree/dark-thin-tree/dark-thin-tree-06.png",
width = 174
}, {
height = 186,
shift = { 2.05, -0.4 },
filename = "__base__/graphics/entity/tree/dark-thin-tree/dark-thin-tree-07.png",
width = 238
}, {
height = 162,
shift = { 0.85, -0.15 },
filename = "__base__/graphics/entity/tree/dark-thin-tree/dark-thin-tree-08.png",
width = 185
} },
minable = {
count = 4,
result = "raw-wood",
mining_particle = "wooden-particle",
mining_time = 2
},
flags = { "placeable-neutral", "placeable-off-grid", "breaths-air" },
selection_box = { { -0.9, -2.2 }, { 0.9, 0.9 } },
name = "dark-thin-tree",
emissions_per_tick = -0.0001,
max_health = 20,
icon = "__base__/graphics/icons/dark-thin-tree.png",
autoplace = {
order = "a[tree]-b[forest]",
peaks = { {
influence = -0.1
}, {
noise_octaves_difference = -1,
noise_persistence = 0.5,
influence = 0.4,
noise_layer = "trees"
}, {
temperature_max_range = 15,
water_optimal = 0.35,
influence = 0.3,
water_range = 0.05,
water_max_range = 0.15,
min_influence = 0,
temperature_range = 10,
temperature_optimal = 20
} },
sharpness = 0.4,
tile_restriction = { "dirt", "dirt-dark", "sand", "sand-dark" }
}
},
["root-tree"] = {
type = "tree",
subgroup = "trees",
order = "a[tree]-e[root-tree]",
collision_box = { { -0.4, -0.8 }, { 0.4, 0.2 } },
drawing_box = { { -0.7, -2.3 }, { 2, 0.9 } },
minable = {
result = "raw-wood",
mining_time = 2,
count = 5,
mining_particle = "wooden-particle"
},
flags = { "placeable-neutral", "placeable-off-grid", "breaths-air" },
selection_box = { { -0.6, -1.5 }, { 0.6, 0.3 } },
name = "root-tree",
emissions_per_tick = -0.0001,
pictures = { {
height = 104,
shift = { 0, -0.5 },
filename = "__base__/graphics/entity/tree/root-tree/root-tree-01.png",
width = 148
}, {
height = 122,
shift = { 0.8, -0.5 },
filename = "__base__/graphics/entity/tree/root-tree/root-tree-02.png",
width = 163
}, {
height = 92,
shift = { 0.7, -0.5 },
filename = "__base__/graphics/entity/tree/root-tree/root-tree-03.png",
width = 179
}, {
height = 96,
shift = { 1, -0.6 },
filename = "__base__/graphics/entity/tree/root-tree/root-tree-04.png",
width = 139
}, {
height = 110,
shift = { 0.4, -0.5 },
filename = "__base__/graphics/entity/tree/root-tree/root-tree-05.png",
width = 175
}, {
height = 100,
shift = { 0.4, -0.6 },
filename = "__base__/graphics/entity/tree/root-tree/root-tree-06.png",
width = 133
}, {
height = 99,
shift = { 1.6, -0.8 },
filename = "__base__/graphics/entity/tree/root-tree/root-tree-07.png",
width = 174
}, {
height = 111,
shift = { 1.25, -0.85 },
filename = "__base__/graphics/entity/tree/root-tree/root-tree-08.png",
width = 143
}, {
height = 103,
shift = { 1, -0.2 },
filename = "__base__/graphics/entity/tree/root-tree/root-tree-09.png",
width = 165
}, {
height = 104,
shift = { 0.8, -0.7 },
filename = "__base__/graphics/entity/tree/root-tree/root-tree-10.png",
width = 147
}, {
height = 82,
shift = { 0.8, -0.5 },
filename = "__base__/graphics/entity/tree/root-tree/root-tree-11.png",
width = 133
}, {
height = 113,
shift = { 1, -0.9 },
filename = "__base__/graphics/entity/tree/root-tree/root-tree-12.png",
width = 136
} },
max_health = 50,
icon = "__base__/graphics/icons/root-tree.png",
autoplace = {
order = "a[tree]-b[forest]",
peaks = { {
influence = -0.1
}, {
noise_octaves_difference = -1,
noise_persistence = 0.5,
influence = 0.4,
noise_layer = "trees"
}, {
temperature_max_range = 15,
water_optimal = 0.85,
influence = 0.3,
water_range = 0.15,
water_max_range = 0.25,
min_influence = 0,
temperature_range = 10,
temperature_optimal = 25
} },
sharpness = 0.2,
max_probability = 0.2
}
},
["dead-dry-hairy-tree"] = {
type = "tree",
subgroup = "trees",
order = "a[tree]-d[dead-tree]",
collision_box = { { -0.6, -0.6 }, { 0.6, 0.6 } },
pictures = { {
height = 126,
shift = { -1.78, 0.93 },
filename = "__base__/graphics/entity/tree/dead-dry-hairy-tree/dead-dry-hairy-tree-01.png",
width = 220
}, {
height = 144,
shift = { -0.93, -1.25 },
filename = "__base__/graphics/entity/tree/dead-dry-hairy-tree/dead-dry-hairy-tree-02.png",
width = 214
}, {
height = 173,
shift = { 1.78, -1.56 },
filename = "__base__/graphics/entity/tree/dead-dry-hairy-tree/dead-dry-hairy-tree-03.png",
width = 195
}, {
height = 114,
shift = { 2.81, 0.25 },
filename = "__base__/graphics/entity/tree/dead-dry-hairy-tree/dead-dry-hairy-tree-04.png",
width = 241
}, {
height = 147,
shift = { 2.06, 2.09 },
filename = "__base__/graphics/entity/tree/dead-dry-hairy-tree/dead-dry-hairy-tree-05.png",
width = 188
}, {
height = 150,
shift = { -1.56, 1.25 },
filename = "__base__/graphics/entity/tree/dead-dry-hairy-tree/dead-dry-hairy-tree-06.png",
width = 166
}, {
height = 99,
shift = { -2.18, -0.87 },
filename = "__base__/graphics/entity/tree/dead-dry-hairy-tree/dead-dry-hairy-tree-07.png",
width = 227
} },
minable = {
count = 2,
result = "raw-wood",
mining_particle = "wooden-particle",
mining_time = 1
},
flags = { "placeable-neutral", "placeable-off-grid", "breaths-air" },
selection_box = { { -0.8, -0.8 }, { 0.8, 0.8 } },
name = "dead-dry-hairy-tree",
emissions_per_tick = -0.0001,
max_health = 20,
icon = "__base__/graphics/icons/dead-dry-hairy-tree.png",
autoplace = {
order = "b[tree]-a[random]",
peaks = { {
influence = 0.0005
}, {
influence = 0.004,
noise_persistence = 0.5,
min_influence = 0,
max_influence = 0.003,
noise_layer = "trees"
} }
}
},
["green-tree"] = {
type = "tree",
subgroup = "trees",
order = "a[tree]-b[normal]-a[green]",
collision_box = { { -0.4, -0.7 }, { 0.4, 0.9 } },
drawing_box = { { -0.7, -2.3 }, { 2, 0.9 } },
minable = {
result = "raw-wood",
mining_time = 2,
count = 5,
mining_particle = "wooden-particle"
},
flags = { "placeable-neutral", "placeable-off-grid", "breaths-air" },
selection_box = { { -0.9, -2.2 }, { 0.9, 0.9 } },
name = "green-tree",
emissions_per_tick = -0.0005,
pictures = { {
height = 101,
shift = { 0.8, 0.1 },
filename = "__base__/graphics/entity/tree/green-tree/green-tree-01.png",
width = 108
}, {
height = 133,
shift = { 0.95, -0.15 },
filename = "__base__/graphics/entity/tree/green-tree/green-tree-02.png",
width = 147
}, {
height = 132,
shift = { 0.8, 0 },
filename = "__base__/graphics/entity/tree/green-tree/green-tree-03.png",
width = 148
}, {
height = 128,
shift = { 0.9, -0.2 },
filename = "__base__/graphics/entity/tree/green-tree/green-tree-04.png",
width = 151
}, {
height = 133,
shift = { 0.8, -0.2 },
filename = "__base__/graphics/entity/tree/green-tree/green-tree-05.png",
width = 156
}, {
height = 129,
shift = { 1.1, -0.3 },
filename = "__base__/graphics/entity/tree/green-tree/green-tree-06.png",
width = 163
}, {
height = 135,
shift = { 0.9, -0.3 },
filename = "__base__/graphics/entity/tree/green-tree/green-tree-07.png",
width = 151
} },
max_health = 50,
icon = "__base__/graphics/icons/green-tree.png",
autoplace = {
order = "a[tree]-b[forest]",
sharpness = 0.4,
peaks = { {
influence = -0.1
}, {
noise_octaves_difference = -1,
noise_persistence = 0.5,
influence = 0.4,
noise_layer = "trees"
}, {
temperature_max_range = 15,
water_optimal = 0.55,
influence = 0.3,
water_range = 0.15,
water_max_range = 0.25,
min_influence = 0,
temperature_range = 10,
temperature_optimal = 20
} }
}
},
["green-coral"] = {
type = "tree",
subgroup = "trees",
order = "a[tree]-f[coral]",
collision_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
drawing_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
minable = {
result = "raw-wood",
mining_time = 2,
count = 1,
mining_particle = "wooden-particle"
},
flags = { "placeable-neutral", "placeable-off-grid" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "green-coral",
emissions_per_tick = 0,
pictures = { {
height = 69,
shift = { 0.4, -0.4 },
filename = "__base__/graphics/entity/tree/green-coral/green-coral-01.png",
width = 58
}, {
height = 97,
shift = { 0.7, -0.05 },
filename = "__base__/graphics/entity/tree/green-coral/green-coral-02.png",
width = 77
}, {
height = 54,
shift = { 0.2, 0 },
filename = "__base__/graphics/entity/tree/green-coral/green-coral-03.png",
width = 41
}, {
height = 61,
shift = { 0.7, 0.3 },
filename = "__base__/graphics/entity/tree/green-coral/green-coral-04.png",
width = 63
}, {
height = 85,
shift = { -0.1, 0.5 },
filename = "__base__/graphics/entity/tree/green-coral/green-coral-05.png",
width = 63
}, {
height = 71,
filename = "__base__/graphics/entity/tree/green-coral/green-coral-06.png",
width = 67
}, {
height = 77,
shift = { -0.2, -0.4 },
filename = "__base__/graphics/entity/tree/green-coral/green-coral-07.png",
width = 89
} },
max_health = 50,
icon = "__base__/graphics/icons/green-coral.png",
autoplace = {
order = "a[tree]-b[forest]",
sharpness = 0.4,
peaks = { {
influence = -0.1
}, {
noise_octaves_difference = -1,
noise_persistence = 0.5,
influence = 0.4,
noise_layer = "trees"
}, {
temperature_max_range = 12.5,
water_optimal = 0.3,
influence = 0.3,
water_range = 0.1,
water_max_range = 0.2,
min_influence = 0,
temperature_range = 7.5,
temperature_optimal = 27.5
} }
}
},
["dead-tree"] = {
type = "tree",
subgroup = "trees",
order = "a[tree]-d[dead-tree]",
collision_box = { { -0.6, -0.6 }, { 0.6, 0.6 } },
pictures = { {
height = 114,
filename = "__base__/graphics/entity/tree/dead-tree/dead-tree-01.png",
width = 108
}, {
height = 97,
shift = { 0.2, 0.2 },
filename = "__base__/graphics/entity/tree/dead-tree/dead-tree-02.png",
width = 155
}, {
height = 124,
shift = { 0.4, -0.3 },
filename = "__base__/graphics/entity/tree/dead-tree/dead-tree-03.png",
width = 138
}, {
height = 123,
shift = { 0, -0.4 },
filename = "__base__/graphics/entity/tree/dead-tree/dead-tree-04.png",
width = 112
}, {
height = 113,
filename = "__base__/graphics/entity/tree/dead-tree/dead-tree-05.png",
width = 111
}, {
height = 83,
filename = "__base__/graphics/entity/tree/dead-tree/dead-tree-06.png",
width = 78
}, {
height = 105,
filename = "__base__/graphics/entity/tree/dead-tree/dead-tree-07.png",
width = 90
} },
minable = {
count = 2,
result = "raw-wood",
mining_particle = "wooden-particle",
mining_time = 1
},
flags = { "placeable-neutral", "placeable-off-grid", "breaths-air" },
selection_box = { { -0.8, -0.8 }, { 0.8, 0.8 } },
name = "dead-tree",
emissions_per_tick = -0.0001,
max_health = 20,
icon = "__base__/graphics/icons/dead-tree.png",
autoplace = {
order = "b[tree]-a[random]",
peaks = { {
influence = 0.0005
}, {
influence = 0.004,
noise_persistence = 0.5,
min_influence = 0,
max_influence = 0.003,
noise_layer = "trees"
} }
}
},
["red-thin-tree"] = {
type = "tree",
subgroup = "trees",
order = "a[tree]-a[thin-tree]-c[red]",
collision_box = { { -0.4, -0.7 }, { 0.4, 0.9 } },
drawing_box = { { -0.7, -2.3 }, { 2, 0.9 } },
minable = {
result = "raw-wood",
mining_time = 2,
count = 5,
mining_particle = "wooden-particle"
},
flags = { "placeable-neutral", "placeable-off-grid", "breaths-air" },
selection_box = { { -0.9, -2.2 }, { 0.9, 0.9 } },
name = "red-thin-tree",
emissions_per_tick = -0.0005,
pictures = { {
height = 148,
shift = { 1.7, -0.3 },
filename = "__base__/graphics/entity/tree/red-thin-tree/red-thin-tree-01.png",
width = 197
}, {
height = 138,
shift = { 1.6, -0.1 },
filename = "__base__/graphics/entity/tree/red-thin-tree/red-thin-tree-02.png",
width = 186
}, {
height = 148,
shift = { 1.3, 0 },
filename = "__base__/graphics/entity/tree/red-thin-tree/red-thin-tree-03.png",
width = 170
}, {
height = 148,
shift = { 1.25, -0.35 },
filename = "__base__/graphics/entity/tree/red-thin-tree/red-thin-tree-04.png",
width = 184
}, {
height = 170,
shift = { 0.8, -0.3 },
filename = "__base__/graphics/entity/tree/red-thin-tree/red-thin-tree-05.png",
width = 172
}, {
height = 170,
shift = { 0.9, -0.6 },
filename = "__base__/graphics/entity/tree/red-thin-tree/red-thin-tree-06.png",
width = 174
}, {
height = 186,
shift = { 2, -0.4 },
filename = "__base__/graphics/entity/tree/red-thin-tree/red-thin-tree-07.png",
width = 238
}, {
height = 162,
shift = { 0.85, -0.1 },
filename = "__base__/graphics/entity/tree/red-thin-tree/red-thin-tree-08.png",
width = 185
} },
max_health = 50,
icon = "__base__/graphics/icons/red-thin-tree.png",
autoplace = {
order = "a[tree]-b[forest]",
sharpness = 0.4,
peaks = { {
influence = -0.1
}, {
noise_octaves_difference = -1,
noise_persistence = 0.5,
influence = 0.4,
noise_layer = "trees"
}, {
temperature_max_range = 7.5,
water_optimal = 0.35,
influence = 0.3,
water_range = 0.15,
water_max_range = 0.25,
min_influence = 0,
temperature_range = 2.5,
temperature_optimal = 2.5
} }
}
},
["red-tree"] = {
type = "tree",
subgroup = "trees",
order = "a[tree]-c[red-tree]",
collision_box = { { -0.4, -0.7 }, { 0.4, 0.9 } },
drawing_box = { { -0.7, -2.3 }, { 2, 0.9 } },
minable = {
result = "raw-wood",
mining_time = 2,
count = 5,
mining_particle = "wooden-particle"
},
flags = { "placeable-neutral", "placeable-off-grid", "breaths-air" },
selection_box = { { -0.9, -2.2 }, { 0.9, 0.9 } },
name = "red-tree",
emissions_per_tick = -0.0005,
pictures = { {
height = 206,
shift = { 0.95, -0.2 },
filename = "__base__/graphics/entity/tree/red-tree/red-tree-01.png",
width = 173
}, {
height = 218,
shift = { 0.95, -0.25 },
filename = "__base__/graphics/entity/tree/red-tree/red-tree-02.png",
width = 180
}, {
height = 240,
shift = { 1.15, -0.5 },
filename = "__base__/graphics/entity/tree/red-tree/red-tree-03.png",
width = 173
}, {
height = 232,
shift = { 2.2, -0.15 },
filename = "__base__/graphics/entity/tree/red-tree/red-tree-04.png",
width = 222
}, {
height = 210,
shift = { 1.65, -0.35 },
filename = "__base__/graphics/entity/tree/red-tree/red-tree-05.png",
width = 204
} },
max_health = 50,
icon = "__base__/graphics/icons/red-tree.png",
autoplace = {
order = "a[tree]-b[forest]",
sharpness = 0.4,
peaks = { {
influence = -0.1
}, {
noise_octaves_difference = -1,
noise_persistence = 0.5,
influence = 0.4,
noise_layer = "trees"
}, {
temperature_max_range = 12.5,
water_optimal = 0.4,
influence = 0.3,
water_range = 0.1,
water_max_range = 0.2,
min_influence = 0,
temperature_range = 7.5,
temperature_optimal = 12.5
} }
}
},
["dark-green-tree"] = {
type = "tree",
subgroup = "trees",
order = "a[tree]-b[normal]-b[dark]",
collision_box = { { -0.4, -0.7 }, { 0.4, 0.9 } },
drawing_box = { { -0.7, -2.3 }, { 2, 0.9 } },
minable = {
result = "raw-wood",
mining_time = 2,
count = 5,
mining_particle = "wooden-particle"
},
flags = { "placeable-neutral", "placeable-off-grid", "breaths-air" },
selection_box = { { -0.9, -2.2 }, { 0.9, 0.9 } },
name = "dark-green-tree",
emissions_per_tick = -0.0005,
pictures = { {
height = 138,
shift = { 0.6, -0.05 },
filename = "__base__/graphics/entity/tree/dark-green-tree/dark-green-tree-01.png",
width = 165
}, {
height = 141,
shift = { 0.7, -0.2 },
filename = "__base__/graphics/entity/tree/dark-green-tree/dark-green-tree-02.png",
width = 167
}, {
height = 138,
shift = { 0.9, -0.2 },
filename = "__base__/graphics/entity/tree/dark-green-tree/dark-green-tree-03.png",
width = 167
}, {
height = 137,
shift = { 1.05, -0.3 },
filename = "__base__/graphics/entity/tree/dark-green-tree/dark-green-tree-04.png",
width = 165
}, {
height = 138,
shift = { 1.3, -0.3 },
filename = "__base__/graphics/entity/tree/dark-green-tree/dark-green-tree-05.png",
width = 169
}, {
height = 122,
shift = { 1.1, -0.3 },
filename = "__base__/graphics/entity/tree/dark-green-tree/dark-green-tree-06.png",
width = 151
}, {
height = 126,
shift = { 0.55, -0.35 },
filename = "__base__/graphics/entity/tree/dark-green-tree/dark-green-tree-07.png",
width = 150
} },
max_health = 50,
icon = "__base__/graphics/icons/dark-green-tree.png",
autoplace = {
order = "a[tree]-b[forest]",
sharpness = 0.4,
peaks = { {
influence = -0.1
}, {
noise_octaves_difference = -1,
noise_persistence = 0.5,
influence = 0.4,
noise_layer = "trees"
}, {
temperature_max_range = 12.5,
water_optimal = 0.65,
influence = 0.3,
water_range = 0.15,
water_max_range = 0.25,
min_influence = 0,
temperature_range = 7.5,
temperature_optimal = 22.5
} }
}
},
["dead-grey-trunk"] = {
type = "tree",
subgroup = "trees",
order = "wwwwwwwa[tree]-d[dead-tree]",
collision_box = { { -0.6, -0.6 }, { 0.6, 0.6 } },
pictures = { {
height = 96,
shift = { 0.75, -0.46 },
filename = "__base__/graphics/entity/tree/dead-grey-trunk/dead-grey-trunk-01.png",
width = 105
}, {
height = 87,
shift = { 0.4, 0.43 },
filename = "__base__/graphics/entity/tree/dead-grey-trunk/dead-grey-trunk-02.png",
width = 67
}, {
height = 67,
shift = { 0.56, -0.25 },
filename = "__base__/graphics/entity/tree/dead-grey-trunk/dead-grey-trunk-03.png",
width = 114
}, {
height = 85,
shift = { 0.62, 0.21 },
filename = "__base__/graphics/entity/tree/dead-grey-trunk/dead-grey-trunk-04.png",
width = 95
}, {
height = 112,
shift = { 0.84, -0.84 },
filename = "__base__/graphics/entity/tree/dead-grey-trunk/dead-grey-trunk-05.png",
width = 100
}, {
height = 82,
shift = { 0, -0.5 },
filename = "__base__/graphics/entity/tree/dead-grey-trunk/dead-grey-trunk-06.png",
width = 96
}, {
height = 55,
shift = { -0.46, 0 },
filename = "__base__/graphics/entity/tree/dead-grey-trunk/dead-grey-trunk-07.png",
width = 143
} },
minable = {
count = 2,
result = "raw-wood",
mining_particle = "wooden-particle",
mining_time = 1
},
flags = { "placeable-neutral", "placeable-off-grid", "breaths-air" },
selection_box = { { -0.8, -0.8 }, { 0.8, 0.8 } },
name = "dead-grey-trunk",
emissions_per_tick = -0.0001,
max_health = 20,
icon = "__base__/graphics/icons/dead-grey-trunk.png",
autoplace = {
order = "b[tree]-a[random]",
peaks = { {
influence = 0.0005
}, {
influence = 0.004,
noise_persistence = 0.5,
min_influence = 0,
max_influence = 0.003,
noise_layer = "trees"
} }
}
},
["dark-green-thin-tree"] = {
type = "tree",
subgroup = "trees",
order = "a[tree]-a[thin-tree]-b[dark-green]",
collision_box = { { -0.4, -0.7 }, { 0.4, 0.9 } },
drawing_box = { { -0.7, -2.3 }, { 2, 0.9 } },
minable = {
result = "raw-wood",
mining_time = 2,
count = 5,
mining_particle = "wooden-particle"
},
flags = { "placeable-neutral", "placeable-off-grid", "breaths-air" },
selection_box = { { -0.9, -2.2 }, { 0.9, 0.9 } },
name = "dark-green-thin-tree",
emissions_per_tick = -0.0005,
pictures = { {
height = 148,
shift = { 1.7, -0.35 },
filename = "__base__/graphics/entity/tree/dark-green-thin-tree/dark-green-thin-tree-01.png",
width = 197
}, {
height = 138,
shift = { 1.55, -0.1 },
filename = "__base__/graphics/entity/tree/dark-green-thin-tree/dark-green-thin-tree-02.png",
width = 186
}, {
height = 148,
shift = { 1.3, -0.05 },
filename = "__base__/graphics/entity/tree/dark-green-thin-tree/dark-green-thin-tree-03.png",
width = 170
}, {
height = 148,
shift = { 1.25, -0.4 },
filename = "__base__/graphics/entity/tree/dark-green-thin-tree/dark-green-thin-tree-04.png",
width = 184
}, {
height = 170,
shift = { 0.85, -0.25 },
filename = "__base__/graphics/entity/tree/dark-green-thin-tree/dark-green-thin-tree-05.png",
width = 172
}, {
height = 170,
shift = { 1, -0.65 },
filename = "__base__/graphics/entity/tree/dark-green-thin-tree/dark-green-thin-tree-06.png",
width = 174
}, {
height = 186,
shift = { 2.05, -0.4 },
filename = "__base__/graphics/entity/tree/dark-green-thin-tree/dark-green-thin-tree-07.png",
width = 238
}, {
height = 162,
shift = { 0.85, -0.15 },
filename = "__base__/graphics/entity/tree/dark-green-thin-tree/dark-green-thin-tree-08.png",
width = 185
} },
max_health = 50,
icon = "__base__/graphics/icons/dark-green-thin-tree.png",
autoplace = {
order = "a[tree]-b[forest]",
sharpness = 0.4,
peaks = { {
influence = -0.1
}, {
noise_octaves_difference = -1,
noise_persistence = 0.5,
influence = 0.4,
noise_layer = "trees"
}, {
temperature_max_range = 25,
water_optimal = 0.65,
influence = 0.3,
water_range = 0.35,
water_max_range = 0.45,
min_influence = 0,
temperature_range = 20,
temperature_optimal = 15
} }
}
},
["dry-tree"] = {
type = "tree",
subgroup = "trees",
order = "a[tree]-e[dry-tree]",
collision_box = { { -0.4, -0.8 }, { 0.4, 0.2 } },
pictures = { {
height = 127,
shift = { 0, -1 },
filename = "__base__/graphics/entity/tree/dry-tree/dry-tree-01.png",
width = 121
}, {
height = 125,
shift = { 1, -1.6 },
filename = "__base__/graphics/entity/tree/dry-tree/dry-tree-02.png",
width = 150
}, {
height = 125,
shift = { 1.3, -1.5 },
filename = "__base__/graphics/entity/tree/dry-tree/dry-tree-03.png",
width = 129
}, {
height = 129,
shift = { 1.7, -0.15 },
filename = "__base__/graphics/entity/tree/dry-tree/dry-tree-04.png",
width = 135
}, {
height = 145,
shift = { 1.2, -1 },
filename = "__base__/graphics/entity/tree/dry-tree/dry-tree-05.png",
width = 112
}, {
height = 104,
shift = { 1.1, -1 },
filename = "__base__/graphics/entity/tree/dry-tree/dry-tree-06.png",
width = 129
}, {
height = 146,
shift = { 1.5, -1.5 },
filename = "__base__/graphics/entity/tree/dry-tree/dry-tree-07.png",
width = 199
}, {
height = 137,
shift = { 1, -0.8 },
filename = "__base__/graphics/entity/tree/dry-tree/dry-tree-08.png",
width = 157
}, {
height = 132,
shift = { 1.5, -1.5 },
filename = "__base__/graphics/entity/tree/dry-tree/dry-tree-09.png",
width = 165
}, {
height = 125,
shift = { 0.5, -0.5 },
filename = "__base__/graphics/entity/tree//dry-tree/dry-tree-10.png",
width = 139
}, {
height = 101,
shift = { 1, -0.9 },
filename = "__base__/graphics/entity/tree//dry-tree/dry-tree-11.png",
width = 169
}, {
height = 99,
shift = { 0.8, -0.7 },
filename = "__base__/graphics/entity/tree//dry-tree/dry-tree-12.png",
width = 126
}, {
height = 109,
shift = { 0.4, -0.1 },
filename = "__base__/graphics/entity/tree//dry-tree/dry-tree-13.png",
width = 117
}, {
height = 108,
shift = { 0.4, -1.2 },
filename = "__base__/graphics/entity/tree//dry-tree/dry-tree-14.png",
width = 136
}, {
height = 117,
shift = { 1, -1.5 },
filename = "__base__/graphics/entity/tree//dry-tree/dry-tree-15.png",
width = 121
}, {
height = 110,
shift = { 1.2, -0.6 },
filename = "__base__/graphics/entity/tree//dry-tree/dry-tree-16.png",
width = 109
}, {
height = 129,
shift = { 2, -0.1 },
filename = "__base__/graphics/entity/tree//dry-tree/dry-tree-17.png",
width = 178
} },
minable = {
result = "raw-wood",
mining_time = 1,
count = 4,
mining_particle = "wooden-particle"
},
flags = { "placeable-neutral", "placeable-off-grid", "breaths-air" },
selection_box = { { -0.6, -1.5 }, { 0.6, 0.3 } },
name = "dry-tree",
emissions_per_tick = -0.0001,
max_health = 20,
icon = "__base__/graphics/icons/dry-tree.png",
autoplace = {
order = "b[tree]-a[random]",
peaks = { {
noise_persistence = 0.5,
influence = 0.0002,
noise_layer = "trees"
}, {
temperature_max_range = 20,
water_optimal = 0.15,
influence = 0.001,
water_range = 0.15,
water_max_range = 0.25,
min_influence = 0,
temperature_range = 15,
temperature_optimal = 20
} }
}
},
["dry-hairy-tree"] = {
type = "tree",
subgroup = "trees",
order = "a[tree]-d[dead-tree]",
collision_box = { { -0.6, -0.6 }, { 0.6, 0.6 } },
pictures = { {
height = 242,
shift = { 1.9, -0.68 },
filename = "__base__/graphics/entity/tree/dry-hairy-tree/dry-hairy-tree-01.png",
width = 201
}, {
height = 256,
shift = { 2.62, -0.68 },
filename = "__base__/graphics/entity/tree/dry-hairy-tree/dry-hairy-tree-02.png",
width = 307
}, {
height = 240,
shift = { 0.56, -1.5 },
filename = "__base__/graphics/entity/tree/dry-hairy-tree/dry-hairy-tree-03.png",
width = 286
}, {
height = 229,
shift = { 3.5, -2 },
filename = "__base__/graphics/entity/tree/dry-hairy-tree/dry-hairy-tree-04.png",
width = 291
}, {
height = 264,
shift = { 3.2, -0.46 },
filename = "__base__/graphics/entity/tree/dry-hairy-tree/dry-hairy-tree-05.png",
width = 265
}, {
height = 267,
shift = { 2.59, -1.34 },
filename = "__base__/graphics/entity/tree/dry-hairy-tree/dry-hairy-tree-06.png",
width = 312
}, {
height = 213,
shift = { 3.37, -0.25 },
filename = "__base__/graphics/entity/tree/dry-hairy-tree/dry-hairy-tree-07.png",
width = 294
}, {
height = 217,
shift = { 2.28, -1.25 },
filename = "__base__/graphics/entity/tree/dry-hairy-tree/dry-hairy-tree-08.png",
width = 284
} },
minable = {
count = 2,
result = "raw-wood",
mining_particle = "wooden-particle",
mining_time = 1
},
flags = { "placeable-neutral", "placeable-off-grid", "breaths-air" },
selection_box = { { -0.8, -0.8 }, { 0.8, 0.8 } },
name = "dry-hairy-tree",
emissions_per_tick = -0.0001,
max_health = 20,
icon = "__base__/graphics/icons/dry-hairy-tree.png",
autoplace = {
order = "b[tree]-a[random]",
peaks = { {
influence = 0.0005
}, {
influence = 0.004,
noise_persistence = 0.5,
min_influence = 0,
max_influence = 0.003,
noise_layer = "trees"
} }
}
}
},
["mining-drill"] = {
pumpjack = {
corpse = "big-remnants",
radius_visualisation_picture = {
height = 12,
filename = "__base__/graphics/entity/pumpjack/pumpjack-radius-visualization.png",
width = 12
},
animations = {
north = {
frame_count = 40,
frame_width = 116,
filename = "__base__/graphics/entity/pumpjack/pumpjack-animation.png",
animation_speed = 0.5,
line_length = 10,
priority = "extra-high",
shift = { 0.125, -0.71875 },
frame_height = 110
}
},
collision_box = { { -1.4, -1.4 }, { 1.4, 1.4 } },
drawing_box = { { -1.6, -2.5 }, { 1.5, 1.6 } },
resource_categories = { "basic-fluid" },
selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
mining_power = 2,
icon = "__base__/graphics/icons/pumpjack.png",
energy_source = {
emissions = 0.1,
type = "electric",
usage_priority = "secondary-input"
},
type = "mining-drill",
vector_to_place_result = { 0, 0 },
mining_speed = 1,
working_sound = {
sound = {
filename = "__base__/sound/pumpjack.ogg"
},
apparent_volume = 1.5
},
base_picture = {
shift = { 0.1875, -0.03125 },
height = 113,
priority = "extra-high",
width = 114,
sheet = "__base__/graphics/entity/pumpjack/pumpjack-base.png"
},
module_slots = 2,
minable = {
mining_time = 1,
result = "pumpjack"
},
flags = { "placeable-neutral", "player-creation" },
resource_searching_radius = 0.49,
name = "pumpjack",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 117,
offset_deviation = { { -1.4, -1.4 }, { 1.4, 1.4 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
energy_usage = "90kW",
max_health = 100,
fluid_box = {
pipe_connections = { {
positions = { { 1, -2 }, { 2, -1 }, { -1, 2 }, { -2, 1 } }
} },
pipe_covers = {
west = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-west.png",
width = 32
},
south = {
height = 52,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-south.png",
width = 46
},
east = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-east.png",
width = 32
},
north = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-north.png",
width = 44
}
},
base_area = 1,
base_level = 1
},
dying_explosion = "huge-explosion"
},
["burner-mining-drill"] = {
corpse = "medium-remnants",
animations = {
west = {
frame_height = 78,
animation_speed = 0.5,
line_length = 4,
run_mode = "forward-then-backward",
frame_width = 91,
filename = "__base__/graphics/entity/burner-mining-drill/west.png",
shift = { 0.1, -0.05 },
priority = "extra-high",
frame_count = 32
},
south = {
frame_height = 88,
animation_speed = 0.5,
line_length = 4,
run_mode = "forward-then-backward",
frame_width = 89,
filename = "__base__/graphics/entity/burner-mining-drill/south.png",
shift = { 0.4, 0 },
priority = "extra-high",
frame_count = 32
},
east = {
frame_height = 74,
animation_speed = 0.5,
line_length = 4,
run_mode = "forward-then-backward",
frame_width = 94,
filename = "__base__/graphics/entity/burner-mining-drill/east.png",
shift = { 0.45, -0.1 },
priority = "extra-high",
frame_count = 32
},
north = {
frame_height = 76,
animation_speed = 0.5,
line_length = 4,
run_mode = "forward-then-backward",
frame_width = 110,
filename = "__base__/graphics/entity/burner-mining-drill/north.png",
shift = { 0.7, -0.1 },
priority = "extra-high",
frame_count = 32
}
},
collision_box = { { -0.9, -0.9 }, { 0.9, 0.9 } },
resource_categories = { "basic-solid" },
selection_box = { { -1, -1 }, { 1, 1 } },
mining_power = 2.5,
icon = "__base__/graphics/icons/burner-mining-drill.png",
energy_source = {
fuel_inventory_size = 1,
type = "burner",
smoke = { {
frequency = 1,
name = "smoke",
deviation = { 0.1, 0.1 }
} },
emissions = 0.033333333333333,
effectivity = 1
},
type = "mining-drill",
vector_to_place_result = { -0.5, -1.3 },
minable = {
mining_time = 1,
result = "burner-mining-drill"
},
flags = { "placeable-neutral", "player-creation" },
resource_searching_radius = 0.99,
name = "burner-mining-drill",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 48,
offset_deviation = { { -0.9, -0.9 }, { 0.9, 0.9 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
energy_usage = "300kW",
max_health = 100,
working_sound = {
sound = {
filename = "__base__/sound/burner-mining-drill.ogg",
volume = 0.8
}
},
mining_speed = 0.35
},
["basic-mining-drill"] = {
corpse = "big-remnants",
radius_visualisation_picture = {
height = 12,
filename = "__base__/graphics/entity/basic-mining-drill/mining-drill-radius-visualization.png",
width = 12
},
animations = {
west = {
frame_height = 100,
animation_speed = 0.5,
line_length = 8,
run_mode = "forward-then-backward",
frame_width = 128,
filename = "__base__/graphics/entity/basic-mining-drill/west.png",
shift = { 0.25, 0 },
priority = "extra-high",
frame_count = 64
},
south = {
frame_height = 111,
animation_speed = 0.5,
line_length = 8,
run_mode = "forward-then-backward",
frame_width = 109,
filename = "__base__/graphics/entity/basic-mining-drill/south.png",
shift = { 0.15, 0 },
priority = "extra-high",
frame_count = 64
},
east = {
frame_height = 100,
animation_speed = 0.5,
line_length = 8,
run_mode = "forward-then-backward",
frame_width = 129,
filename = "__base__/graphics/entity/basic-mining-drill/east.png",
shift = { 0.45, 0 },
priority = "extra-high",
frame_count = 64
},
north = {
frame_height = 114,
animation_speed = 0.5,
line_length = 8,
run_mode = "forward-then-backward",
frame_width = 110,
filename = "__base__/graphics/entity/basic-mining-drill/north.png",
shift = { 0.2, -0.2 },
priority = "extra-high",
frame_count = 64
}
},
collision_box = { { -1.4, -1.4 }, { 1.4, 1.4 } },
resource_categories = { "basic-solid" },
selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
mining_power = 3,
icon = "__base__/graphics/icons/basic-mining-drill.png",
energy_source = {
emissions = 0.1,
type = "electric",
usage_priority = "secondary-input"
},
type = "mining-drill",
vector_to_place_result = { 0, -1.85 },
resource_searching_radius = 2.49,
minable = {
mining_time = 1,
result = "basic-mining-drill"
},
flags = { "placeable-neutral", "player-creation" },
module_slots = 3,
name = "basic-mining-drill",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 117,
offset_deviation = { { -1.4, -1.4 }, { 1.4, 1.4 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
energy_usage = "90kW",
max_health = 300,
mining_speed = 0.5,
working_sound = {
sound = {
filename = "__base__/sound/electric-mining-drill.ogg",
volume = 0.75
},
apparent_volume = 1.5
}
}
},
["energy-shield-equipment"] = {
["energy-shield-mk2-equipment"] = {
sprite = {
height = 64,
priority = "medium",
filename = "__base__/graphics/equipment/energy-shield-mk2-equipment.png",
width = 64
},
type = "energy-shield-equipment",
name = "energy-shield-mk2-equipment",
energy_per_shield = "30J",
max_shield_value = 150,
shape = {
height = 2,
type = "full",
width = 2
},
energy_source = {
usage_priority = "primary-input",
type = "electric",
buffer_capacity = "180J",
input_flow_limit = "180W"
}
},
["energy-shield-equipment"] = {
sprite = {
height = 64,
priority = "medium",
filename = "__base__/graphics/equipment/energy-shield-equipment.png",
width = 64
},
type = "energy-shield-equipment",
name = "energy-shield-equipment",
energy_per_shield = "20J",
max_shield_value = 50,
shape = {
height = 2,
type = "full",
width = 2
},
energy_source = {
usage_priority = "primary-input",
type = "electric",
buffer_capacity = "120J",
input_flow_limit = "120W"
}
}
},
["flying-text"] = {
["flying-text"] = {
flags = { "not-on-map" },
type = "flying-text",
name = "flying-text",
speed = 0.05,
time_to_live = 150
}
},
accumulator = {
["basic-accumulator"] = {
corpse = "medium-remnants",
collision_box = { { -0.9, -0.9 }, { 0.9, 0.9 } },
discharge_light = {
intensity = 0.7,
size = 7
},
charge_light = {
intensity = 0.3,
size = 7
},
selection_box = { { -1, -1 }, { 1, 1 } },
icon = "__base__/graphics/icons/basic-accumulator.png",
energy_source = {
type = "electric",
output_flow_limit = "300kW",
usage_priority = "terciary",
buffer_capacity = "5MJ",
input_flow_limit = "300kW"
},
type = "accumulator",
picture = {
filename = "__base__/graphics/entity/basic-accumulator/basic-accumulator.png",
height = 103,
priority = "extra-high",
shift = { 0.7, -0.2 },
width = 124
},
discharge_animation = {
frame_width = 147,
filename = "__base__/graphics/entity/basic-accumulator/basic-accumulator-discharge-animation.png",
animation_speed = 0.5,
line_length = 8,
shift = { 0.395, -0.525 },
frame_count = 24,
frame_height = 128
},
minable = {
result = "basic-accumulator",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "player-creation" },
working_sound = {
idle_sound = {
filename = "__base__/sound/accumulator-idle.ogg",
volume = 0.4
},
sound = {
filename = "__base__/sound/accumulator-working.ogg",
volume = 1
},
max_sounds_per_type = 5
},
name = "basic-accumulator",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 48,
offset_deviation = { { -0.9, -0.9 }, { 0.9, 0.9 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
discharge_cooldown = 60,
max_health = 150,
charge_cooldown = 30,
charge_animation = {
frame_width = 138,
filename = "__base__/graphics/entity/basic-accumulator/basic-accumulator-charge-animation.png",
animation_speed = 0.5,
line_length = 8,
shift = { 0.482, -0.638 },
frame_count = 24,
frame_height = 135
}
}
},
market = {
market = {
corpse = "big-remnants",
type = "market",
subgroup = "production-machine",
picture = {
height = 127,
shift = { 0.95, 0.2 },
filename = "__base__/graphics/entity/market/market.png",
width = 156
},
order = "d-a-a",
collision_box = { { -1.4, -1.4 }, { 1.4, 1.4 } },
flags = { "placeable-neutral", "player-creation" },
selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
name = "market",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 117,
offset_deviation = { { -1.4, -1.4 }, { 1.4, 1.4 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
max_health = 150,
icon = "__base__/graphics/icons/market.png"
}
},
pump = {
["small-pump"] = {
corpse = "small-remnants",
fast_replaceable_group = "pipe",
animations = {
west = {
frame_width = 56,
filename = "__base__/graphics/entity/small-pump/small-pump-left.png",
animation_speed = 0.5,
shift = { 0.3125, 0.0625 },
frame_count = 8,
frame_height = 44
},
south = {
frame_width = 61,
filename = "__base__/graphics/entity/small-pump/small-pump-down.png",
animation_speed = 0.5,
shift = { 0.421875, -0.125 },
frame_count = 8,
frame_height = 58
},
east = {
frame_width = 51,
filename = "__base__/graphics/entity/small-pump/small-pump-right.png",
animation_speed = 0.5,
shift = { 0.265625, -0.21875 },
frame_count = 8,
frame_height = 56
},
north = {
frame_width = 46,
filename = "__base__/graphics/entity/small-pump/small-pump-up.png",
animation_speed = 0.5,
shift = { 0.09375, 0.03125 },
frame_count = 8,
frame_height = 56
}
},
energy_usage = "30kW",
fluid_box = {
pipe_connections = { {
type = "output",
position = { 0, -1 }
}, {
type = "input",
position = { 0, 1 }
} },
base_area = 1,
pipe_covers = {
west = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-west.png",
width = 32
},
south = {
height = 52,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-south.png",
width = 46
},
east = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-east.png",
width = 32
},
north = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-north.png",
width = 44
}
}
},
pumping_speed = 0.5,
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
icon = "__base__/graphics/icons/small-pump.png",
energy_source = {
emissions = 0.004,
type = "electric",
usage_priority = "secondary-input"
},
type = "pump",
minable = {
mining_time = 1,
result = "small-pump"
},
flags = { "placeable-neutral", "player-creation" },
name = "small-pump",
resistances = { {
percent = 70,
type = "fire"
} },
max_health = 80,
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 5,
offset_deviation = { { -0.29, -0.29 }, { 0.29, 0.29 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
collision_box = { { -0.29, -0.29 }, { 0.29, 0.29 } }
}
},
projectile = {
rocket = {
type = "projectile",
action = {
action_delivery = {
target_effects = { {
entity_name = "explosion",
type = "create-entity"
}, {
damage = {
type = "explosion",
amount = 60
},
type = "damage"
} },
type = "instant"
},
type = "direct"
},
animation = {
frame_count = 1,
filename = "__base__/graphics/entity/rocket/rocket.png",
priority = "high",
frame_height = 30,
frame_width = 10
},
smoke = { {
deviation = { 0.15, 0.15 },
slow_down_factor = 1,
starting_frame_speed_deviation = 5,
starting_frame_deviation = 5,
name = "smoke-fast",
position = { 0, 0 },
starting_frame_speed = 0,
starting_frame = 3,
frequency = 1
} },
flags = { "not-on-map" },
name = "rocket",
shadow = {
frame_count = 1,
filename = "__base__/graphics/entity/rocket/rocket-shadow.png",
priority = "high",
frame_height = 30,
frame_width = 10
},
acceleration = 0.005,
light = {
intensity = 0.5,
size = 4
}
},
["explosive-rocket"] = {
type = "projectile",
action = {
action_delivery = {
target_effects = { {
entity_name = "explosion",
type = "create-entity"
}, {
action = {
type = "area",
action_delivery = {
target_effects = { {
damage = {
type = "explosion",
amount = 40
},
type = "damage"
}, {
entity_name = "explosion",
type = "create-entity"
} },
type = "instant"
},
perimeter = 6.5
},
type = "nested-result"
} },
type = "instant"
},
type = "direct"
},
animation = {
frame_count = 1,
filename = "__base__/graphics/entity/rocket/rocket.png",
priority = "high",
frame_height = 30,
frame_width = 10
},
smoke = { {
deviation = { 0.15, 0.15 },
slow_down_factor = 1,
starting_frame_speed_deviation = 5,
starting_frame_deviation = 5,
name = "smoke-fast",
position = { 0, 0 },
starting_frame_speed = 0,
starting_frame = 3,
frequency = 1
} },
flags = { "not-on-map" },
name = "explosive-rocket",
shadow = {
frame_count = 1,
filename = "__base__/graphics/entity/rocket/rocket-shadow.png",
priority = "high",
frame_height = 30,
frame_width = 10
},
acceleration = 0.005,
light = {
intensity = 0.5,
size = 4
}
},
["piercing-shotgun-pellet"] = {
flags = { "not-on-map" },
type = "projectile",
name = "piercing-shotgun-pellet",
animation = {
frame_count = 1,
filename = "__base__/graphics/entity/piercing-bullet/piercing-bullet.png",
priority = "high",
frame_height = 50,
frame_width = 3
},
action = {
action_delivery = {
target_effects = {
damage = {
type = "physical",
amount = 6
},
type = "damage"
},
type = "instant"
},
type = "direct"
},
collision_box = { { -0.05, -1 }, { 0.05, 1 } },
direction_only = true,
acceleration = 0
},
["poison-capsule"] = {
type = "projectile",
action = {
action_delivery = {
target_effects = {
entity_name = "poison-cloud",
type = "create-entity"
},
type = "instant"
},
type = "direct"
},
animation = {
frame_count = 1,
filename = "__base__/graphics/entity/poison-capsule/poison-capsule.png",
priority = "high",
frame_height = 32,
frame_width = 32
},
smoke = { {
deviation = { 0.15, 0.15 },
slow_down_factor = 1,
starting_frame_speed_deviation = 5,
starting_frame_deviation = 5,
name = "smoke-fast",
position = { 0, 0 },
starting_frame_speed = 0,
starting_frame = 3,
frequency = 1
} },
flags = { "not-on-map" },
name = "poison-capsule",
shadow = {
frame_count = 1,
filename = "__base__/graphics/entity/poison-capsule/poison-capsule-shadow.png",
priority = "high",
frame_height = 32,
frame_width = 32
},
acceleration = 0.005,
light = {
intensity = 0.5,
size = 4
}
},
["blue-laser"] = {
flags = { "not-on-map" },
type = "projectile",
name = "blue-laser",
animation = {
frame_count = 1,
filename = "__base__/graphics/entity/blue-laser/blue-laser.png",
priority = "high",
frame_height = 14,
frame_width = 7
},
speed = 0.15,
acceleration = 0.005,
action = {
action_delivery = {
target_effects = { {
entity_name = "laser-bubble",
type = "create-entity"
}, {
damage = {
type = "laser",
amount = 10
},
type = "damage"
} },
type = "instant"
},
type = "direct"
},
light = {
intensity = 0.5,
size = 10
}
},
["destroyer-capsule"] = {
type = "projectile",
action = {
action_delivery = {
target_effects = { {
entity_name = "destroyer",
type = "create-entity",
offset = { -0.7, -0.7 }
}, {
entity_name = "destroyer",
type = "create-entity",
offset = { -0.7, 0.7 }
}, {
entity_name = "destroyer",
type = "create-entity",
offset = { 0.7, -0.7 }
}, {
entity_name = "destroyer",
type = "create-entity",
offset = { 0.7, 0.7 }
}, {
entity_name = "destroyer",
type = "create-entity",
offset = { 0, 0 }
} },
type = "instant"
},
type = "direct"
},
animation = {
frame_count = 1,
filename = "__base__/graphics/entity/combat-robot-capsule/destroyer-capsule.png",
priority = "high",
frame_height = 32,
frame_width = 32
},
smoke = { {
deviation = { 0.15, 0.15 },
slow_down_factor = 1,
starting_frame_speed_deviation = 5,
starting_frame_deviation = 5,
name = "smoke-fast",
position = { 0, 0 },
starting_frame_speed = 0,
starting_frame = 3,
frequency = 1
} },
flags = { "not-on-map" },
name = "destroyer-capsule",
shadow = {
frame_count = 1,
filename = "__base__/graphics/entity/combat-robot-capsule/combat-robot-capsule-shadow.png",
priority = "high",
frame_height = 32,
frame_width = 32
},
acceleration = 0.005,
light = {
intensity = 0.5,
size = 4
}
},
["basic-grenade"] = {
flags = { "not-on-map" },
type = "projectile",
name = "basic-grenade",
animation = {
frame_count = 1,
filename = "__base__/graphics/entity/basic-grenade/basic-grenade.png",
priority = "high",
frame_height = 24,
frame_width = 24
},
shadow = {
frame_count = 1,
filename = "__base__/graphics/entity/basic-grenade/basic-grenade-shadow.png",
priority = "high",
frame_height = 32,
frame_width = 24
},
acceleration = 0.005,
action = {
action_delivery = {
target_effects = { {
entity_name = "huge-explosion",
type = "create-entity"
}, {
action = {
type = "area",
action_delivery = {
target_effects = { {
damage = {
type = "explosion",
amount = 25
},
type = "damage"
}, {
entity_name = "explosion",
type = "create-entity"
} },
type = "instant"
},
perimeter = 6.5
},
type = "nested-result"
} },
type = "instant"
},
type = "direct"
},
light = {
intensity = 0.5,
size = 4
}
},
laser = {
flags = { "not-on-map" },
type = "projectile",
name = "laser",
animation = {
frame_count = 1,
filename = "__base__/graphics/entity/laser/laser.png",
priority = "high",
frame_height = 14,
frame_width = 7
},
speed = 0.15,
acceleration = 0.005,
action = {
action_delivery = {
target_effects = { {
entity_name = "laser-bubble",
type = "create-entity"
}, {
damage = {
type = "laser",
amount = 5
},
type = "damage"
} },
type = "instant"
},
type = "direct"
},
light = {
intensity = 0.5,
size = 10
}
},
["acid-projectile-purple"] = {
flags = { "not-on-map" },
type = "projectile",
name = "acid-projectile-purple",
animation = {
frame_width = 16,
filename = "__base__/graphics/entity/acid-projectile-purple/acid-projectile-purple.png",
line_length = 5,
priority = "high",
frame_count = 33,
frame_height = 18
},
shadow = {
frame_width = 28,
filename = "__base__/graphics/entity/acid-projectile-purple/acid-projectile-purple-shadow.png",
shift = { -0.09, 0.395 },
line_length = 5,
priority = "high",
frame_count = 33,
frame_height = 16
},
rotatable = false,
action = {
action_delivery = {
target_effects = { {
entity_name = "acid-splash-purple",
type = "create-entity"
}, {
damage = {
type = "acid",
amount = 10
},
type = "damage"
} },
type = "instant"
},
type = "direct"
},
acceleration = 0.005
},
["shotgun-pellet"] = {
flags = { "not-on-map" },
type = "projectile",
name = "shotgun-pellet",
animation = {
frame_count = 1,
filename = "__base__/graphics/entity/bullet/bullet.png",
priority = "high",
frame_height = 50,
frame_width = 3
},
action = {
action_delivery = {
target_effects = {
damage = {
type = "physical",
amount = 4
},
type = "damage"
},
type = "instant"
},
type = "direct"
},
collision_box = { { -0.05, -1 }, { 0.05, 1 } },
direction_only = true,
acceleration = 0
},
["slowdown-capsule"] = {
type = "projectile",
action = {
type = "area",
action_delivery = {
target_effects = {
sticker = "slowdown-sticker",
type = "create-sticker"
},
type = "instant"
},
perimeter = 9
},
animation = {
frame_count = 1,
filename = "__base__/graphics/entity/slowdown-capsule/slowdown-capsule.png",
priority = "high",
frame_height = 32,
frame_width = 32
},
smoke = { {
deviation = { 0.15, 0.15 },
slow_down_factor = 1,
starting_frame_speed_deviation = 5,
starting_frame_deviation = 5,
name = "smoke-fast",
position = { 0, 0 },
starting_frame_speed = 0,
starting_frame = 3,
frequency = 1
} },
flags = { "not-on-map" },
name = "slowdown-capsule",
shadow = {
frame_count = 1,
filename = "__base__/graphics/entity/slowdown-capsule/slowdown-capsule-shadow.png",
priority = "high",
frame_height = 32,
frame_width = 32
},
acceleration = 0.005,
light = {
intensity = 0.5,
size = 4
}
},
["distractor-capsule"] = {
type = "projectile",
action = {
action_delivery = {
target_effects = { {
entity_name = "distractor",
type = "create-entity",
offset = { 0.5, -0.5 }
}, {
entity_name = "distractor",
type = "create-entity",
offset = { -0.5, -0.5 }
}, {
entity_name = "distractor",
type = "create-entity",
offset = { 0, 0.5 }
} },
type = "instant"
},
type = "direct"
},
animation = {
frame_count = 1,
filename = "__base__/graphics/entity/combat-robot-capsule/distractor-capsule.png",
priority = "high",
frame_height = 32,
frame_width = 32
},
smoke = { {
deviation = { 0.15, 0.15 },
slow_down_factor = 1,
starting_frame_speed_deviation = 5,
starting_frame_deviation = 5,
name = "smoke-fast",
position = { 0, 0 },
starting_frame_speed = 0,
starting_frame = 3,
frequency = 1
} },
flags = { "not-on-map" },
name = "distractor-capsule",
shadow = {
frame_count = 1,
filename = "__base__/graphics/entity/combat-robot-capsule/combat-robot-capsule-shadow.png",
priority = "high",
frame_height = 32,
frame_width = 32
},
acceleration = 0.005,
light = {
intensity = 0.5,
size = 4
}
},
["defender-capsule"] = {
type = "projectile",
action = {
action_delivery = {
target_effects = { {
entity_name = "defender",
type = "create-entity"
} },
type = "instant"
},
type = "direct"
},
animation = {
frame_count = 1,
filename = "__base__/graphics/entity/combat-robot-capsule/defender-capsule.png",
priority = "high",
frame_height = 32,
frame_width = 32
},
smoke = { {
deviation = { 0.15, 0.15 },
slow_down_factor = 1,
starting_frame_speed_deviation = 5,
starting_frame_deviation = 5,
name = "smoke-fast",
position = { 0, 0 },
starting_frame_speed = 0,
starting_frame = 3,
frequency = 1
} },
flags = { "not-on-map" },
name = "defender-capsule",
shadow = {
frame_count = 1,
filename = "__base__/graphics/entity/combat-robot-capsule/combat-robot-capsule-shadow.png",
priority = "high",
frame_height = 32,
frame_width = 32
},
acceleration = 0.005,
light = {
intensity = 0.5,
size = 4
}
}
},
generator = {
["steam-engine"] = {
corpse = "big-remnants",
collision_box = { { -1.35, -2.35 }, { 1.35, 2.35 } },
fluid_usage_per_tick = 0.1,
selection_box = { { -1.5, -2.5 }, { 1.5, 2.5 } },
vertical_animation = {
frame_width = 155,
filename = "__base__/graphics/entity/steam-engine/steam-engine-vertical.png",
line_length = 8,
shift = { 0.812, 0.031 },
frame_count = 32,
frame_height = 186
},
icon = "__base__/graphics/icons/steam-engine.png",
effectivity = 1,
type = "generator",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 190,
offset_deviation = { { -1.35, -2.35 }, { 1.35, 2.35 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
min_perceived_performance = 0.25,
performance_to_sound_speedup = 0.5,
working_sound = {
sound = {
filename = "__base__/sound/steam-engine-90bpm.ogg",
volume = 0.6
},
match_speed_to_activity = true
},
smoke = { {
name = "smoke",
north_position = { 0, -2.2 },
deviation = { 0.2, 0.2 },
east_position = { -1.9, -1.6 },
starting_vertical_speed = 0.05,
frequency = 0.064516129032258
} },
minable = {
mining_time = 1,
result = "steam-engine"
},
flags = { "placeable-neutral", "player-creation" },
horizontal_animation = {
frame_width = 246,
filename = "__base__/graphics/entity/steam-engine/steam-engine-horizontal.png",
line_length = 8,
shift = { 1.34, -0.06 },
frame_count = 32,
frame_height = 137
},
name = "steam-engine",
resistances = { {
percent = 70,
type = "fire"
} },
energy_source = {
usage_priority = "secondary-output",
type = "electric"
},
max_health = 300,
fluid_box = {
pipe_connections = { {
position = { 0, 3 }
}, {
position = { 0, -3 }
} },
base_area = 1,
pipe_covers = {
west = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-west.png",
width = 32
},
south = {
height = 52,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-south.png",
width = 46
},
east = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-east.png",
width = 32
},
north = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-north.png",
width = 44
}
}
},
dying_explosion = "huge-explosion"
}
},
roboport = {
roboport = {
corpse = "big-remnants",
charge_approach_distance = 5,
energy_usage = "200kW",
selection_box = { { -2, -2 }, { 2, 2 } },
recharging_animation = {
frame_width = 37,
filename = "__base__/graphics/entity/roboport/roboport-recharging.png",
animation_speed = 0.5,
scale = 1.5,
priority = "high",
frame_count = 16,
frame_height = 35
},
logistics_radius = 25,
icon = "__base__/graphics/icons/roboport.png",
charging_energy = "200kW",
spawn_and_station_height = 0.33,
minable = {
result = "roboport",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-player", "player-creation" },
name = "roboport",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 173,
offset_deviation = { { -1.7, -1.7 }, { 1.7, 1.7 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
max_health = 500,
recharge_minimum = "20MJ",
base_animation = {
frame_width = 42,
filename = "__base__/graphics/entity/roboport/roboport-base-animation.png",
animation_speed = 0.5,
shift = { -0.5315, -1.9375 },
priority = "medium",
frame_count = 8,
frame_height = 31
},
radius_visualisation_picture = {
height = 12,
filename = "__base__/graphics/entity/roboport/roboport-radius-visualization.png",
width = 12
},
collision_box = { { -1.7, -1.7 }, { 1.7, 1.7 } },
door_animation = {
frame_width = 52,
filename = "__base__/graphics/entity/roboport/roboport-door.png",
shift = { 0, -0.6 },
priority = "medium",
frame_count = 16,
frame_height = 39
},
construction_radius = 50,
stationing_offset = { 0, 0 },
energy_source = {
buffer_capacity = "48MJ",
type = "electric",
usage_priority = "secondary-input",
input_flow_limit = "2MW"
},
type = "roboport",
robot_slots_count = 7,
material_slots_count = 7,
close_door_trigger_effect = { {
sound = {
filename = "__base__/sound/roboport-door.ogg",
volume = 0.75
},
type = "play-sound"
} },
open_door_trigger_effect = { {
sound = {
filename = "__base__/sound/roboport-door.ogg",
volume = 1.2
},
type = "play-sound"
} },
construction_radius_visualisation_picture = {
height = 12,
filename = "__base__/graphics/entity/roboport/roboport-construction-radius-visualization.png",
width = 12
},
request_to_open_door_timeout = 15,
recharging_light = {
intensity = 0.4,
size = 5
},
working_sound = {
sound = {
filename = "__base__/sound/roboport-working.ogg",
volume = 0.6
},
max_sounds_per_type = 3
},
base = {
height = 135,
shift = { 0.5, 0.25 },
filename = "__base__/graphics/entity/roboport/roboport-base.png",
width = 143
},
charging_offsets = { { -1.5, -0.5 }, { 1.5, -0.5 }, { 1.5, 1.5 }, { -1.5, 1.5 } },
dying_explosion = "huge-explosion"
}
},
["construction-robot"] = {
["construction-robot"] = {
shadow = {
height = 37,
priority = "high",
filename = "__base__/graphics/entity/logistic-robot/logistic-robot-shadow.png",
width = 52
},
collision_box = { { 0, 0 }, { 0, 0 } },
selection_box = { { -0.5, -1.5 }, { 0.5, -0.5 } },
speed_multiplier_when_out_of_energy = 0.2,
speed = 0.06,
repair_pack = "repair-pack",
icon = "__base__/graphics/icons/construction-robot.png",
transfer_distance = 0.5,
type = "construction-robot",
picture = {
height = 34,
priority = "high",
filename = "__base__/graphics/entity/construction-robot/construction-robot.png",
width = 37
},
max_to_charge = 0.95,
energy_per_tick = "0.01kJ",
working_sound = {
sound = { {
filename = "__base__/sound/flying-robot-1.ogg",
volume = 0.6
}, {
filename = "__base__/sound/flying-robot-2.ogg",
volume = 0.6
}, {
filename = "__base__/sound/flying-robot-3.ogg",
volume = 0.6
}, {
filename = "__base__/sound/flying-robot-4.ogg",
volume = 0.6
}, {
filename = "__base__/sound/flying-robot-5.ogg",
volume = 0.6
} },
max_sounds_per_type = 3
},
minable = {
result = "construction-robot",
hardness = 0.1,
mining_time = 0.1
},
flags = { "placeable-player", "player-creation", "placeable-off-grid", "not-on-map" },
max_payload_size = 1,
name = "construction-robot",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 4,
offset_deviation = { { 0, 0 }, { 0, 0 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
min_to_charge = 0.2,
max_health = 100,
energy_per_move = "1kJ",
max_energy = "300kJ"
}
},
["logistic-robot"] = {
["logistic-robot"] = {
shadow = {
height = 37,
priority = "high",
filename = "__base__/graphics/entity/logistic-robot/logistic-robot-shadow.png",
width = 52
},
collision_box = { { 0, 0 }, { 0, 0 } },
selection_box = { { -0.5, -1.5 }, { 0.5, -0.5 } },
speed_multiplier_when_out_of_energy = 0.2,
speed = 0.05,
icon = "__base__/graphics/icons/logistic-robot.png",
transfer_distance = 0.5,
type = "logistic-robot",
picture = {
height = 34,
priority = "high",
filename = "__base__/graphics/entity/logistic-robot/logistic-robot.png",
width = 37
},
max_to_charge = 0.95,
energy_per_tick = "0.01kJ",
working_sound = {
sound = { {
filename = "__base__/sound/flying-robot-1.ogg",
volume = 0.6
}, {
filename = "__base__/sound/flying-robot-2.ogg",
volume = 0.6
}, {
filename = "__base__/sound/flying-robot-3.ogg",
volume = 0.6
}, {
filename = "__base__/sound/flying-robot-4.ogg",
volume = 0.6
}, {
filename = "__base__/sound/flying-robot-5.ogg",
volume = 0.6
} },
max_sounds_per_type = 3
},
minable = {
result = "logistic-robot",
hardness = 0.1,
mining_time = 0.1
},
flags = { "placeable-player", "player-creation", "placeable-off-grid", "not-on-map" },
max_payload_size = 1,
name = "logistic-robot",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 4,
offset_deviation = { { 0, 0 }, { 0, 0 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
min_to_charge = 0.2,
max_health = 100,
energy_per_move = "1kJ",
max_energy = "300kJ"
}
},
["unit-spawner"] = {
["biter-spawner"] = {
corpse = "biter-spawner-corpse",
order = "b-b-g",
collision_box = { { -3.2, -2.2 }, { 2.2, 2.2 } },
pollution_cooldown = 10,
autoplace = {
peaks = { {
richness_influence = 100,
influence = 0,
tier_from_start_optimal = 20,
tier_from_start_top_property_limit = 20,
tier_from_start_max_range = 40
}, {
starting_area_weight_max_range = 2,
starting_area_weight_range = 0,
influence = -10,
starting_area_weight_optimal = 1
}, {
noise_octaves_difference = -1.8,
noise_persistence = 0.5,
influence = 0.425,
noise_layer = "enemy-base"
}, {
noise_octaves_difference = -1.8,
tier_from_start_max_range = 40,
influence = 0.5,
tier_from_start_optimal = 20,
noise_persistence = 0.5,
tier_from_start_top_property_limit = 20,
noise_layer = "enemy-base"
} },
richness_base = 0,
control = "enemy-base",
order = "b[enemy]-a[base]",
force = "enemy",
sharpness = 0.4,
richness_multiplier = 1
},
selection_box = { { -3.5, -2.5 }, { 2.5, 2.5 } },
loot = { {
probability = 1,
item = "alien-artifact",
count_min = 2,
count_max = 10
} },
icon = "__base__/graphics/icons/biter-spawner.png",
max_richness_for_spawn_shift = 100,
type = "unit-spawner",
subgroup = "enemies",
max_spawn_shift = 0,
spawning_spacing = 3,
max_friends_around_to_spawn = 5,
spawning_cooldown = { 360, 150 },
max_count_of_owned_units = 7,
flags = { "placeable-player", "placeable-enemy", "not-repairable" },
healing_per_tick = 0.02,
name = "biter-spawner",
resistances = { {
decrease = 2,
type = "physical"
}, {
decrease = 5,
type = "explosion",
percent = 15
} },
animations = { {
axially_symmetrical = false,
frame_width = 257,
stripes = { {
height_in_frames = 4,
width_in_frames = 4,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-1.png",
y = 0
}, {
height_in_frames = 4,
width_in_frames = 4,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-2.png",
y = 0
} },
animation_speed = 0.18,
shift = { 0.359375, -0.125 },
frame_count = 8,
run_mode = "forward-then-backward",
frame_height = 188
}, {
axially_symmetrical = false,
frame_width = 257,
stripes = { {
height_in_frames = 4,
width_in_frames = 4,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-1.png",
y = 188
}, {
height_in_frames = 4,
width_in_frames = 4,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-2.png",
y = 188
} },
animation_speed = 0.18,
shift = { 0.359375, -0.125 },
frame_count = 8,
run_mode = "forward-then-backward",
frame_height = 188
}, {
axially_symmetrical = false,
frame_width = 257,
stripes = { {
height_in_frames = 4,
width_in_frames = 4,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-1.png",
y = 376
}, {
height_in_frames = 4,
width_in_frames = 4,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-2.png",
y = 376
} },
animation_speed = 0.18,
shift = { 0.359375, -0.125 },
frame_count = 8,
run_mode = "forward-then-backward",
frame_height = 188
}, {
axially_symmetrical = false,
frame_width = 257,
stripes = { {
height_in_frames = 4,
width_in_frames = 4,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-1.png",
y = 564
}, {
height_in_frames = 4,
width_in_frames = 4,
filename = "__base__/graphics/entity/biter-spawner/biter-spawner-2.png",
y = 564
} },
animation_speed = 0.18,
shift = { 0.359375, -0.125 },
frame_count = 8,
run_mode = "forward-then-backward",
frame_height = 188
} },
max_health = 350,
result_units = { { "small-biter", 0.3 }, { "medium-biter", 0.3 }, { "big-biter", 0.4 } },
spawning_radius = 10
}
},
["electric-turret"] = {
["laser-turret"] = {
corpse = "small-remnants",
folded_animation = {
direction_count = 4,
line_length = 1,
axially_symmetrical = false,
frame_width = 131,
filename = "__base__/graphics/entity/laser-turret/laser-turret-extension.png",
shift = { 1.171875, -0.34375 },
priority = "medium",
frame_count = 1,
frame_height = 74
},
collision_box = { { -0.4, -0.4 }, { 0.4, 0.4 } },
attack_parameters = {
sound = { {
filename = "__base__/sound/laser.ogg",
volume = 0.4
} },
range = 25,
projectile_center = { 0, 0 },
projectile_creation_distance = 0.6,
damage = 2,
cooldown = 20,
ammo_category = "electric"
},
selection_box = { { -0.4, -0.4 }, { 0.4, 0.4 } },
folding_speed = 0.05,
icon = "__base__/graphics/icons/laser-turret.png",
energy_source = {
drain = "6kW",
type = "electric",
usage_priority = "primary-input",
buffer_capacity = "201kJ",
input_flow_limit = "1200kW"
},
type = "electric-turret",
ammo_type = {
action = { {
action_delivery = { {
projectile = "laser",
type = "projectile",
starting_speed = 0.28
} },
type = "direct"
} },
type = "projectile",
energy_consumption = "200kJ",
category = "laser-turret"
},
prepared_animation = {
frame_height = 72,
line_length = 8,
axially_symmetrical = false,
frame_width = 131,
filename = "__base__/graphics/entity/laser-turret/laser-turret.png",
shift = { 1.328125, -0.375 },
priority = "medium",
frame_count = 1,
direction_count = 64
},
base_picture = {
filename = "__base__/graphics/entity/laser-turret/laser-turret-base.png",
height = 28,
priority = "high",
shift = { 0.109375, 0.03125 },
width = 43
},
folding_animation = {
direction_count = 4,
run_mode = "backward",
axially_symmetrical = false,
frame_width = 131,
filename = "__base__/graphics/entity/laser-turret/laser-turret-extension.png",
shift = { 1.171875, -0.34375 },
priority = "medium",
frame_count = 5,
frame_height = 74
},
minable = {
mining_time = 0.5,
result = "laser-turret"
},
flags = { "placeable-player", "placeable-enemy", "player-creation" },
rotation_speed = 0.01,
name = "laser-turret",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 9,
offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
preparing_animation = {
axially_symmetrical = false,
frame_width = 131,
filename = "__base__/graphics/entity/laser-turret/laser-turret-extension.png",
frame_count = 5,
shift = { 1.171875, -0.34375 },
priority = "medium",
direction_count = 4,
frame_height = 74
},
max_health = 250,
preparing_speed = 0.05,
dying_explosion = "huge-explosion"
}
},
["gui-style"] = {
default = {
outer_frame_style = {
bottom_padding = 0,
type = "frame_style",
right_padding = 0,
flow_style = {
vertical_spacing = 0,
horizontal_spacing = 0,
resize_to_row_height = true,
resize_row_to_width = true
},
title_bottom_padding = 0,
top_padding = 0,
graphical_set = {
type = "none"
},
left_padding = 0
},
mod_list_label_style = {
parent = "label_style",
type = "label_style",
font_color = {
b = 0.1,
g = 0.9,
r = 0.9
},
font = "default-bold"
},
available_technology_slot_style = {
type = "button_style",
hovered_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 72,
x = 148,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
parent = "slot_button_style",
scalable = false,
clicked_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 72,
x = 185,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
default_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 72,
x = 111,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
}
},
tooltip_label_style = {
parent = "description_label_style",
type = "label_style"
},
crafting_queue_slot_style = {
parent = "slot_button_style",
type = "button_style",
pie_progress_color = {
a = 0.5,
b = 0.22,
g = 0.66,
r = 0.98
},
scalable = false
},
quick_bar_frame_style = {
top_padding = 8,
type = "frame_style"
},
partially_promised_crafting_queue_slot_style = {
type = "button_style",
hovered_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 72,
x = 257,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
parent = "crafting_queue_slot_style",
scalable = false,
clicked_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 108,
x = 257,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
default_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 36,
x = 257,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
}
},
red_circuit_network_content_slot_style = {
parent = "not_available_slot_button_style",
type = "button_style"
},
dialog_button_style = {
type = "button_style",
parent = "button_style",
left_click_sound = { {
filename = "__core__/sound/gui-click.ogg",
volume = 1
} },
minimal_width = 100,
minimal_height = 30
},
caption_label_style = {
parent = "label_style",
type = "label_style",
font_color = {
b = 0.22,
g = 0.66,
r = 0.98
},
font = "default-bold"
},
goal_frame_style = {
parent = "frame_style",
type = "frame_style"
},
frame_style = {
type = "frame_style",
right_padding = 8,
title_top_padding = 0,
top_padding = 2,
left_padding = 8,
bottom_padding = 8,
font = "default-frame",
title_left_padding = 0,
flow_style = {
vertical_spacing = 8,
horizontal_spacing = 8
},
title_bottom_padding = 15,
font_color = {
b = 1,
g = 1,
r = 1
},
graphical_set = {
corner_size = { 3, 3 },
type = "composition",
filename = "__core__/graphics/gui.png",
position = { 8, 0 }
},
title_right_padding = 0
},
description_flow_style = {
parent = "flow_style",
type = "flow_style",
vertical_spacing = 2
},
description_label_style = {
parent = "label_style",
type = "label_style",
font = "default-semibold"
},
dropdown_style = {
type = "dropdown_style",
right_padding = 6,
default_graphical_set = {
corner_size = { 3, 3 },
type = "composition",
filename = "__core__/graphics/gui.png",
position = { 0, 0 }
},
top_padding = 3,
left_padding = 6,
bottom_padding = 3,
font = "default",
hovered_graphical_set = {
corner_size = { 3, 3 },
type = "composition",
filename = "__core__/graphics/gui.png",
position = { 0, 8 }
},
triangle_image = {
y = 6,
x = 36,
filename = "__core__/graphics/gui.png",
height = 5,
width = 10
},
clicked_graphical_set = {
corner_size = { 3, 3 },
type = "composition",
filename = "__core__/graphics/gui.png",
position = { 0, 16 }
},
listbox_style = {
font = "default"
}
},
mod_dependency_invalid_label_style = {
parent = "label_style",
type = "label_style",
font_color = {
b = 0.3,
g = 0.2,
r = 1
}
},
scenario_message_dialog_style = {
bottom_padding = 10,
type = "frame_style",
right_padding = 0,
top_padding = 0,
graphical_set = {
corner_size = { 13, 13 },
type = "composition",
filename = "__core__/graphics/arrows/hint-orange-box.png",
position = { 0, 0 }
},
left_padding = 5
},
table_spacing_flow_style = {
vertical_spacing = 5,
type = "flow_style",
horizontal_spacing = 5
},
load_game_mod_invalid_listbox_item_style = {
type = "listbox_item_style",
default = {
background_color = {
a = 0,
b = 0,
g = 0,
r = 0
},
font_color = {
b = 0.3,
g = 0.2,
r = 1
}
},
parent = "listbox_item_style",
selected = {
background_color = {
a = 0,
b = 0,
g = 0,
r = 0
},
font_color = {
b = 0.3,
g = 0.2,
r = 1
}
},
hovered = {
background_color = {
a = 0,
b = 0,
g = 0,
r = 0
},
font_color = {
b = 0.3,
g = 0.2,
r = 1
}
}
},
disabled_technology_slot_style = {
parent = "slot_button_style",
type = "button_style",
visible = false,
scalable = false
},
mod_disabled_listbox_item_style = {
type = "listbox_item_style",
default = {
font_color = {
b = 0.5,
g = 0.5,
r = 0.5
}
},
parent = "listbox_item_style",
selected = {
font_color = {
b = 0.5,
g = 0.5,
r = 0.5
}
},
hovered = {
font_color = {
b = 0.5,
g = 0.5,
r = 0.5
}
}
},
recipe_tooltip_cannot_craft_label_style = {
parent = "tooltip_label_style",
type = "label_style",
font_color = {
b = 0.3,
g = 0.2,
r = 1
}
},
flow_style = {
vertical_spacing = 8,
type = "flow_style",
resize_row_to_width = false,
resize_to_row_height = false,
horizontal_spacing = 8,
max_on_row = 0
},
frame_caption_label_style = {
parent = "label_style",
type = "label_style",
font_color = {
b = 1,
g = 1,
r = 1
},
font = "default-frame"
},
description_title_label_style = {
parent = "description_label_style",
type = "label_style",
font = "default-bold"
},
technology_preview_frame_style = {
parent = "inner_frame_in_outer_frame_style",
type = "frame_style",
flow_style = {
minimal_width = 450,
resize_row_to_width = true,
max_on_row = 1
}
},
image_tab_selected_slot_style = {
clicked_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 108,
x = 75,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
type = "button_style",
hovered_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 108,
x = 75,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
default_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 108,
x = 75,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
parent = "image_tab_slot_style",
scalable = false,
height = 61,
width = 61
},
health_progressbar_style = {
type = "progressbar_style",
font = "default",
smooth_color = {
g = 1
},
smooth_bar = {
x = 223,
filename = "__core__/graphics/gui.png",
height = 11,
priority = "extra-high",
width = 1
},
smooth_size = 500,
font_color = {
b = 1,
g = 1,
r = 1
},
smooth_bar_background = {
x = 224,
filename = "__core__/graphics/gui.png",
height = 13,
priority = "extra-high",
width = 1
}
},
listbox_style = {
item_style = {
parent = "listbox_item_style"
},
type = "listbox_style",
left_click_sound = { {
filename = "__core__/sound/listbox-click.ogg",
volume = 1
} },
font = "default-listbox"
},
slider_style = {
type = "slider_style",
button_style = {
right_padding = 0,
default_graphical_set = {
monolith_image = {
height = 15,
x = 47,
filename = "__core__/graphics/gui.png",
width = 15
},
type = "monolith"
},
top_padding = 0,
width = 15,
bottom_padding = 0,
hovered_graphical_set = {
monolith_image = {
height = 15,
x = 63,
filename = "__core__/graphics/gui.png",
width = 15
},
type = "monolith"
},
height = 15,
clicked_graphical_set = {
monolith_image = {
height = 15,
x = 79,
filename = "__core__/graphics/gui.png",
width = 15
},
type = "monolith"
},
left_padding = 0
},
height = 15,
right_side_graphical_set = {
corner_size = { 3, 3 },
type = "composition",
filename = "__core__/graphics/gui.png",
position = { 16, 0 }
},
left_side_graphical_set = {
corner_size = { 3, 3 },
type = "composition",
filename = "__core__/graphics/gui.png",
position = { 0, 8 }
},
width = 300
},
burning_progressbar_style = {
smooth_color = {
r = 1
},
type = "progressbar_style"
},
progressbar_style = {
diode_empty = {
height = 20,
priority = "extra-high",
filename = "__core__/graphics/diode-grey.png",
width = 20
},
type = "progressbar_style",
smooth_color = {
g = 1
},
font_color = {
b = 1,
g = 1,
r = 1
},
smooth_bar = {
x = 221,
filename = "__core__/graphics/gui.png",
height = 5,
priority = "extra-high",
width = 1
},
font = "default",
progressbar_type = "smooth",
other_smooth_colors = {},
diode_full = {
height = 20,
priority = "extra-high",
filename = "__core__/graphics/diode-green.png",
width = 20
},
diode_count = 10,
smooth_size = 200,
smooth_bar_background = {
x = 222,
filename = "__core__/graphics/gui.png",
height = 7,
priority = "extra-high",
width = 1
}
},
load_game_mod_disabled_listbox_item_style = {
type = "listbox_item_style",
default = {
background_color = {
a = 0,
b = 0,
g = 0,
r = 0
},
font_color = {
b = 0.5,
g = 0.5,
r = 0.5
}
},
parent = "listbox_item_style",
selected = {
background_color = {
a = 0,
b = 0,
g = 0,
r = 0
},
font_color = {
b = 0.5,
g = 0.5,
r = 0.5
}
},
hovered = {
background_color = {
a = 0,
b = 0,
g = 0,
r = 0
},
font_color = {
b = 0.5,
g = 0.5,
r = 0.5
}
}
},
tab_style = {
type = "tab_style",
right_padding = 8,
border_color = {
b = 0.6,
g = 0.6,
r = 0.6
},
top_padding = 8,
left_padding = 8,
bottom_padding = 8,
font = "default-bold",
selected_font_color = {
b = 0.22,
g = 0.66,
r = 0.98
},
default_font_color = {
b = 1,
g = 1,
r = 1
}
},
mining_progressbar_style = {
parent = "health_progressbar_style",
type = "progressbar_style",
smooth_color = {
b = 0.22,
g = 0.66,
r = 0.98
}
},
slot_table_style = {
vertical_spacing = 2,
type = "table_style",
horizontal_spacing = 2
},
listbox_item_style = {
selected = {
background_color = {
b = 0.22,
g = 0.66,
r = 0.98
},
font_color = {}
},
type = "listbox_item_style",
default = {
background_color = {},
font_color = {
b = 1,
g = 1,
r = 1
}
},
hovered = {
background_color = {
b = 0.4,
g = 0.4,
r = 0.4
},
font_color = {
b = 1,
g = 1,
r = 1
}
}
},
tool_bar_frame_style = {
top_padding = 8,
type = "frame_style"
},
scenario_message_dialog_label_style = {
parent = "label_style",
type = "label_style",
font_color = {
b = 0,
g = 0,
r = 0
},
font = "scenario-message-dialog"
},
tooltip_frame_style = {
graphical_set = {
right_monolith_border = 0,
type = "monolith",
monolith_image = {
y = 3,
x = 11,
filename = "__core__/graphics/gui.png",
height = 1,
width = 1
},
bottom_monolith_border = 0,
left_monolith_border = 0,
top_monolith_border = 0
},
type = "frame_style"
},
fake_disabled_button_style = {
type = "button_style",
hovered_graphical_set = {
corner_size = { 3, 3 },
type = "composition",
filename = "__core__/graphics/gui.png",
position = { 0, 0 }
},
clicked_font_color = {
b = 0.5,
g = 0.5,
r = 0.5
},
parent = "button_style",
clicked_graphical_set = {
corner_size = { 3, 3 },
type = "composition",
filename = "__core__/graphics/gui.png",
position = { 0, 0 }
},
default_font_color = {
b = 0.5,
g = 0.5,
r = 0.5
},
hovered_font_color = {
b = 0.5,
g = 0.5,
r = 0.5
}
},
checkbox_style = {
type = "checkbox_style",
checked = {
y = 17,
x = 94,
filename = "__core__/graphics/gui.png",
height = 16,
width = 16
},
font = "default",
default_background = {
y = 17,
x = 43,
filename = "__core__/graphics/gui.png",
height = 16,
width = 16
},
hovered_background = {
y = 17,
x = 60,
filename = "__core__/graphics/gui.png",
height = 16,
width = 16
},
font_color = {
b = 1,
g = 1,
r = 1
},
clicked_background = {
y = 17,
x = 77,
filename = "__core__/graphics/gui.png",
height = 16,
width = 16
}
},
electric_satisfaction_progressbar_style = {
parent = "progressbar_style",
type = "progressbar_style",
other_smooth_colors = { {
color = {
b = 0,
g = 0,
r = 1
},
less_then = 0.5
}, {
color = {
b = 0,
g = 1,
r = 1
},
less_then = 1
} }
},
selected_slot_button_style = {
type = "button_style",
hovered_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 108,
x = 75,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
parent = "slot_button_style",
clicked_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 108,
x = 75,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
default_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 108,
x = 75,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
}
},
statistics_progressbar_style = {
parent = "progressbar_style",
type = "progressbar_style",
smooth_size = 160
},
green_circuit_network_content_slot_style = {
parent = "researched_technology_slot_style",
type = "button_style"
},
battery_progressbar_style = {
parent = "health_progressbar_style",
type = "progressbar_style"
},
bonus_progressbar_style = {
parent = "production_progressbar_style",
type = "progressbar_style",
smooth_color = {
b = 0.8,
r = 0.8
}
},
recipe_tooltip_transitive_craft_label_style = {
parent = "tooltip_label_style",
type = "label_style",
font_color = {
b = 0.22,
g = 0.66,
r = 0.98
}
},
shield_progressbar_style = {
parent = "health_progressbar_style",
type = "progressbar_style",
smooth_color = {
b = 0.8,
g = 0.2,
r = 0.8
}
},
production_progressbar_style = {
type = "progressbar_style"
},
mod_invalid_listbox_item_style = {
type = "listbox_item_style",
default = {
font_color = {
b = 0.3,
g = 0.2,
r = 1
}
},
parent = "listbox_item_style",
selected = {
font_color = {
b = 0.3,
g = 0.2,
r = 1
}
},
hovered = {
font_color = {
b = 0.3,
g = 0.2,
r = 1
}
}
},
available_preview_technology_slot_style = {
type = "button_style",
parent = "available_technology_slot_style",
scalable = false,
height = 68,
width = 68
},
scrollbar_style = {
background_color = {
b = 0.5,
g = 0.5,
r = 0.5
},
type = "scrollbar_style"
},
electric_usage_label_style = {
parent = "label_style",
type = "label_style",
width = 60
},
vehicle_health_progressbar_style = {
parent = "health_progressbar_style",
type = "progressbar_style",
smooth_color = {
b = 0.8,
g = 0.8,
r = 0.8
}
},
graph_style = {
type = "graph_style",
height = 200,
line_colors = { {
b = 0.69,
g = 0.41,
r = 0.22
}, {
b = 0.18,
g = 0.48,
r = 0.85
}, {
b = 0.31,
g = 0.58,
r = 0.24
}, {
b = 0.16,
g = 0.1,
r = 0.8
}, {
b = 0.32,
g = 0.31,
r = 0.32
}, {
b = 0.6,
g = 0.29,
r = 0.41
}, {
b = 0.15,
g = 0.14,
r = 0.57
}, {
b = 0.23,
g = 0.54,
r = 0.58
} },
background_color = {
a = 0.9,
b = 0.1,
g = 0.1,
r = 0.1
},
width = 550
},
right_container_frame_style = {
parent = "outer_frame_style",
type = "frame_style",
flow_style = {
vertical_spacing = 0,
horizontal_spacing = 0,
minimum_width = 275,
resize_row_to_width = true,
max_on_row = 1
}
},
textbox_style = {
type = "textbox_style",
selection_background_color = {
b = 0.83,
g = 0.7,
r = 0.66
},
font_color = {},
graphical_set = {
corner_size = { 3, 3 },
type = "composition",
filename = "__core__/graphics/gui.png",
position = { 16, 0 }
},
font = "default"
},
not_available_preview_technology_slot_style = {
type = "button_style",
parent = "not_available_technology_slot_style",
scalable = false,
height = 68,
width = 68
},
label_style = {
type = "label_style",
font_color = {
b = 1,
g = 1,
r = 1
},
font = "default"
},
tool_equip_gui_label_style = {
parent = "description_label_style",
type = "label_style"
},
minimap_frame_style = {
parent = "frame_in_right_container_style",
type = "frame_style",
minimal_height = 250
},
table_style = {
vertical_spacing = 5,
type = "table_style",
horizontal_spacing = 5
},
frame_in_right_container_style = {
minimal_width = 250,
type = "frame_style"
},
tooltip_title_label_style = {
parent = "description_label_style",
type = "label_style",
font = "default-bold"
},
inner_frame_in_outer_frame_style = {
title_bottom_padding = 5,
type = "frame_style"
},
slot_with_filter_button_style = {
type = "button_style",
hovered_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 36,
x = 221,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
parent = "slot_button_style",
clicked_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 36,
x = 221,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
default_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 36,
x = 221,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
}
},
cursor_box = {
copy = { {
sprite = {
y = 96,
x = 128,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.46875, 0.46875 },
width = 32
},
max_side_length = 0.4
}, {
sprite = {
y = 96,
x = 96,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 0.7
}, {
sprite = {
y = 96,
x = 64,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 1.05
}, {
sprite = {
y = 96,
x = 32,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 2
}, {
sprite = {
y = 96,
x = 0,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 3
} },
regular = { {
sprite = {
y = 0,
x = 128,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.46875, 0.46875 },
width = 32
},
max_side_length = 0.4
}, {
sprite = {
y = 0,
x = 96,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 0.7
}, {
sprite = {
y = 0,
x = 64,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 1.05
}, {
sprite = {
y = 0,
x = 32,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 2
}, {
sprite = {
y = 0,
x = 0,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 2.5
} },
electricity = { {
sprite = {
y = 64,
x = 128,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.46875, 0.46875 },
width = 32
},
max_side_length = 0.4
}, {
sprite = {
y = 64,
x = 96,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 0.7
}, {
sprite = {
y = 64,
x = 64,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 1.05
}, {
sprite = {
y = 64,
x = 32,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 2
}, {
sprite = {
y = 64,
x = 0,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 3
} },
not_allowed = { {
sprite = {
y = 32,
x = 128,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.46875, 0.46875 },
width = 32
},
max_side_length = 0.4
}, {
sprite = {
y = 32,
x = 96,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 0.7
}, {
sprite = {
y = 32,
x = 64,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 1.05
}, {
sprite = {
y = 32,
x = 32,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 2
}, {
sprite = {
y = 32,
x = 0,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 3
} },
logistics = { {
sprite = {
y = 64,
x = 128,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.46875, 0.46875 },
width = 32
},
max_side_length = 0.4
}, {
sprite = {
y = 64,
x = 96,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 0.7
}, {
sprite = {
y = 64,
x = 64,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 1.05
}, {
sprite = {
y = 64,
x = 32,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 2
}, {
sprite = {
y = 64,
x = 0,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 3
} },
pair = { {
sprite = {
y = 64,
x = 128,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.46875, 0.46875 },
width = 32
},
max_side_length = 0.4
}, {
sprite = {
y = 64,
x = 96,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 0.7
}, {
sprite = {
y = 64,
x = 64,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 1.05
}, {
sprite = {
y = 64,
x = 32,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 2
}, {
sprite = {
y = 64,
x = 0,
filename = "__core__/graphics/cursor-boxes.png",
height = 32,
shift = { 0.5, 0.5 },
width = 32
},
max_side_length = 3
} }
},
button_style = {
pie_progress_color = {
b = 1,
g = 1,
r = 1
},
type = "button_style",
right_padding = 5,
clicked_graphical_set = {
corner_size = { 3, 3 },
type = "composition",
filename = "__core__/graphics/gui.png",
position = { 0, 16 }
},
align = "center",
top_padding = 5,
disabled_font_color = {
b = 0.5,
g = 0.5,
r = 0.5
},
left_padding = 5,
bottom_padding = 5,
font = "default-button",
hovered_graphical_set = {
corner_size = { 3, 3 },
type = "composition",
filename = "__core__/graphics/gui.png",
position = { 0, 8 }
},
disabled_graphical_set = {
corner_size = { 3, 3 },
type = "composition",
filename = "__core__/graphics/gui.png",
position = { 0, 0 }
},
clicked_font_color = {
b = 1,
g = 1,
r = 1
},
hovered_font_color = {
b = 1,
g = 1,
r = 1
},
default_font_color = {
b = 1,
g = 1,
r = 1
},
default_graphical_set = {
corner_size = { 3, 3 },
type = "composition",
filename = "__core__/graphics/gui.png",
position = { 0, 0 }
}
},
machine_right_part_flow_style = {
vertical_spacing = 5,
type = "flow_style"
},
campaign_levels_listbox_style = {
height = 350,
type = "listbox_style",
width = 300
},
name = "default",
slot_table_spacing_flow_style = {
vertical_spacing = 2,
type = "flow_style",
horizontal_spacing = 2
},
mods_listbox_style = {
height = 350,
type = "listbox_style",
width = 300
},
textfield_style = {
font_color = {},
type = "textfield_style",
right_padding = 2,
minimal_width = 150,
selection_background_color = {
b = 0.83,
g = 0.7,
r = 0.66
},
font = "default",
graphical_set = {
corner_size = { 3, 3 },
type = "composition",
filename = "__core__/graphics/gui.png",
position = { 16, 0 }
},
left_padding = 3
},
logistic_button_selected_slot_style = {
type = "button_style",
parent = "image_tab_selected_slot_style",
scalable = false,
height = 32,
width = 32
},
circuit_condition_sign_button_style = {
bottom_padding = 1,
type = "button_style",
right_padding = 5,
parent = "button_style",
top_padding = 0,
left_padding = 5
},
train_station_listbox_style = {
height = 150,
type = "listbox_style",
width = 250
},
menu_button_style = {
type = "button_style",
left_click_sound = { {
filename = "__core__/sound/gui-click.ogg",
volume = 1
} },
font = "default-button",
parent = "button_style",
minimal_width = 300,
hovered_font_color = {
b = 0,
g = 0,
r = 0
},
minimal_height = 50
},
not_available_slot_button_style = {
type = "button_style",
hovered_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 36,
x = 148,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
parent = "slot_button_style",
clicked_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 36,
x = 185,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
default_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 36,
x = 111,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
}
},
inner_frame_style = {
bottom_padding = 0,
type = "frame_style",
right_padding = 0,
title_bottom_padding = 5,
top_padding = 0,
graphical_set = {
type = "none"
},
left_padding = 0
},
not_available_technology_slot_style = {
type = "button_style",
hovered_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 36,
x = 148,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
parent = "slot_button_style",
scalable = false,
clicked_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 36,
x = 185,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
default_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 36,
x = 111,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
}
},
number_textfield_style = {
minimal_width = 50,
type = "textfield_style"
},
controls_settings_button_style = {
type = "button_style",
right_padding = 2,
parent = "button_style",
top_padding = 0,
left_padding = 2,
bottom_padding = 0,
font = "default-bold",
default_graphical_set = {
corner_size = { 3, 3 },
type = "composition",
filename = "__core__/graphics/gui.png",
position = { 8, 8 }
},
minimal_width = 225,
default_font_color = {},
align = "left"
},
electric_network_sections_table_style = {
type = "table_style",
column_graphical_set = {
corner_size = { 3, 3 },
type = "composition",
filename = "__core__/graphics/gui.png",
position = { 8, 0 }
},
cell_padding = 5,
vertial_spacing = 0,
horizontal_spacing = 0
},
naked_frame_style = {
parent = "inner_frame_style",
type = "frame_style",
title_bottom_padding = 0
},
console_input_textfield_style = {
font_color = {
b = 1,
g = 1,
r = 1
},
type = "textfield_style",
graphical_set = {
right_monolith_border = 0,
type = "monolith",
monolith_image = {
y = 16,
x = 8,
filename = "__core__/graphics/gui.png",
height = 1,
width = 1
},
bottom_monolith_border = 2,
left_monolith_border = 0,
top_monolith_border = 2
},
font = "default-game"
},
map_settings_dropdown_style = {
parent = "dropdown_style",
type = "dropdown_style",
minimal_width = 200
},
menu_frame_style = {
flow_style = {
vertical_spacing = 0
},
type = "frame_style"
},
mod_info_flow_style = {
minimal_width = 500,
type = "listbox_style"
},
load_game_mods_listbox_style = {
parent = "listbox_style",
type = "listbox_style",
item_style = {
parent = "listbox_item_style",
selected = {
background_color = {
a = 0,
b = 0,
g = 0,
r = 0
},
font_color = {
b = 1,
g = 1,
r = 1
}
},
default = {
background_color = {
a = 0,
b = 0,
g = 0,
r = 0
},
font_color = {
b = 1,
g = 1,
r = 1
}
},
hovered = {
background_color = {
a = 0,
b = 0,
g = 0,
r = 0
},
font_color = {
b = 1,
g = 1,
r = 1
}
}
},
font = "default"
},
saves_listbox_style = {
height = 500,
type = "listbox_style",
width = 300
},
train_station_schedule_listbox_style = {
parent = "train_station_listbox_style",
type = "listbox_style"
},
custom_games_listbox_style = {
height = 250,
type = "listbox_style",
width = 300
},
type = "gui-style",
campaigns_listbox_style = {
height = 450,
type = "listbox_style",
width = 300
},
scroll_pane_style = {
horizontal_scroll_bar_spacing = 30,
type = "scroll_pane_style",
vertical_scroll_bar_spacing = 30,
flow_style = {
parent = "flow_style"
}
},
control_settings_table_style = {
vertical_spacing = 7,
type = "table_style",
top_padding = 20,
horizontal_spacing = 5
},
promised_crafting_queue_slot_style = {
type = "button_style",
hovered_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 72,
x = 221,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
parent = "crafting_queue_slot_style",
scalable = false,
clicked_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 108,
x = 221,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
default_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 36,
x = 221,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
}
},
researched_preview_technology_slot_style = {
type = "button_style",
parent = "researched_technology_slot_style",
scalable = false,
height = 68,
width = 68
},
researched_technology_slot_style = {
type = "button_style",
hovered_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 108,
x = 148,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
parent = "slot_button_style",
scalable = false,
clicked_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 108,
x = 185,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
default_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
y = 108,
x = 111,
filename = "__core__/graphics/gui.png",
height = 36,
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
}
},
slot_button_style = {
type = "button_style",
right_padding = 1,
parent = "button_style",
top_padding = 1,
width = 36,
bottom_padding = 1,
pie_progress_color = {
a = 0.5,
b = 0.22,
g = 0.66,
r = 0.98
},
hovered_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
height = 36,
x = 148,
filename = "__core__/graphics/gui.png",
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
clicked_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
height = 36,
x = 185,
filename = "__core__/graphics/gui.png",
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
height = 36,
scalable = false,
default_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
height = 36,
x = 111,
filename = "__core__/graphics/gui.png",
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
left_padding = 1
},
machine_frame_style = {
parent = "inner_frame_in_outer_frame_style",
type = "frame_style",
flow_style = {
horizontal_spacing = 5
}
},
notice_textbox_style = {
type = "textbox_style",
right_padding = 0,
parent = "textbox_style",
top_padding = 0,
left_padding = 0,
bottom_padding = 0,
font = "default",
selection_background_color = {
b = 0.83,
g = 0.7,
r = 0.66
},
graphical_set = {
right_monolith_border = 0,
type = "monolith",
monolith_image = {
y = 50,
x = 0,
filename = "__core__/graphics/gui.png",
height = 1,
width = 1
},
bottom_monolith_border = 0,
left_monolith_border = 0,
top_monolith_border = 0
},
font_color = {
b = 1,
g = 1,
r = 1
}
},
ability_slot_style = {
parent = "slot_button_style",
type = "button_style"
},
logistic_button_slot_style = {
parent = "slot_button_style",
type = "button_style"
},
radiobutton_style = {
type = "radiobutton_style",
hovered_background = {
y = 34,
x = 54,
filename = "__core__/graphics/gui.png",
height = 10,
width = 10
},
font = "default",
default_background = {
y = 34,
x = 43,
filename = "__core__/graphics/gui.png",
height = 10,
width = 10
},
selected = {
y = 34,
x = 75,
filename = "__core__/graphics/gui.png",
height = 10,
width = 10
},
font_color = {
b = 1,
g = 1,
r = 1
},
clicked_background = {
y = 34,
x = 65,
filename = "__core__/graphics/gui.png",
height = 10,
width = 10
}
},
goal_label_style = {
type = "label_style",
parent = "label_style",
font_color = {
b = 1,
g = 1,
r = 1
},
font = "scenario-message-dialog",
width = 400
},
image_tab_slot_style = {
type = "button_style",
hovered_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
height = 36,
x = 111,
filename = "__core__/graphics/gui.png",
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
clicked_graphical_set = {
right_monolith_border = 1,
type = "monolith",
monolith_image = {
height = 36,
x = 111,
filename = "__core__/graphics/gui.png",
width = 36
},
bottom_monolith_border = 1,
left_monolith_border = 1,
top_monolith_border = 1
},
parent = "slot_button_style",
scalable = false,
height = 61,
width = 61
}
}
},
["rail-remnants"] = {
["curved-rail-remnants"] = {
type = "rail-remnants",
subgroup = "remnants",
order = "d[remnants]-b[rail]-b[curved]",
time_before_shading_off = 3600,
selectable_in_game = false,
time_before_removed = 162000,
flags = { "placeable-neutral", "building-direction-8-way", "not-on-map" },
selection_box = { { -1.7, -0.8 }, { 1.7, 0.8 } },
name = "curved-rail-remnants",
pictures = {
curved_rail_horizontal = {
stone_path = {
height = 128,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-horizontal-stone-path.png",
width = 256
},
backplates = {
height = 128,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-horizontal-metals-remnants.png",
width = 256
},
ties = {
height = 128,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-horizontal-ties-remnants.png",
width = 256
},
metals = {
height = 128,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-horizontal-metals-remnants.png",
width = 256
}
},
curved_rail_vertical = {
stone_path = {
height = 256,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-vertical-stone-path.png",
width = 128
},
backplates = {
height = 256,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-vertical-metals-remnants.png",
width = 128
},
ties = {
height = 256,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-vertical-ties-remnants.png",
width = 128
},
metals = {
height = 256,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-vertical-metals-remnants.png",
width = 128
}
},
straight_rail_vertical = {
stone_path = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-vertical-stone-path.png",
width = 64
},
backplates = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-vertical-metals-remnants.png",
width = 64
},
ties = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-vertical-ties-remnants.png",
width = 64
},
metals = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-vertical-metals-remnants.png",
width = 64
}
},
straight_rail_horizontal = {
stone_path = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-horizontal-stone-path.png",
width = 64
},
backplates = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-horizontal-metals-remnants.png",
width = 64
},
ties = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-horizontal-ties-remnants.png",
width = 64
},
metals = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-horizontal-metals-remnants.png",
width = 64
}
},
straight_rail_diagonal = {
stone_path = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-diagonal-stone-path.png",
width = 64
},
backplates = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-diagonal-metals-remnants.png",
width = 64
},
ties = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-diagonal-ties-remnants.png",
width = 64
},
metals = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-diagonal-metals-remnants.png",
width = 64
}
}
},
bending_type = "turn",
tile_width = 4,
icon = "__base__/graphics/icons/curved-rail-remnants.png",
tile_height = 8
},
["straight-rail-remnants"] = {
type = "rail-remnants",
subgroup = "remnants",
order = "d[remnants]-b[rail]-a[straight]",
time_before_shading_off = 3600,
selectable_in_game = false,
time_before_removed = 162000,
flags = { "placeable-neutral", "building-direction-8-way", "not-on-map" },
selection_box = { { -0.6, -0.8 }, { 0.6, 0.8 } },
name = "straight-rail-remnants",
pictures = {
curved_rail_horizontal = {
stone_path = {
height = 128,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-horizontal-stone-path.png",
width = 256
},
backplates = {
height = 128,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-horizontal-metals-remnants.png",
width = 256
},
ties = {
height = 128,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-horizontal-ties-remnants.png",
width = 256
},
metals = {
height = 128,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-horizontal-metals-remnants.png",
width = 256
}
},
curved_rail_vertical = {
stone_path = {
height = 256,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-vertical-stone-path.png",
width = 128
},
backplates = {
height = 256,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-vertical-metals-remnants.png",
width = 128
},
ties = {
height = 256,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-vertical-ties-remnants.png",
width = 128
},
metals = {
height = 256,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-vertical-metals-remnants.png",
width = 128
}
},
straight_rail_vertical = {
stone_path = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-vertical-stone-path.png",
width = 64
},
backplates = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-vertical-metals-remnants.png",
width = 64
},
ties = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-vertical-ties-remnants.png",
width = 64
},
metals = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-vertical-metals-remnants.png",
width = 64
}
},
straight_rail_horizontal = {
stone_path = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-horizontal-stone-path.png",
width = 64
},
backplates = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-horizontal-metals-remnants.png",
width = 64
},
ties = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-horizontal-ties-remnants.png",
width = 64
},
metals = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-horizontal-metals-remnants.png",
width = 64
}
},
straight_rail_diagonal = {
stone_path = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-diagonal-stone-path.png",
width = 64
},
backplates = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-diagonal-metals-remnants.png",
width = 64
},
ties = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-diagonal-ties-remnants.png",
width = 64
},
metals = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-diagonal-metals-remnants.png",
width = 64
}
}
},
bending_type = "straight",
tile_width = 2,
icon = "__base__/graphics/icons/straight-rail-remnants.png",
tile_height = 2
}
},
ammo = {
rocket = {
flags = { "goes-to-main-inventory" },
type = "ammo",
name = "rocket",
ammo_type = {
action = {
action_delivery = {
projectile = "rocket",
type = "projectile",
starting_speed = 0.1,
source_effects = {
entity_name = "explosion-gunshot",
type = "create-entity"
}
},
type = "direct"
},
category = "rocket"
},
order = "d[rocket-launcher]-a[basic]",
stack_size = 100,
icon = "__base__/graphics/icons/rocket.png",
subgroup = "ammo"
},
["piercing-bullet-magazine"] = {
type = "ammo",
subgroup = "ammo",
ammo_type = {
action = {
action_delivery = {
type = "instant",
target_effects = { {
entity_name = "explosion-gunshot",
type = "create-entity"
}, {
damage = {
type = "physical",
amount = 5
},
type = "damage"
} },
source_effects = {
entity_name = "explosion-gunshot",
type = "create-entity"
}
},
type = "direct"
},
category = "bullet"
},
order = "a[basic-clips]-b[piercing-bullet-magazine]",
magazine_size = 10,
flags = { "goes-to-main-inventory" },
name = "piercing-bullet-magazine",
icon = "__base__/graphics/icons/piercing-bullet-magazine.png",
stack_size = 100
},
["flame-thrower-ammo"] = {
type = "ammo",
subgroup = "ammo",
ammo_type = {
target_type = "direction",
action = {
action_delivery = { {
starting_frame_deviation = 0.07,
type = "flame-thrower",
projectile_starting_speed = 0.2,
direction_deviation = 0.07,
speed_deviation = 0.1,
starting_distance = 0.6,
explosion = "flame-thrower-explosion",
damage = {
type = "fire",
amount = 20
}
} },
type = "direct"
},
category = "flame-thrower"
},
order = "e[flame-thrower]",
magazine_size = 100,
flags = { "goes-to-main-inventory" },
name = "flame-thrower-ammo",
icon = "__base__/graphics/icons/flame-thrower-ammo.png",
stack_size = 50
},
["piercing-shotgun-shell"] = {
type = "ammo",
subgroup = "ammo",
ammo_type = {
source_effects = {
entity_name = "explosion-gunshot",
type = "create-entity"
},
target_type = "direction",
action = {
type = "direct",
action_delivery = {
type = "projectile",
direction_deviation = 0.3,
projectile = "piercing-shotgun-pellet",
starting_speed = 1,
max_range = 15,
range_deviation = 0.3
},
repeat_count = 16
},
category = "shotgun-shell"
},
order = "b[shotgun]-b[piercing]",
magazine_size = 10,
flags = { "goes-to-main-inventory" },
name = "piercing-shotgun-shell",
icon = "__base__/graphics/icons/piercing-shotgun-shell.png",
stack_size = 100
},
["railgun-dart"] = {
type = "ammo",
subgroup = "ammo",
ammo_type = {
target_type = "direction",
action = {
type = "line",
source_effects = {
entity_name = "railgun-beam",
type = "create-entity"
},
action_delivery = {
target_effects = {
damage = {
type = "physical",
amount = 100
},
type = "damage"
},
type = "instant"
},
range = 25,
width = 0.5
},
category = "railgun"
},
order = "c[railgun]",
magazine_size = 4,
flags = { "goes-to-main-inventory" },
name = "railgun-dart",
icon = "__base__/graphics/icons/railgun-ammo.png",
stack_size = 100
},
["basic-bullet-magazine"] = {
type = "ammo",
subgroup = "ammo",
ammo_type = {
action = { {
action_delivery = { {
type = "instant",
target_effects = { {
entity_name = "explosion-gunshot",
type = "create-entity"
}, {
damage = {
type = "physical",
amount = 2
},
type = "damage"
} },
source_effects = { {
entity_name = "explosion-gunshot",
type = "create-entity"
} }
} },
type = "direct"
} },
category = "bullet"
},
order = "a[basic-clips]-a[basic-bullet-magazine]",
magazine_size = 10,
flags = { "goes-to-main-inventory" },
name = "basic-bullet-magazine",
icon = "__base__/graphics/icons/basic-bullet-magazine.png",
stack_size = 100
},
["explosive-rocket"] = {
flags = { "goes-to-main-inventory" },
type = "ammo",
name = "explosive-rocket",
ammo_type = {
action = {
action_delivery = {
projectile = "explosive-rocket",
type = "projectile",
starting_speed = 0.1,
source_effects = {
entity_name = "explosion-gunshot",
type = "create-entity"
}
},
type = "direct"
},
category = "rocket"
},
order = "d[rocket-launcher]-b[explosive]",
stack_size = 100,
icon = "__base__/graphics/icons/explosive-rocket.png",
subgroup = "ammo"
},
["shotgun-shell"] = {
type = "ammo",
subgroup = "ammo",
ammo_type = {
source_effects = {
entity_name = "explosion-gunshot",
type = "create-entity"
},
target_type = "direction",
action = {
type = "direct",
action_delivery = {
type = "projectile",
direction_deviation = 0.3,
projectile = "shotgun-pellet",
starting_speed = 1,
max_range = 15,
range_deviation = 0.3
},
repeat_count = 12
},
category = "shotgun-shell"
},
order = "b[shotgun]-a[basic]",
magazine_size = 10,
flags = { "goes-to-main-inventory" },
name = "shotgun-shell",
icon = "__base__/graphics/icons/shotgun-shell.png",
stack_size = 100
}
},
boiler = {
boiler = {
corpse = "small-remnants",
fast_replaceable_group = "pipe",
collision_box = { { -0.29, -0.29 }, { 0.29, 0.29 } },
pictures = {
straight_vertical_window = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-straight-vertical-window.png",
width = 44
},
t_down = {
height = 44,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-t-down.png",
width = 40
},
corner_up_left = {
height = 44,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-corner-up-left.png",
width = 44
},
straight_horizontal_window = {
height = 42,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-straight-horizontal-window.png",
width = 32
},
ending_left = {
height = 44,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-ending-left.png",
width = 58
},
ending_down = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-ending-down.png",
width = 44
},
horizontal_window_background = {
height = 42,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-horizontal-window-background.png",
width = 32
},
vertical_window_background = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-vertical-window-background.png",
width = 44
},
ending_up = {
height = 42,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-ending-up.png",
width = 44
},
straight_horizontal = {
height = 42,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-straight-horizontal.png",
width = 32
},
ending_right = {
height = 44,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-ending-right.png",
width = 32
},
middle_temperature_flow = {
height = 18,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/fluid-flow-medium-temperature.png",
width = 160
},
corner_down_right = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-corner-down-right.png",
width = 32
},
fluid_background = {
height = 20,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/fluid-background.png",
width = 32
},
high_temperature_flow = {
height = 18,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/fluid-flow-high-temperature.png",
width = 160
},
t_right = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-t-right.png",
width = 40
},
corner_up_right = {
height = 40,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-corner-up-right.png",
width = 32
},
cross = {
height = 40,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-cross.png",
width = 40
},
t_left = {
height = 42,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-t-left.png",
width = 44
},
straight_vertical = {
height = 42,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-straight-vertical.png",
width = 44
},
straight_vertical_single = {
height = 58,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-straight-vertical-single.png",
width = 44
},
t_up = {
height = 42,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-t-up.png",
width = 32
},
corner_down_left = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-corner-down-left.png",
width = 36
},
low_temperature_flow = {
height = 18,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/fluid-flow-low-temperature.png",
width = 160
}
},
fluid_box = {
pipe_connections = { {
position = { 0, -1 }
}, {
position = { 1, 0 }
}, {
position = { 0, 1 }
}, {
position = { -1, 0 }
} },
base_area = 1,
pipe_covers = {
west = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-west.png",
width = 32
},
south = {
height = 52,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-south.png",
width = 46
},
east = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-east.png",
width = 32
},
north = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe-covers/pipe-cover-north.png",
width = 44
}
}
},
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
burning_cooldown = 20,
icon = "__base__/graphics/icons/boiler.png",
type = "boiler",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 5,
offset_deviation = { { -0.29, -0.29 }, { 0.29, 0.29 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
fire = {
t_up = {
frame_width = 11,
filename = "__base__/graphics/entity/boiler/boiler-fire-down.png",
shift = { 0.03125, 0.28125 },
line_length = 8,
priority = "extra-high",
frame_count = 32,
frame_height = 11
},
right_down = {
frame_width = 5,
filename = "__base__/graphics/entity/boiler/boiler-fire-left.png",
shift = { -0.4375, -0.09375 },
priority = "extra-high",
frame_count = 14,
frame_height = 7
},
down = {
frame_width = 5,
filename = "__base__/graphics/entity/boiler/boiler-fire-left.png",
shift = { -0.4375, -0.09375 },
priority = "extra-high",
frame_count = 14,
frame_height = 7
},
right_up = {
frame_width = 11,
filename = "__base__/graphics/entity/boiler/boiler-fire-down.png",
shift = { 0.03125, 0.28125 },
line_length = 8,
priority = "extra-high",
frame_count = 32,
frame_height = 11
},
left_down = {
frame_width = 6,
filename = "__base__/graphics/entity/boiler/boiler-fire-right.png",
shift = { 0.46875, -0.0625 },
priority = "extra-high",
frame_count = 14,
frame_height = 9
},
left = {
frame_width = 11,
filename = "__base__/graphics/entity/boiler/boiler-fire-down.png",
shift = { 0.03125, 0.28125 },
line_length = 8,
priority = "extra-high",
frame_count = 32,
frame_height = 11
},
left_up = {
frame_width = 11,
filename = "__base__/graphics/entity/boiler/boiler-fire-down.png",
shift = { 0.03125, 0.28125 },
line_length = 8,
priority = "extra-high",
frame_count = 32,
frame_height = 11
}
},
minable = {
result = "boiler",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "player-creation" },
structure = {
t_up = {
height = 70,
priority = "extra-high",
filename = "__base__/graphics/entity/boiler/boiler-t-up.png",
width = 46
},
t_down = {
height = 50,
priority = "extra-high",
filename = "__base__/graphics/entity/boiler/boiler-t-down.png",
width = 44
},
right_down = {
height = 50,
priority = "extra-high",
filename = "__base__/graphics/entity/boiler/boiler-right-down.png",
width = 44
},
down = {
height = 72,
priority = "extra-high",
filename = "__base__/graphics/entity/boiler/boiler-down.png",
width = 66
},
right_up = {
height = 72,
priority = "extra-high",
filename = "__base__/graphics/entity/boiler/boiler-right-up.png",
width = 46
},
left_down = {
height = 50,
priority = "extra-high",
filename = "__base__/graphics/entity/boiler/boiler-left-down.png",
width = 60
},
left = {
filename = "__base__/graphics/entity/boiler/boiler-left.png",
height = 46,
priority = "extra-high",
shift = { 0.03125, 0 },
width = 46
},
left_up = {
height = 74,
priority = "extra-high",
filename = "__base__/graphics/entity/boiler/boiler-left-up.png",
width = 66
}
},
name = "boiler",
resistances = { {
percent = 80,
type = "fire"
} },
working_sound = {
sound = {
filename = "__base__/sound/boiler.ogg",
volume = 0.8
},
max_sounds_per_type = 3
},
max_health = 100,
burner = {
fuel_inventory_size = 1,
smoke = { {
frequency = 1,
name = "smoke",
deviation = { 0.1, 0.1 }
} },
emissions = 0.015384615384615,
effectivity = 0.5
},
energy_consumption = "390kW"
}
},
["flame-thrower-explosion"] = {
["flame-thrower-explosion"] = {
type = "flame-thrower-explosion",
animation_speed = 1,
animations = { {
frame_width = 64,
filename = "__base__/graphics/entity/flame-thrower-explosion/flame-thrower-explosion.png",
line_length = 8,
priority = "extra-high",
frame_count = 64,
frame_height = 64
} },
smoke = "smoke-fast",
smoke_slow_down_factor = 0.95,
flags = { "not-on-map" },
name = "flame-thrower-explosion",
damage = {
type = "fire",
amount = 0.25
},
smoke_count = 1,
slow_down_factor = 0.98,
light = {
intensity = 0.2,
size = 20
}
}
},
rail = {
["straight-rail"] = {
corpse = "straight-rail-remnants",
type = "rail",
collision_box = { { -0.7, -0.8 }, { 0.7, 0.8 } },
pictures = {
curved_rail_horizontal = {
stone_path = {
height = 128,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-horizontal-stone-path.png",
width = 256
},
backplates = {
height = 128,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-horizontal-backplates.png",
width = 256
},
ties = {
height = 128,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-horizontal-ties.png",
width = 256
},
metals = {
height = 128,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-horizontal-metals.png",
width = 256
}
},
curved_rail_vertical = {
stone_path = {
height = 256,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-vertical-stone-path.png",
width = 128
},
backplates = {
height = 256,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-vertical-backplates.png",
width = 128
},
ties = {
height = 256,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-vertical-ties.png",
width = 128
},
metals = {
height = 256,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-vertical-metals.png",
width = 128
}
},
straight_rail_vertical = {
stone_path = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-vertical-stone-path.png",
width = 64
},
backplates = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-vertical-backplates.png",
width = 64
},
ties = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-vertical-ties.png",
width = 64
},
metals = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-vertical-metals.png",
width = 64
}
},
straight_rail_horizontal = {
stone_path = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-horizontal-stone-path.png",
width = 64
},
backplates = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-horizontal-backplates.png",
width = 64
},
ties = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-horizontal-ties.png",
width = 64
},
metals = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-horizontal-metals.png",
width = 64
}
},
straight_rail_diagonal = {
stone_path = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-diagonal-stone-path.png",
width = 64
},
backplates = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-diagonal-backplates.png",
width = 64
},
ties = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-diagonal-ties.png",
width = 64
},
metals = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-diagonal-metals.png",
width = 64
}
}
},
minable = {
mining_time = 1,
result = "straight-rail"
},
flags = { "placeable-neutral", "player-creation", "building-direction-8-way" },
selection_box = { { -0.7, -0.8 }, { 0.7, 0.8 } },
name = "straight-rail",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 33,
offset_deviation = { { -0.7, -0.8 }, { 0.7, 0.8 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
rail_category = "regular",
max_health = 100,
icon = "__base__/graphics/icons/straight-rail.png",
bending_type = "straight"
},
["curved-rail"] = {
corpse = "curved-rail-remnants",
type = "rail",
rail_category = "regular",
collision_box = { { -0.75, -0.55 }, { 0.75, 1.6 } },
pictures = {
curved_rail_horizontal = {
stone_path = {
height = 128,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-horizontal-stone-path.png",
width = 256
},
backplates = {
height = 128,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-horizontal-backplates.png",
width = 256
},
ties = {
height = 128,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-horizontal-ties.png",
width = 256
},
metals = {
height = 128,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-horizontal-metals.png",
width = 256
}
},
curved_rail_vertical = {
stone_path = {
height = 256,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-vertical-stone-path.png",
width = 128
},
backplates = {
height = 256,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-vertical-backplates.png",
width = 128
},
ties = {
height = 256,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-vertical-ties.png",
width = 128
},
metals = {
height = 256,
priority = "extra-high",
filename = "__base__/graphics/entity/curved-rail/curved-rail-vertical-metals.png",
width = 128
}
},
straight_rail_vertical = {
stone_path = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-vertical-stone-path.png",
width = 64
},
backplates = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-vertical-backplates.png",
width = 64
},
ties = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-vertical-ties.png",
width = 64
},
metals = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-vertical-metals.png",
width = 64
}
},
straight_rail_horizontal = {
stone_path = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-horizontal-stone-path.png",
width = 64
},
backplates = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-horizontal-backplates.png",
width = 64
},
ties = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-horizontal-ties.png",
width = 64
},
metals = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-horizontal-metals.png",
width = 64
}
},
straight_rail_diagonal = {
stone_path = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-diagonal-stone-path.png",
width = 64
},
backplates = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-diagonal-backplates.png",
width = 64
},
ties = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-diagonal-ties.png",
width = 64
},
metals = {
height = 64,
priority = "extra-high",
filename = "__base__/graphics/entity/straight-rail/straight-rail-diagonal-metals.png",
width = 64
}
}
},
minable = {
mining_time = 1,
result = "curved-rail"
},
flags = { "placeable-neutral", "player-creation", "building-direction-8-way" },
selection_box = { { -1.7, -0.8 }, { 1.7, 0.8 } },
name = "curved-rail",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 48,
offset_deviation = { { -0.75, -0.55 }, { 0.75, 1.6 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
secondary_collision_box = { { -0.85, -2.6 }, { 0.85, 2.6 } },
max_health = 200,
icon = "__base__/graphics/icons/curved-rail.png",
bending_type = "turn"
}
},
["rail-signal"] = {
["rail-signal"] = {
corpse = "small-remnants",
type = "rail-signal",
animation = {
axially_symmetrical = false,
frame_width = 70,
filename = "__base__/graphics/entity/rail-signal/rail-signal.png",
direction_count = 8,
priority = "high",
frame_count = 3,
frame_height = 46
},
collision_box = { { -0.15, -0.15 }, { 0.15, 0.15 } },
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 4,
offset_deviation = { { -0.15, -0.15 }, { 0.15, 0.15 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
minable = {
mining_time = 1,
result = "rail-signal"
},
flags = { "placeable-neutral", "player-creation", "building-direction-8-way", "filter-directions" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "rail-signal",
orange_light = {
color = {
g = 0.5,
r = 1
},
intensity = 0.2,
size = 4
},
red_light = {
color = {
r = 1
},
intensity = 0.2,
size = 4
},
max_health = 80,
icon = "__base__/graphics/icons/rail-signal.png",
green_light = {
color = {
g = 1
},
intensity = 0.2,
size = 4
}
}
},
item = {
["night-vision-equipment"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "night-vision-equipment",
stack_size = 20,
order = "f[night-vision]-a[night-vision-equipment]",
placed_as_equipment_result = "night-vision-equipment",
icon = "__base__/graphics/icons/night-vision-equipment.png",
subgroup = "equipment"
},
["advanced-circuit"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "advanced-circuit",
order = "d[advanced-circuit]",
stack_size = 200,
icon = "__base__/graphics/icons/advanced-circuit.png",
subgroup = "intermediate-product"
},
["basic-inserter"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "basic-inserter",
stack_size = 50,
order = "b[basic-inserter]",
place_result = "basic-inserter",
icon = "__base__/graphics/icons/basic-inserter.png",
subgroup = "inserter"
},
["gun-turret"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "gun-turret",
stack_size = 50,
order = "b[turret]-a[gun-turret]",
place_result = "gun-turret",
icon = "__base__/graphics/icons/gun-turret.png",
subgroup = "defensive-structure"
},
radar = {
flags = { "goes-to-quickbar" },
type = "item",
name = "radar",
stack_size = 50,
order = "d[radar]-a[radar]",
place_result = "radar",
icon = "__base__/graphics/icons/radar.png",
subgroup = "defensive-structure"
},
["train-stop"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "train-stop",
stack_size = 10,
order = "a[train-system]-c[train-stop]",
place_result = "train-stop",
icon = "__base__/graphics/icons/train-stop.png",
subgroup = "transport"
},
["land-mine"] = {
type = "item",
subgroup = "gun",
order = "f[land-mine]",
flags = { "goes-to-quickbar" },
trigger_radius = 1,
name = "land-mine",
stack_size = 20,
damage_radius = 5,
icon = "__base__/graphics/icons/land-mine.png",
place_result = "land-mine"
},
["fusion-reactor-equipment"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "fusion-reactor-equipment",
stack_size = 20,
order = "a[energy-source]-b[fusion-reactor]",
placed_as_equipment_result = "fusion-reactor-equipment",
icon = "__base__/graphics/icons/fusion-reactor-equipment.png",
subgroup = "equipment"
},
["stone-furnace"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "stone-furnace",
stack_size = 50,
order = "a[stone-furnace]",
place_result = "stone-furnace",
icon = "__base__/graphics/icons/stone-furnace.png",
subgroup = "smelting-machine"
},
["logistic-chest-requester"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "logistic-chest-requester",
stack_size = 50,
order = "b[storage]-c[logistic-chest-requester]",
place_result = "logistic-chest-requester",
icon = "__base__/graphics/icons/logistic-chest-requester.png",
subgroup = "logistic-network"
},
pumpjack = {
flags = { "goes-to-quickbar" },
type = "item",
name = "pumpjack",
stack_size = 20,
order = "b[fluids]-b[pumpjack]",
place_result = "pumpjack",
icon = "__base__/graphics/icons/pumpjack.png",
subgroup = "extraction-machine"
},
["smart-chest"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "smart-chest",
stack_size = 50,
order = "a[items]-d[smart-chest]",
place_result = "smart-chest",
icon = "__base__/graphics/icons/smart-chest.png",
subgroup = "storage"
},
["basic-transport-belt"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "basic-transport-belt",
stack_size = 50,
order = "a[transport-belt]-a[basic-transport-belt]",
place_result = "basic-transport-belt",
icon = "__base__/graphics/icons/basic-transport-belt.png",
subgroup = "belt"
},
car = {
flags = { "goes-to-quickbar" },
type = "item",
name = "car",
stack_size = 1,
order = "b[personal-transport]-a[car]",
place_result = "car",
icon = "__base__/graphics/icons/car.png",
subgroup = "transport"
},
pipe = {
flags = { "goes-to-quickbar" },
type = "item",
name = "pipe",
stack_size = 50,
order = "a[pipe]-a[pipe]",
place_result = "pipe",
icon = "__base__/graphics/icons/pipe.png",
subgroup = "energy-pipe-distribution"
},
["alien-artifact"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "alien-artifact",
order = "g[alien-artifact]",
stack_size = 500,
icon = "__base__/graphics/icons/alien-artifact.png",
subgroup = "raw-material"
},
["cargo-wagon"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "cargo-wagon",
stack_size = 5,
order = "a[train-system]-f[cargo-wagon]",
place_result = "cargo-wagon",
icon = "__base__/graphics/icons/cargo-wagon.png",
subgroup = "transport"
},
wood = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "wood",
stack_size = 50,
order = "a[wood]",
subgroup = "raw-material",
icon = "__base__/graphics/icons/wood.png",
fuel_value = "0.6MJ"
},
["long-handed-inserter"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "long-handed-inserter",
stack_size = 50,
order = "c[long-handed-inserter]",
place_result = "long-handed-inserter",
icon = "__base__/graphics/icons/long-handed-inserter.png",
subgroup = "inserter"
},
roboport = {
flags = { "goes-to-quickbar" },
type = "item",
name = "roboport",
stack_size = 5,
order = "c[signal]-a[roboport]",
place_result = "roboport",
icon = "__base__/graphics/icons/roboport.png",
subgroup = "logistic-network"
},
["energy-shield-mk2-equipment"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "energy-shield-mk2-equipment",
stack_size = 20,
order = "b[shield]-b[energy-shield-equipment-mk2]",
placed_as_equipment_result = "energy-shield-mk2-equipment",
icon = "__base__/graphics/icons/energy-shield-mk2-equipment.png",
subgroup = "equipment"
},
["iron-gear-wheel"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "iron-gear-wheel",
order = "b[iron-gear-wheel]",
stack_size = 100,
icon = "__base__/graphics/icons/iron-gear-wheel.png",
subgroup = "intermediate-product"
},
["pipe-to-ground"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "pipe-to-ground",
stack_size = 50,
order = "a[pipe]-b[pipe-to-ground]",
place_result = "pipe-to-ground",
icon = "__base__/graphics/icons/pipe-to-ground.png",
subgroup = "energy-pipe-distribution"
},
["burner-inserter"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "burner-inserter",
stack_size = 50,
order = "a[burner-inserter]",
place_result = "burner-inserter",
icon = "__base__/graphics/icons/burner-inserter.png",
subgroup = "inserter"
},
["stone-brick"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "stone-brick",
order = "e[stone-brick]",
stack_size = 100,
icon = "__base__/graphics/icons/stone-brick.png",
subgroup = "raw-material"
},
["fast-splitter"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "fast-splitter",
stack_size = 50,
order = "c[splitter]-b[fast-splitter]",
place_result = "fast-splitter",
icon = "__base__/graphics/icons/fast-splitter.png",
subgroup = "belt"
},
["rocket-defense"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "rocket-defense",
stack_size = 5,
order = "e[rocket-defense]",
place_result = "rocket-defense",
icon = "__base__/graphics/icons/rocket-defense.png",
subgroup = "defensive-structure"
},
["electric-engine-unit"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "electric-engine-unit",
order = "g[electric-engine-unit]",
stack_size = 50,
icon = "__base__/graphics/icons/electric-engine-unit.png",
subgroup = "intermediate-product"
},
["offshore-pump"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "offshore-pump",
stack_size = 20,
order = "b[fluids]-a[offshore-pump]",
place_result = "offshore-pump",
icon = "__base__/graphics/icons/offshore-pump.png",
subgroup = "extraction-machine"
},
["basic-exoskeleton-equipment"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "basic-exoskeleton-equipment",
stack_size = 10,
order = "e[exoskeleton]-a[basic-exoskeleton-equipment]",
placed_as_equipment_result = "basic-exoskeleton-equipment",
icon = "__base__/graphics/icons/basic-exoskeleton-equipment.png",
subgroup = "equipment"
},
["storage-tank"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "storage-tank",
stack_size = 50,
order = "b[fluid]-a[storage-tank]",
place_result = "storage-tank",
icon = "__base__/graphics/icons/storage-tank.png",
subgroup = "storage"
},
["flying-robot-frame"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "flying-robot-frame",
order = "j[flying-robot-frame]",
stack_size = 50,
icon = "__base__/graphics/icons/flying-robot-frame.png",
subgroup = "intermediate-product"
},
battery = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "battery",
order = "i[battery]",
stack_size = 200,
icon = "__base__/graphics/icons/battery.png",
subgroup = "intermediate-product"
},
explosives = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "explosives",
order = "h[explosives]",
stack_size = 50,
icon = "__base__/graphics/icons/explosives.png",
subgroup = "intermediate-product"
},
coin = {
flags = { "goes-to-quickbar" },
type = "item",
name = "coin",
order = "y",
stack_size = 100000,
icon = "__base__/graphics/icons/coin.png",
subgroup = "science-pack"
},
["solar-panel-equipment"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "solar-panel-equipment",
stack_size = 20,
order = "a[energy-source]-a[solar-panel]",
placed_as_equipment_result = "solar-panel-equipment",
icon = "__base__/graphics/icons/solar-panel-equipment.png",
subgroup = "equipment"
},
["straight-rail"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "straight-rail",
stack_size = 50,
order = "a[train-system]-a[straight-rail]",
place_result = "straight-rail",
icon = "__base__/graphics/icons/straight-rail.png",
subgroup = "transport"
},
["medium-electric-pole"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "medium-electric-pole",
stack_size = 50,
order = "a[energy]-b[medium-electric-pole]",
place_result = "medium-electric-pole",
icon = "__base__/graphics/icons/medium-electric-pole.png",
subgroup = "energy-pipe-distribution"
},
["plastic-bar"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "plastic-bar",
order = "g[plastic-bar]",
stack_size = 100,
icon = "__base__/graphics/icons/plastic-bar.png",
subgroup = "raw-material"
},
["engine-unit"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "engine-unit",
order = "f[engine-unit]",
stack_size = 50,
icon = "__base__/graphics/icons/engine-unit.png",
subgroup = "intermediate-product"
},
["processing-unit"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "processing-unit",
order = "e[processing-unit]",
stack_size = 100,
icon = "__base__/graphics/icons/processing-unit.png",
subgroup = "intermediate-product"
},
["basic-beacon"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "basic-beacon",
stack_size = 10,
order = "a[beacon]",
place_result = "basic-beacon",
icon = "__base__/graphics/icons/basic-beacon.png",
subgroup = "module"
},
["battery-mk2-equipment"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "battery-mk2-equipment",
stack_size = 20,
order = "c[battery]-b[battery-equipment-mk2]",
placed_as_equipment_result = "battery-mk2-equipment",
icon = "__base__/graphics/icons/battery-mk2-equipment.png",
subgroup = "equipment"
},
["curved-rail"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "curved-rail",
stack_size = 50,
order = "a[train-system]-b[curved-rail]",
place_result = "curved-rail",
icon = "__base__/graphics/icons/curved-rail.png",
subgroup = "transport"
},
["empty-barrel"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "empty-barrel",
order = "a[empty-barrel]",
stack_size = 10,
icon = "__base__/graphics/icons/fluid/empty-barrel.png",
subgroup = "barrel"
},
computer = {
flags = { "goes-to-quickbar" },
type = "item",
name = "computer",
order = "g[computer]",
stack_size = 1,
icon = "__base__/graphics/icons/computer.png",
subgroup = "defensive-structure"
},
["copper-plate"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "copper-plate",
order = "c[copper-plate]",
stack_size = 100,
icon = "__base__/graphics/icons/copper-plate.png",
subgroup = "raw-material"
},
sulfur = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "sulfur",
order = "f[sulfur]",
stack_size = 50,
icon = "__base__/graphics/icons/sulfur.png",
subgroup = "raw-material"
},
["fast-transport-belt"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "fast-transport-belt",
stack_size = 50,
order = "a[transport-belt]-b[fast-transport-belt]",
place_result = "fast-transport-belt",
icon = "__base__/graphics/icons/fast-transport-belt.png",
subgroup = "belt"
},
["chemical-plant"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "chemical-plant",
stack_size = 10,
order = "e[chemical-plant]",
place_result = "chemical-plant",
icon = "__base__/graphics/icons/chemical-plant.png",
subgroup = "production-machine"
},
["oil-refinery"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "oil-refinery",
stack_size = 10,
order = "d[refinery]",
place_result = "oil-refinery",
icon = "__base__/graphics/icons/oil-refinery.png",
subgroup = "production-machine"
},
["solar-panel"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "solar-panel",
stack_size = 50,
order = "d[solar-panel]-a[solar-panel]",
place_result = "solar-panel",
icon = "__base__/graphics/icons/solar-panel.png",
subgroup = "energy"
},
["small-pump"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "small-pump",
stack_size = 50,
order = "b[pipe]-c[small-pump]",
place_result = "small-pump",
icon = "__base__/graphics/icons/small-pump.png",
subgroup = "energy-pipe-distribution"
},
["crude-oil-barrel"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "crude-oil-barrel",
order = "b[crude-oil-barrel]",
stack_size = 10,
icon = "__base__/graphics/icons/fluid/crude-oil-barrel.png",
subgroup = "barrel"
},
["basic-mining-drill"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "basic-mining-drill",
stack_size = 50,
order = "a[items]-b[basic-mining-drill]",
place_result = "basic-mining-drill",
icon = "__base__/graphics/icons/basic-mining-drill.png",
subgroup = "extraction-machine"
},
["basic-accumulator"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "basic-accumulator",
stack_size = 50,
order = "e[accumulator]-a[basic-accumulator]",
place_result = "basic-accumulator",
icon = "__base__/graphics/icons/basic-accumulator.png",
subgroup = "energy"
},
["red-wire"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "red-wire",
order = "a[wires]-a[red-wire]",
stack_size = 200,
icon = "__base__/graphics/icons/red-wire.png",
subgroup = "circuit-network"
},
["smart-inserter"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "smart-inserter",
stack_size = 50,
order = "f[inserter]-e[smart-inserter]",
place_result = "smart-inserter",
icon = "__base__/graphics/icons/smart-inserter.png",
subgroup = "inserter"
},
["assembling-machine-3"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "assembling-machine-3",
stack_size = 50,
order = "c[assembling-machine-3]",
place_result = "assembling-machine-3",
icon = "__base__/graphics/icons/assembling-machine-3.png",
subgroup = "production-machine"
},
["logistic-robot"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "logistic-robot",
stack_size = 50,
order = "a[robot]-a[logistic-robot]",
place_result = "logistic-robot",
icon = "__base__/graphics/icons/logistic-robot.png",
subgroup = "logistic-network"
},
["assembling-machine-1"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "assembling-machine-1",
stack_size = 50,
order = "a[assembling-machine-1]",
place_result = "assembling-machine-1",
icon = "__base__/graphics/icons/assembling-machine-1.png",
subgroup = "production-machine"
},
["electronic-circuit"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "electronic-circuit",
order = "c[electronic-circuit]",
stack_size = 200,
icon = "__base__/graphics/icons/electronic-circuit.png",
subgroup = "intermediate-product"
},
substation = {
flags = { "goes-to-quickbar" },
type = "item",
name = "substation",
stack_size = 50,
order = "a[energy]-d[substation]",
place_result = "substation",
icon = "__base__/graphics/icons/substation.png",
subgroup = "energy-pipe-distribution"
},
["basic-transport-belt-to-ground"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "basic-transport-belt-to-ground",
stack_size = 50,
order = "b[transport-belt-to-ground]-a[basic-transport-belt-to-ground]",
place_result = "basic-transport-belt-to-ground",
icon = "__base__/graphics/icons/basic-transport-belt-to-ground.png",
subgroup = "belt"
},
["big-electric-pole"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "big-electric-pole",
stack_size = 50,
order = "a[energy]-c[big-electric-pole]",
place_result = "big-electric-pole",
icon = "__base__/graphics/icons/big-electric-pole.png",
subgroup = "energy-pipe-distribution"
},
["logistic-chest-active-provider"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "logistic-chest-active-provider",
stack_size = 50,
order = "b[storage]-c[logistic-chest-active-provider]",
place_result = "logistic-chest-active-provider",
icon = "__base__/graphics/icons/logistic-chest-active-provider.png",
subgroup = "logistic-network"
},
["logistic-chest-storage"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "logistic-chest-storage",
stack_size = 50,
order = "b[storage]-c[logistic-chest-storage]",
place_result = "logistic-chest-storage",
icon = "__base__/graphics/icons/logistic-chest-storage.png",
subgroup = "logistic-network"
},
["logistic-chest-passive-provider"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "logistic-chest-passive-provider",
stack_size = 50,
order = "b[storage]-c[logistic-chest-passive-provider]",
place_result = "logistic-chest-passive-provider",
icon = "__base__/graphics/icons/logistic-chest-passive-provider.png",
subgroup = "logistic-network"
},
["construction-robot"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "construction-robot",
stack_size = 50,
order = "a[robot]-b[construction-robot]",
place_result = "construction-robot",
icon = "__base__/graphics/icons/construction-robot.png",
subgroup = "logistic-network"
},
["basic-splitter"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "basic-splitter",
stack_size = 50,
order = "c[splitter]-a[basic-splitter]",
place_result = "basic-splitter",
icon = "__base__/graphics/icons/basic-splitter.png",
subgroup = "belt"
},
["solid-fuel"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "solid-fuel",
stack_size = 50,
order = "c[solid-fuel]",
subgroup = "raw-resource",
icon = "__base__/graphics/icons/solid-fuel.png",
fuel_value = "25MJ"
},
["energy-shield-equipment"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "energy-shield-equipment",
stack_size = 20,
order = "b[shield]-a[energy-shield-equipment]",
placed_as_equipment_result = "energy-shield-equipment",
icon = "__base__/graphics/icons/energy-shield-equipment.png",
subgroup = "equipment"
},
["basic-laser-defense-equipment"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "basic-laser-defense-equipment",
stack_size = 20,
order = "d[active-defense]-a[basic-laser-defense-equipment]",
placed_as_equipment_result = "basic-laser-defense-equipment",
icon = "__base__/graphics/icons/basic-laser-defense-equipment.png",
subgroup = "equipment"
},
["diesel-locomotive"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "diesel-locomotive",
stack_size = 5,
order = "a[train-system]-e[diesel-locomotive]",
place_result = "diesel-locomotive",
icon = "__base__/graphics/icons/diesel-locomotive.png",
subgroup = "transport"
},
["express-transport-belt-to-ground"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "express-transport-belt-to-ground",
stack_size = 50,
order = "b[transport-belt-to-ground]-c[express-transport-belt-to-ground]",
place_result = "express-transport-belt-to-ground",
icon = "__base__/graphics/icons/express-transport-belt-to-ground.png",
subgroup = "belt"
},
["fast-transport-belt-to-ground"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "fast-transport-belt-to-ground",
stack_size = 50,
order = "b[transport-belt-to-ground]-b[fast-transport-belt-to-ground]",
place_result = "fast-transport-belt-to-ground",
icon = "__base__/graphics/icons/fast-transport-belt-to-ground.png",
subgroup = "belt"
},
["copper-ore"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "copper-ore",
order = "f[copper-ore]",
stack_size = 50,
icon = "__base__/graphics/icons/copper-ore.png",
subgroup = "raw-resource"
},
["green-wire"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "green-wire",
order = "a[wires]-b[green-wire]",
stack_size = 200,
icon = "__base__/graphics/icons/green-wire.png",
subgroup = "circuit-network"
},
["steel-plate"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "steel-plate",
order = "d[steel-plate]",
stack_size = 100,
icon = "__base__/graphics/icons/steel-plate.png",
subgroup = "raw-material"
},
["small-electric-pole"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "small-electric-pole",
stack_size = 50,
order = "a[energy]-a[small-electric-pole]",
place_result = "small-electric-pole",
icon = "__base__/graphics/icons/small-electric-pole.png",
subgroup = "energy-pipe-distribution"
},
stone = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "stone",
order = "d[stone]",
stack_size = 50,
icon = "__base__/graphics/icons/stone.png",
subgroup = "raw-resource"
},
["burner-mining-drill"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "burner-mining-drill",
stack_size = 50,
order = "a[items]-a[burner-mining-drill]",
place_result = "burner-mining-drill",
icon = "__base__/graphics/icons/burner-mining-drill.png",
subgroup = "extraction-machine"
},
["assembling-machine-2"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "assembling-machine-2",
stack_size = 50,
order = "b[assembling-machine-2]",
place_result = "assembling-machine-2",
icon = "__base__/graphics/icons/assembling-machine-2.png",
subgroup = "production-machine"
},
["alien-science-pack"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "alien-science-pack",
order = "d[alien-science-pack]",
stack_size = 200,
icon = "__base__/graphics/icons/alien-science-pack.png",
subgroup = "science-pack"
},
["science-pack-3"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "science-pack-3",
order = "a[science-pack-3]",
stack_size = 200,
icon = "__base__/graphics/icons/science-pack-3.png",
subgroup = "science-pack"
},
["laser-turret"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "laser-turret",
stack_size = 50,
order = "b[turret]-b[laser-turret]",
place_result = "laser-turret",
icon = "__base__/graphics/icons/laser-turret.png",
subgroup = "defensive-structure"
},
boiler = {
flags = { "goes-to-quickbar" },
type = "item",
name = "boiler",
stack_size = 50,
order = "b[steam-power]-a[boiler]",
place_result = "boiler",
icon = "__base__/graphics/icons/boiler.png",
subgroup = "energy"
},
["science-pack-1"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "science-pack-1",
order = "a[science-pack-1]",
stack_size = 200,
icon = "__base__/graphics/icons/science-pack-1.png",
subgroup = "science-pack"
},
wall = {
flags = { "goes-to-quickbar" },
type = "item",
name = "wall",
stack_size = 50,
order = "a[wall]-a[wall]",
place_result = "wall",
icon = "__base__/graphics/icons/wall.png",
subgroup = "defensive-structure"
},
["rail-signal"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "rail-signal",
stack_size = 50,
order = "a[train-system]-d[rail-signal]",
place_result = "rail-signal",
icon = "__base__/graphics/icons/rail-signal.png",
subgroup = "transport"
},
["raw-wood"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "raw-wood",
stack_size = 50,
order = "a[raw-wood]",
subgroup = "raw-material",
icon = "__base__/graphics/icons/raw-wood.png",
fuel_value = "4MJ"
},
coal = {
type = "item",
subgroup = "raw-material",
order = "b[coal]",
flags = { "goes-to-main-inventory" },
dark_background_icon = "__base__/graphics/icons/coal-dark-background.png",
name = "coal",
stack_size = 50,
icon = "__base__/graphics/icons/coal.png",
fuel_value = "8MJ"
},
["small-lamp"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "small-lamp",
stack_size = 50,
order = "c[light]-a[small-lamp]",
place_result = "small-lamp",
icon = "__base__/graphics/icons/small-lamp.png",
subgroup = "energy"
},
["iron-ore"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "iron-ore",
order = "e[iron-ore]",
stack_size = 50,
icon = "__base__/graphics/icons/iron-ore.png",
subgroup = "raw-resource"
},
["steam-engine"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "steam-engine",
stack_size = 10,
order = "b[steam-power]-b[steam-engine]",
place_result = "steam-engine",
icon = "__base__/graphics/icons/steam-engine.png",
subgroup = "energy"
},
["iron-plate"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "iron-plate",
order = "b[iron-plate]",
stack_size = 100,
icon = "__base__/graphics/icons/iron-plate.png",
subgroup = "raw-material"
},
["iron-chest"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "iron-chest",
stack_size = 50,
order = "a[items]-b[iron-chest]",
place_result = "iron-chest",
icon = "__base__/graphics/icons/iron-chest.png",
subgroup = "storage"
},
["science-pack-2"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "science-pack-2",
order = "a[science-pack-2]",
stack_size = 200,
icon = "__base__/graphics/icons/science-pack-2.png",
subgroup = "science-pack"
},
["express-splitter"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "express-splitter",
stack_size = 50,
order = "c[splitter]-c[express-splitter]",
place_result = "express-splitter",
icon = "__base__/graphics/icons/express-splitter.png",
subgroup = "belt"
},
["wooden-chest"] = {
type = "item",
subgroup = "storage",
order = "a[items]-a[wooden-chest]",
flags = { "goes-to-quickbar" },
name = "wooden-chest",
stack_size = 50,
place_result = "wooden-chest",
icon = "__base__/graphics/icons/wooden-chest.png",
fuel_value = "6MJ"
},
["electric-furnace"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "electric-furnace",
stack_size = 50,
order = "c[electric-furnace]",
place_result = "electric-furnace",
icon = "__base__/graphics/icons/electric-furnace.png",
subgroup = "smelting-machine"
},
["fast-inserter"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "fast-inserter",
stack_size = 50,
order = "d[fast-inserter]",
place_result = "fast-inserter",
icon = "__base__/graphics/icons/fast-inserter.png",
subgroup = "inserter"
},
["steel-furnace"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "steel-furnace",
stack_size = 50,
order = "b[steel-furnace]",
place_result = "steel-furnace",
icon = "__base__/graphics/icons/steel-furnace.png",
subgroup = "smelting-machine"
},
["player-port"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "player-port",
stack_size = 50,
order = "z[not-used]",
place_result = "player-port",
icon = "__base__/graphics/icons/player-port.png",
subgroup = "defensive-structure"
},
lab = {
flags = { "goes-to-quickbar" },
type = "item",
name = "lab",
stack_size = 10,
order = "g[lab]",
place_result = "lab",
icon = "__base__/graphics/icons/lab.png",
subgroup = "production-machine"
},
["iron-stick"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "iron-stick",
order = "a[iron-stick]",
stack_size = 100,
icon = "__base__/graphics/icons/iron-stick.png",
subgroup = "intermediate-product"
},
["copper-cable"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "copper-cable",
order = "0[copper-cable]",
stack_size = 200,
icon = "__base__/graphics/icons/copper-cable.png",
subgroup = "circuit-network"
},
["steel-chest"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "steel-chest",
stack_size = 50,
order = "a[items]-c[steel-chest]",
place_result = "steel-chest",
icon = "__base__/graphics/icons/steel-chest.png",
subgroup = "storage"
},
["basic-electric-discharge-defense-equipment"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "basic-electric-discharge-defense-equipment",
stack_size = 20,
order = "d[active-defense]-b[basic-electric-discharge-defense-equipment]",
placed_as_equipment_result = "basic-electric-discharge-defense-equipment",
icon = "__base__/graphics/icons/basic-electric-discharge-defense-equipment.png",
subgroup = "equipment"
},
["small-plane"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "small-plane",
order = "h[small-plane]",
stack_size = 1,
icon = "__base__/graphics/icons/small-plane.png",
subgroup = "defensive-structure"
},
["battery-equipment"] = {
flags = { "goes-to-main-inventory" },
type = "item",
name = "battery-equipment",
stack_size = 20,
order = "c[battery]-a[battery-equipment]",
placed_as_equipment_result = "battery-equipment",
icon = "__base__/graphics/icons/battery-equipment.png",
subgroup = "equipment"
},
["express-transport-belt"] = {
flags = { "goes-to-quickbar" },
type = "item",
name = "express-transport-belt",
stack_size = 50,
order = "a[transport-belt]-c[express-transport-belt]",
place_result = "express-transport-belt",
icon = "__base__/graphics/icons/express-transport-belt.png",
subgroup = "belt"
}
},
wall = {
wall = {
corpse = "wall-remnants",
type = "wall",
repair_speed_modifier = 2,
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 5,
offset_deviation = { { -0.29, -0.29 }, { 0.29, 0.29 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
collision_box = { { -0.29, -0.29 }, { 0.29, 0.29 } },
pictures = {
single = { {
filename = "__base__/graphics/entity/wall/wall-single.png",
height = 58,
priority = "extra-high",
shift = { 0.1, 0.1 },
width = 33
} },
t_left = { {
filename = "__base__/graphics/entity/wall/wall-t-left.png",
height = 38,
priority = "extra-high",
shift = { 0, -0.09375 },
width = 32
} },
t_down = { {
filename = "__base__/graphics/entity/wall/wall-t-down.png",
height = 53,
priority = "extra-high",
shift = { 0, 0.140625 },
width = 32
} },
corner_left_up = { {
filename = "__base__/graphics/entity/wall/wall-corner-left-up.png",
height = 58,
priority = "extra-high",
shift = { 0.296875, 0.03125 },
width = 51
} },
corner_left_down = { {
filename = "__base__/graphics/entity/wall/wall-corner-left-down.png",
height = 42,
priority = "extra-high",
shift = { 0.21875, -0.15625 },
width = 46
} },
ending_down = { {
filename = "__base__/graphics/entity/wall/wall-ending-down.png",
height = 36,
priority = "extra-high",
shift = { 0.296875, -0.0625 },
width = 51
} },
corner_right_down = { {
filename = "__base__/graphics/entity/wall/wall-corner-right-down.png",
height = 42,
priority = "extra-high",
shift = { 0, -0.15625 },
width = 32
} },
straight_horizontal = { {
filename = "__base__/graphics/entity/wall/wall-straight-horizontal-1.png",
height = 57,
priority = "extra-high",
shift = { 0, 0.078125 },
width = 32
}, {
filename = "__base__/graphics/entity/wall/wall-straight-horizontal-2.png",
height = 57,
priority = "extra-high",
shift = { 0, 0.078125 },
width = 32
}, {
filename = "__base__/graphics/entity/wall/wall-straight-horizontal-3.png",
height = 55,
priority = "extra-high",
shift = { 0, 0.078125 },
width = 32
} },
ending_right = { {
filename = "__base__/graphics/entity/wall/wall-ending-right.png",
height = 58,
priority = "extra-high",
shift = { 0, 0.0625 },
width = 32
} },
t_right = { {
filename = "__base__/graphics/entity/wall/wall-t-right.png",
height = 38,
priority = "extra-high",
shift = { 0.296875, -0.09375 },
width = 51
} },
t_up = { {
filename = "__base__/graphics/entity/wall/wall-t-up.png",
height = 44,
priority = "extra-high",
shift = { 0, -0.1875 },
width = 32
} },
straight_vertical_under_ending = { {
filename = "__base__/graphics/entity/wall/wall-straight-vertical-under-ending.png",
height = 32,
priority = "extra-high",
shift = { 0.296875, 0 },
width = 51
} },
straight_vertical = { {
filename = "__base__/graphics/entity/wall/wall-straight-vertical-1.png",
height = 32,
priority = "extra-high",
shift = { 0.296875, 0 },
width = 51
}, {
filename = "__base__/graphics/entity/wall/wall-straight-vertical-2.png",
height = 32,
priority = "extra-high",
shift = { 0.296875, 0 },
width = 51
} },
ending_left = { {
filename = "__base__/graphics/entity/wall/wall-ending-left.png",
height = 57,
priority = "extra-high",
shift = { 0.1875, 0.078125 },
width = 44
} },
ending_up = { {
filename = "__base__/graphics/entity/wall/wall-ending-up.png",
height = 47,
priority = "extra-high",
shift = { 0.5, 0.234375 },
width = 64
} },
cross = { {
filename = "__base__/graphics/entity/wall/wall-cross.png",
height = 38,
priority = "extra-high",
shift = { 0, -0.09375 },
width = 32
} },
corner_right_up = { {
filename = "__base__/graphics/entity/wall/wall-corner-right-up.png",
height = 53,
priority = "extra-high",
shift = { 0, 0.171875 },
width = 32
} }
},
minable = {
mining_time = 1,
result = "wall"
},
flags = { "placeable-neutral", "player-creation" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "wall",
repair_sound = {
filename = "__base__/sound/manual-repair-simple.ogg"
},
resistances = { {
decrease = 3,
type = "physical",
percent = 20
}, {
decrease = 10,
type = "explosion",
percent = 30
}, {
percent = 100,
type = "fire"
}, {
percent = 70,
type = "laser"
} },
max_health = 350,
icon = "__base__/graphics/icons/wall.png",
mined_sound = {
filename = "__base__/sound/deconstruct-bricks.ogg"
}
}
},
["cargo-wagon"] = {
["cargo-wagon"] = {
corpse = "medium-remnants",
air_resistance = 0.002,
sound_minimum_speed = 0.5,
braking_force = 3,
collision_box = { { -0.6, -2.4 }, { 0.6, 2.4 } },
pictures = {
frame_height = 218,
line_length = 4,
axially_symmetrical = false,
frame_width = 285,
filenames = { "__base__/graphics/entity/cargo-wagon/cargo-wagon-spritesheet-1.png", "__base__/graphics/entity/cargo-wagon/cargo-wagon-spritesheet-2.png", "__base__/graphics/entity/cargo-wagon/cargo-wagon-spritesheet-3.png", "__base__/graphics/entity/cargo-wagon/cargo-wagon-spritesheet-4.png" },
lines_per_file = 8,
shift = { 0.7, -0.45 },
priority = "very-low",
direction_count = 128,
back_equals_front = true
},
back_light = { {
minimum_darkness = 0.3,
intensity = 0.6,
color = {
r = 1
},
shift = { -0.6, 3.5 },
size = 2
}, {
minimum_darkness = 0.3,
intensity = 0.6,
color = {
r = 1
},
shift = { 0.6, 3.5 },
size = 2
} },
selection_box = { { -0.7, -2.5 }, { 1, 2.5 } },
inventory_size = 20,
open_sound = {
filename = "__base__/sound/machine-open.ogg",
volume = 0.85
},
weight = 1000,
crash_trigger = {
sound = { {
filename = "__base__/sound/car-crash.ogg",
volume = 0.8
} },
type = "play-sound"
},
joint_distance = 4,
icon = "__base__/graphics/icons/cargo-wagon.png",
working_sound = {
sound = {
filename = "__base__/sound/train-wheels.ogg",
volume = 0.5
},
match_volume_to_activity = true
},
friction_force = 0.0015,
type = "cargo-wagon",
stand_by_light = { {
minimum_darkness = 0.3,
intensity = 0.5,
color = {
b = 1
},
shift = { -0.6, -3.5 },
size = 2
}, {
minimum_darkness = 0.3,
intensity = 0.5,
color = {
b = 1
},
shift = { 0.6, -3.5 },
size = 2
} },
drive_over_tie_trigger = {
sound = { {
filename = "__base__/sound/train-tie-1.ogg",
volume = 0.6
}, {
filename = "__base__/sound/train-tie-2.ogg",
volume = 0.6
}, {
filename = "__base__/sound/train-tie-3.ogg",
volume = 0.6
}, {
filename = "__base__/sound/train-tie-4.ogg",
volume = 0.6
} },
type = "play-sound"
},
rail_category = "regular",
tie_distance = 50,
energy_per_hit_point = 5,
minable = {
mining_time = 1,
result = "cargo-wagon"
},
flags = { "placeable-neutral", "player-creation", "placeable-off-grid", "not-on-map" },
connection_distance = 3.3,
name = "cargo-wagon",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 86,
offset_deviation = { { -0.6, -2.4 }, { 0.6, 2.4 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
max_speed = 1.5,
max_health = 600,
close_sound = {
filename = "__base__/sound/machine-close.ogg",
volume = 0.75
},
dying_explosion = "huge-explosion"
}
},
["solar-panel"] = {
["solar-panel"] = {
corpse = "big-remnants",
type = "solar-panel",
picture = {
height = 96,
priority = "high",
filename = "__base__/graphics/entity/solar-panel/solar-panel.png",
width = 104
},
collision_box = { { -1.4, -1.4 }, { 1.4, 1.4 } },
minable = {
result = "solar-panel",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "player-creation" },
selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
name = "solar-panel",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 117,
offset_deviation = { { -1.4, -1.4 }, { 1.4, 1.4 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
production = "60kW",
max_health = 100,
icon = "__base__/graphics/icons/solar-panel.png",
energy_source = {
usage_priority = "primary-output",
type = "electric"
}
}
},
radar = {
radar = {
corpse = "big-remnants",
max_distance_of_sector_revealed = 14,
collision_box = { { -1.4, -1.4 }, { 1.4, 1.4 } },
pictures = {
frame_height = 131,
line_length = 8,
apply_projection = false,
axially_symmetrical = false,
frame_width = 153,
filename = "__base__/graphics/entity/radar/radar.png",
shift = { 0.875, -0.35 },
priority = "low",
direction_count = 64
},
selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
energy_per_sector = "10MJ",
icon = "__base__/graphics/icons/radar.png",
energy_source = {
usage_priority = "secondary-input",
type = "electric"
},
energy_per_nearby_scan = "250kJ",
type = "radar",
minable = {
result = "radar",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-player", "player-creation" },
name = "radar",
resistances = { {
percent = 70,
type = "fire"
} },
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 117,
offset_deviation = { { -1.4, -1.4 }, { 1.4, 1.4 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
max_health = 150,
working_sound = {
sound = { {
filename = "__base__/sound/radar.ogg"
} },
apparent_volume = 2
},
energy_usage = "300kW"
}
},
decorative = {
["big-ship-wreck-grass"] = {
type = "decorative",
subgroup = "wrecks",
order = "d[remnants]-d[ship-wreck-grass]-a[big]",
collision_box = { { -2.5, -1.5 }, { 2.5, 1.5 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -2.8, -1.7 }, { 2.8, 1.7 } },
name = "big-ship-wreck-grass",
render_layer = "floor",
icon = "__base__/graphics/icons/ship-wreck/big-ship-wreck-grass.png",
pictures = { {
height = 112,
filename = "__base__/graphics/entity/ship-wreck/big-ship-wreck-grass.png",
width = 206
} }
},
["green-asterisk"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-b[asterisk]-b[green]",
collision_box = { { -0.7, -0.7 }, { 0.7, 0.7 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "green-asterisk",
pictures = { {
height = 24,
filename = "__base__/graphics/entity/decorative/green-asterisk/green-asterisk-01.png",
width = 25
}, {
height = 22,
filename = "__base__/graphics/entity/decorative/green-asterisk/green-asterisk-02.png",
width = 25
}, {
height = 21,
filename = "__base__/graphics/entity/decorative/green-asterisk/green-asterisk-03.png",
width = 29
}, {
height = 23,
filename = "__base__/graphics/entity/decorative/green-asterisk/green-asterisk-04.png",
width = 27
}, {
height = 24,
filename = "__base__/graphics/entity/decorative/green-asterisk/green-asterisk-05.png",
width = 38
}, {
height = 22,
filename = "__base__/graphics/entity/decorative/green-asterisk/green-asterisk-06.png",
width = 32
}, {
height = 21,
filename = "__base__/graphics/entity/decorative/green-asterisk/green-asterisk-07.png",
width = 40
}, {
height = 29,
filename = "__base__/graphics/entity/decorative/green-asterisk/green-asterisk-08.png",
width = 40
}, {
height = 26,
filename = "__base__/graphics/entity/decorative/green-asterisk/green-asterisk-09.png",
width = 33
}, {
height = 14,
filename = "__base__/graphics/entity/decorative/green-asterisk/green-asterisk-10.png",
width = 24
}, {
height = 28,
filename = "__base__/graphics/entity/decorative/green-asterisk/green-asterisk-11.png",
width = 22
}, {
height = 20,
filename = "__base__/graphics/entity/decorative/green-asterisk/green-asterisk-12.png",
width = 20
} },
autoplace = {
order = "a[doodad]-z[other]",
peaks = { {
temperature_max_range = 22.5,
water_optimal = 0.85,
influence = 0.5,
water_range = 0.15,
water_max_range = 0.25,
min_influence = 0,
temperature_range = 17.5,
temperature_optimal = 17.5
} },
max_probability = 0.05
},
icon = "__base__/graphics/icons/green-asterisk.png",
render_layer = "object"
},
["brown-coral-mini"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-f[coral]-b[mini]-b[brown]",
collision_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "brown-coral-mini",
pictures = { {
height = 40,
filename = "__base__/graphics/entity/decorative/brown-coral-mini/brown-coral-mini-01.png",
width = 39
}, {
height = 23,
filename = "__base__/graphics/entity/decorative/brown-coral-mini/brown-coral-mini-02.png",
width = 18
} },
autoplace = {
order = "a[doodad]-z[other]",
peaks = { {
noise_octaves_difference = -2,
noise_persistence = 0.9,
influence = 0.4,
noise_layer = "coral"
}, {
influence = -0.3
}, {
temperature_max_range = 15,
water_optimal = 0.15,
influence = 0.5,
water_range = 0.05,
water_max_range = 0.15,
min_influence = 0,
temperature_range = 10,
temperature_optimal = 20
} },
sharpness = 0.3,
max_probability = 0.1
},
icon = "__base__/graphics/icons/brown-coral-mini.png",
render_layer = "object"
},
["brown-hairy-grass"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-a[grass]-a[hairy]",
collision_box = { { -1, -1 }, { 1, 1 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "brown-hairy-grass",
pictures = { {
height = 31,
filename = "__base__/graphics/entity/decorative/brown-hairy-grass/brown-hairy-grass-01.png",
width = 88
}, {
height = 34,
filename = "__base__/graphics/entity/decorative/brown-hairy-grass/brown-hairy-grass-02.png",
width = 39
}, {
height = 29,
filename = "__base__/graphics/entity/decorative/brown-hairy-grass/brown-hairy-grass-03.png",
width = 53
}, {
height = 31,
filename = "__base__/graphics/entity/decorative/brown-hairy-grass/brown-hairy-grass-04.png",
width = 47
}, {
height = 38,
filename = "__base__/graphics/entity/decorative/brown-hairy-grass/brown-hairy-grass-05.png",
width = 56
}, {
height = 28,
filename = "__base__/graphics/entity/decorative/brown-hairy-grass/brown-hairy-grass-06.png",
width = 59
} },
autoplace = {
order = "a[doodad]-f[grass]-b",
peaks = { {
noise_octaves_difference = -2.8,
noise_persistence = 0.5,
influence = 0.3,
noise_layer = "grass2"
}, {
temperature_max_range = 10,
water_optimal = 0.85,
influence = 0.6,
water_range = 0.05,
water_max_range = 0.15,
min_influence = 0,
temperature_range = 5,
temperature_optimal = 25
}, {
temperature_max_range = 7.5,
water_optimal = 0.45,
influence = 0.6,
water_range = 0.05,
water_max_range = 0.15,
min_influence = 0,
temperature_range = 2.5,
temperature_optimal = 12.5
}, {
temperature_max_range = 7.5,
water_optimal = 0.15,
influence = 0.6,
water_range = 0.05,
water_max_range = 0.15,
min_influence = 0,
temperature_range = 2.5,
temperature_optimal = 17.5
} },
sharpness = 0.2,
max_probability = 0.01
},
icon = "__base__/graphics/icons/brown-hairy-grass.png",
render_layer = "decorative"
},
["small-ship-wreck-grass"] = {
type = "decorative",
subgroup = "wrecks",
order = "d[remnants]-d[ship-wreck-grass]-b[small]",
collision_box = { { -1.5, -0.5 }, { 1.5, 0.5 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -1.7, -0.6 }, { 1.7, 0.6 } },
name = "small-ship-wreck-grass",
pictures = { {
height = 45,
filename = "__base__/graphics/entity/ship-wreck/small-ship-wreck-grass-1.png",
width = 129
}, {
height = 34,
filename = "__base__/graphics/entity/ship-wreck/small-ship-wreck-grass-2.png",
width = 121
}, {
height = 37,
filename = "__base__/graphics/entity/ship-wreck/small-ship-wreck-grass-3.png",
width = 115
} },
icon = "__base__/graphics/icons/ship-wreck/small-ship-wreck-grass.png",
render_layer = "floor"
},
["green-small-grass"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-a[grass]-c[small]",
collision_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -1, -1 }, { 1, 1 } },
name = "green-small-grass",
pictures = { {
height = 42,
filename = "__base__/graphics/entity/decorative/green-small-grass/green-small-grass-01.png",
width = 91
}, {
height = 36,
filename = "__base__/graphics/entity/decorative/green-small-grass/green-small-grass-02.png",
width = 38
}, {
height = 51,
filename = "__base__/graphics/entity/decorative/green-small-grass/green-small-grass-03.png",
width = 65
}, {
height = 37,
filename = "__base__/graphics/entity/decorative/green-small-grass/green-small-grass-04.png",
width = 65
}, {
height = 31,
filename = "__base__/graphics/entity/decorative/green-small-grass/green-small-grass-05.png",
width = 46
}, {
height = 36,
filename = "__base__/graphics/entity/decorative/green-small-grass/green-small-grass-06.png",
width = 56
}, {
height = 24,
filename = "__base__/graphics/entity/decorative/green-small-grass/green-small-grass-07.png",
width = 27
}, {
height = 27,
filename = "__base__/graphics/entity/decorative/green-small-grass/green-small-grass-08.png",
width = 57
} },
icon = "__base__/graphics/icons/green-small-grass.png",
autoplace = {
order = "a[doodad]-f[grass]-d",
peaks = { {
noise_octaves_difference = -2.8,
noise_persistence = 0.5,
influence = 0.35,
noise_layer = "grass1"
}, {
temperature_max_range = 10,
water_optimal = 0.85,
influence = 0.6,
water_range = 0.05,
water_max_range = 0.15,
min_influence = 0,
temperature_range = 5,
temperature_optimal = 25
}, {
temperature_max_range = 7.5,
water_optimal = 0.45,
influence = 0.6,
water_range = 0.05,
water_max_range = 0.15,
min_influence = 0,
temperature_range = 2.5,
temperature_optimal = 12.5
}, {
temperature_max_range = 7.5,
water_optimal = 0.15,
influence = 0.6,
water_range = 0.05,
water_max_range = 0.15,
min_influence = 0,
temperature_range = 2.5,
temperature_optimal = 17.5
} },
sharpness = 0.2,
max_probability = 0.01
}
},
["small-rock"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-k[stone-rock]-b[small]",
collision_box = { { -1.1, -1.1 }, { 1.1, 1.1 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -1.3, -1.3 }, { 1.3, 1.3 } },
name = "small-rock",
pictures = { {
height = 37,
shift = { 0.21, -0.18 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-01.png",
width = 47
}, {
height = 38,
shift = { 0.25, -0.1 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-02.png",
width = 46
}, {
height = 42,
shift = { 0.28, -0.21 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-03.png",
width = 48
}, {
height = 39,
shift = { 0.28, -0.12 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-04.png",
width = 56
}, {
height = 36,
shift = { 0.34, -0.125 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-05.png",
width = 54
}, {
height = 26,
shift = { 0, 0 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-06.png",
width = 32
}, {
height = 28,
shift = { 0, 0 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-07.png",
width = 33
}, {
height = 26,
shift = { 0.15, 0 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-08.png",
width = 35
}, {
height = 23,
shift = { 0.125, 0 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-09.png",
width = 35
}, {
height = 21,
shift = { 0, 0 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-10.png",
width = 21
}, {
height = 16,
shift = { 0, 0 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-11.png",
width = 24
}, {
height = 17,
shift = { 0, 0 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-12.png",
width = 19
}, {
height = 15,
shift = { 0, 0 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-13.png",
width = 23
}, {
height = 42,
shift = { 0.28, -0.18 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-14.png",
width = 44
}, {
height = 41,
shift = { 0.31, -0.18 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-15.png",
width = 51
}, {
height = 40,
shift = { 0.25, -0.18 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-16.png",
width = 55
}, {
height = 44,
shift = { 0.37, -0.21 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-17.png",
width = 52
}, {
height = 39,
shift = { 0.46, -0.15 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-18.png",
width = 57
}, {
height = 23,
shift = { 0, 0 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-19.png",
width = 20
}, {
height = 22,
shift = { 0, -0.37 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-20.png",
width = 25
}, {
height = 16,
shift = { 0, 0.25 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-21.png",
width = 31
}, {
height = 16,
shift = { 0.25, -0.25 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-22.png",
width = 29
}, {
height = 20,
shift = { -0.1, -0.18 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-23.png",
width = 21
}, {
height = 29,
shift = { 0.25, 0 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-24.png",
width = 47
}, {
height = 33,
shift = { 0, -0.12 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-25.png",
width = 34
}, {
height = 28,
shift = { 0.06, -0.25 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-26.png",
width = 38
}, {
height = 26,
shift = { 0, 0 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-27.png",
width = 31
}, {
height = 24,
shift = { 0.18, -0.09 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-28.png",
width = 45
}, {
height = 26,
shift = { 0.21, -0.09 },
filename = "__base__/graphics/entity/decorative/small-stone-rock/small-stone-rock-29.png",
width = 48
} },
autoplace = {
order = "a[doodad]-a[rock]",
peaks = { {
influence = 0.0002
}, {
influence = 0.002,
elevation_optimal = 30000,
min_influence = 0,
elevation_range = 23000,
elevation_max_range = 30000
} }
},
icon = "__base__/graphics/icons/small-stone-rock.png",
render_layer = "decorative"
},
["brown-carpet-grass"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-a[grass]-b[carpet]",
collision_box = { { -2, -2 }, { 2, 2 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
name = "brown-carpet-grass",
pictures = { {
height = 70,
filename = "__base__/graphics/entity/decorative/brown-carpet-grass/brown-carpet-grass-01.png",
width = 103
}, {
height = 164,
filename = "__base__/graphics/entity/decorative/brown-carpet-grass/brown-carpet-grass-02.png",
width = 185
}, {
height = 176,
filename = "__base__/graphics/entity/decorative/brown-carpet-grass/brown-carpet-grass-03.png",
width = 96
}, {
height = 179,
filename = "__base__/graphics/entity/decorative/brown-carpet-grass/brown-carpet-grass-04.png",
width = 200
} },
icon = "__base__/graphics/icons/brown-carpet-grass.png",
autoplace = {
order = "a[doodad]-f[grass]-c",
peaks = { {
noise_octaves_difference = -2.8,
noise_persistence = 0.5,
influence = 0.3,
noise_layer = "grass1"
}, {
temperature_max_range = 10,
water_optimal = 0.85,
influence = 0.6,
water_range = 0.05,
water_max_range = 0.15,
min_influence = 0,
temperature_range = 5,
temperature_optimal = 25
}, {
temperature_max_range = 7.5,
water_optimal = 0.45,
influence = 0.6,
water_range = 0.05,
water_max_range = 0.15,
min_influence = 0,
temperature_range = 2.5,
temperature_optimal = 12.5
}, {
temperature_max_range = 7.5,
water_optimal = 0.15,
influence = 0.6,
water_range = 0.05,
water_max_range = 0.15,
min_influence = 0,
temperature_range = 2.5,
temperature_optimal = 17.5
} },
sharpness = 0.7,
max_probability = 0.01
}
},
["root-B"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-h[root]-b[big]",
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -0.4, -0.4 }, { 0.4, 0.4 } },
name = "root-B",
pictures = { {
height = 20,
filename = "__base__/graphics/entity/decorative/roots/root-B-01.png",
width = 38
}, {
height = 25,
filename = "__base__/graphics/entity/decorative/roots/root-B-02.png",
width = 32
}, {
height = 34,
filename = "__base__/graphics/entity/decorative/roots/root-B-03.png",
width = 36
}, {
height = 32,
filename = "__base__/graphics/entity/decorative/roots/root-B-04.png",
width = 40
}, {
height = 24,
filename = "__base__/graphics/entity/decorative/roots/root-B-05.png",
width = 29
}, {
height = 32,
filename = "__base__/graphics/entity/decorative/roots/root-B-06.png",
width = 38
}, {
height = 28,
filename = "__base__/graphics/entity/decorative/roots/root-B-07.png",
width = 19
}, {
height = 29,
filename = "__base__/graphics/entity/decorative/roots/root-B-08.png",
width = 46
}, {
height = 23,
filename = "__base__/graphics/entity/decorative/roots/root-B-09.png",
width = 34
}, {
height = 27,
filename = "__base__/graphics/entity/decorative/roots/root-B-10.png",
width = 21
}, {
height = 24,
filename = "__base__/graphics/entity/decorative/roots/root-B-11.png",
width = 29
}, {
height = 14,
filename = "__base__/graphics/entity/decorative/roots/root-B-12.png",
width = 28
}, {
height = 25,
filename = "__base__/graphics/entity/decorative/roots/root-B-13.png",
width = 34
}, {
height = 25,
filename = "__base__/graphics/entity/decorative/roots/root-B-14.png",
width = 33
}, {
height = 16,
filename = "__base__/graphics/entity/decorative/roots/root-B-15.png",
width = 21
}, {
height = 22,
filename = "__base__/graphics/entity/decorative/roots/root-B-16.png",
width = 35
}, {
height = 13,
filename = "__base__/graphics/entity/decorative/roots/root-B-17.png",
width = 35
}, {
height = 25,
filename = "__base__/graphics/entity/decorative/roots/root-B-18.png",
width = 33
} },
icon = "__base__/graphics/icons/root-b.png",
autoplace = {
order = "a[doodad]-z[other]",
influence = 0.01
}
},
["brown-fluff-dry"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-g[fluff]-b[dry]-a[brown]",
collision_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "brown-fluff-dry",
pictures = { {
height = 21,
filename = "__base__/graphics/entity/decorative/brown-fluff-dry/brown-fluff-dry-01.png",
width = 19
}, {
height = 17,
filename = "__base__/graphics/entity/decorative/brown-fluff-dry/brown-fluff-dry-02.png",
width = 31
}, {
height = 23,
filename = "__base__/graphics/entity/decorative/brown-fluff-dry/brown-fluff-dry-03.png",
width = 27
}, {
height = 23,
filename = "__base__/graphics/entity/decorative/brown-fluff-dry/brown-fluff-dry-04.png",
width = 24
}, {
height = 29,
filename = "__base__/graphics/entity/decorative/brown-fluff-dry/brown-fluff-dry-05.png",
width = 25
}, {
height = 20,
filename = "__base__/graphics/entity/decorative/brown-fluff-dry/brown-fluff-dry-06.png",
width = 25
}, {
height = 20,
filename = "__base__/graphics/entity/decorative/brown-fluff-dry/brown-fluff-dry-07.png",
width = 31
} },
icon = "__base__/graphics/icons/brown-fluff-dry.png",
autoplace = {
order = "a[doodad]-d[fluff]",
peaks = { {
noise_octaves_difference = -2,
noise_persistence = 0.9,
influence = 0.7,
noise_layer = "fluff"
}, {
influence = -0.3
}, {
temperature_max_range = 30,
water_optimal = 0.3,
influence = 0.5,
water_range = 0.2,
water_max_range = 0.3,
min_influence = 0,
temperature_range = 25,
temperature_optimal = 10
} },
sharpness = 1,
placement_density = 3
}
},
["root-A"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-h[root]-a[small]",
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -0.4, -0.4 }, { 0.4, 0.4 } },
name = "root-A",
pictures = { {
height = 10,
filename = "__base__/graphics/entity/decorative/roots/root-A-01.png",
width = 22
}, {
height = 11,
filename = "__base__/graphics/entity/decorative/roots/root-A-02.png",
width = 9
}, {
height = 10,
filename = "__base__/graphics/entity/decorative/roots/root-A-03.png",
width = 11
}, {
height = 17,
filename = "__base__/graphics/entity/decorative/roots/root-A-04.png",
width = 13
}, {
height = 11,
filename = "__base__/graphics/entity/decorative/roots/root-A-05.png",
width = 15
}, {
height = 13,
filename = "__base__/graphics/entity/decorative/roots/root-A-06.png",
width = 14
}, {
height = 13,
filename = "__base__/graphics/entity/decorative/roots/root-A-07.png",
width = 15
}, {
height = 15,
filename = "__base__/graphics/entity/decorative/roots/root-A-08.png",
width = 12
}, {
height = 16,
filename = "__base__/graphics/entity/decorative/roots/root-A-09.png",
width = 22
}, {
height = 10,
filename = "__base__/graphics/entity/decorative/roots/root-A-10.png",
width = 11
}, {
height = 18,
filename = "__base__/graphics/entity/decorative/roots/root-A-11.png",
width = 22
}, {
height = 17,
filename = "__base__/graphics/entity/decorative/roots/root-A-12.png",
width = 26
}, {
height = 13,
filename = "__base__/graphics/entity/decorative/roots/root-A-13.png",
width = 15
}, {
height = 13,
filename = "__base__/graphics/entity/decorative/roots/root-A-14.png",
width = 13
}, {
height = 17,
filename = "__base__/graphics/entity/decorative/roots/root-A-15.png",
width = 22
}, {
height = 16,
filename = "__base__/graphics/entity/decorative/roots/root-A-16.png",
width = 22
}, {
height = 15,
filename = "__base__/graphics/entity/decorative/roots/root-A-17.png",
width = 13
}, {
height = 17,
filename = "__base__/graphics/entity/decorative/roots/root-A-18.png",
width = 14
}, {
height = 10,
filename = "__base__/graphics/entity/decorative/roots/root-A-19.png",
width = 12
}, {
height = 14,
filename = "__base__/graphics/entity/decorative/roots/root-A-20.png",
width = 13
} },
icon = "__base__/graphics/icons/root-a.png",
autoplace = {
order = "a[doodad]-z[other]",
influence = 0.01
}
},
["brown-cane-cluster"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-e[cane]-a[cluster]-a[brown]",
collision_box = { { -1.5, -0.7 }, { 1.5, 0.7 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -1.3, -0.7 }, { 1.3, 0.7 } },
name = "brown-cane-cluster",
pictures = { {
height = 146,
shift = { 0.5, -0.3 },
filename = "__base__/graphics/entity/decorative/brown-cane-cluster/brown-cane-cluster-01.png",
width = 131
}, {
height = 176,
shift = { 0.6, -0.4 },
filename = "__base__/graphics/entity/decorative/brown-cane-cluster/brown-cane-cluster-02.png",
width = 154
}, {
height = 156,
shift = { 0.7, -0.2 },
filename = "__base__/graphics/entity/decorative/brown-cane-cluster/brown-cane-cluster-03.png",
width = 264
}, {
height = 138,
shift = { 0.4, -0.3 },
filename = "__base__/graphics/entity/decorative/brown-cane-cluster/brown-cane-cluster-04.png",
width = 119
}, {
height = 230,
shift = { 0.4, 0 },
filename = "__base__/graphics/entity/decorative/brown-cane-cluster/brown-cane-cluster-05.png",
width = 140
} },
autoplace = {
order = "a[doodad]-c[cane]",
peaks = { {
noise_octaves_difference = -2,
noise_persistence = 0.5,
influence = 1,
noise_layer = "brown-cane"
}, {
influence = -0.5
}, {
temperature_max_range = 17.5,
water_optimal = 0.7,
influence = 1,
water_range = 0,
water_max_range = 0.1,
min_influence = 0,
temperature_range = 12.5,
temperature_optimal = 22.5
} },
sharpness = 1,
max_probability = 0.1
},
icon = "__base__/graphics/icons/brown-cane-cluster.png",
render_layer = "object"
},
garballo = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-i[garballo]-a[normal]",
collision_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "garballo",
pictures = { {
height = 39,
filename = "__base__/graphics/entity/decorative/garballo/garballo-01.png",
width = 50
}, {
height = 40,
filename = "__base__/graphics/entity/decorative/garballo/garballo-02.png",
width = 53
}, {
height = 34,
filename = "__base__/graphics/entity/decorative/garballo/garballo-03.png",
width = 29
}, {
height = 43,
shift = { 0.2, 0 },
filename = "__base__/graphics/entity/decorative/garballo/garballo-04.png",
width = 44
}, {
height = 46,
filename = "__base__/graphics/entity/decorative/garballo/garballo-05.png",
width = 48
}, {
height = 49,
filename = "__base__/graphics/entity/decorative/garballo/garballo-06.png",
width = 59
}, {
height = 58,
shift = { 0.3, 0.2 },
filename = "__base__/graphics/entity/decorative/garballo/garballo-07.png",
width = 54
}, {
height = 36,
filename = "__base__/graphics/entity/decorative/garballo/garballo-08.png",
width = 42
}, {
height = 45,
filename = "__base__/graphics/entity/decorative/garballo/garballo-09.png",
width = 58
}, {
height = 39,
filename = "__base__/graphics/entity/decorative/garballo/garballo-10.png",
width = 58
}, {
height = 54,
shift = { 0.3, 0.2 },
filename = "__base__/graphics/entity/decorative/garballo/garballo-11.png",
width = 71
} },
autoplace = {
order = "a[doodad]-e[garballo]",
peaks = { {
noise_octaves_difference = -2,
noise_persistence = 0.8,
influence = 0.47,
noise_layer = "garballo"
}, {
influence = 0.3,
elevation_optimal = 5,
min_influence = 0,
elevation_range = 0,
elevation_max_range = 10
}, {
noise_octaves_difference = -3,
noise_persistence = 0.9,
influence = -0.01,
noise_layer = "garballo-mini"
}, {
temperature_max_range = 10,
water_optimal = 0.4,
influence = 0.4,
water_range = 0.1,
water_max_range = 0.2,
min_influence = 0,
temperature_range = 5,
temperature_optimal = 25
} },
sharpness = 1,
max_probability = 0.8
},
icon = "__base__/graphics/icons/garballo.png",
render_layer = "object"
},
["brown-fluff"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-g[fluff]-a[normal]-a[brown]",
collision_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "brown-fluff",
pictures = { {
height = 21,
filename = "__base__/graphics/entity/decorative/brown-fluff/brown-fluff-01.png",
width = 21
}, {
height = 17,
filename = "__base__/graphics/entity/decorative/brown-fluff/brown-fluff-02.png",
width = 30
}, {
height = 21,
filename = "__base__/graphics/entity/decorative/brown-fluff/brown-fluff-03.png",
width = 27
}, {
height = 19,
filename = "__base__/graphics/entity/decorative/brown-fluff/brown-fluff-04.png",
width = 23
}, {
height = 21,
filename = "__base__/graphics/entity/decorative/brown-fluff/brown-fluff-05.png",
width = 28
}, {
height = 20,
filename = "__base__/graphics/entity/decorative/brown-fluff/brown-fluff-06.png",
width = 32
}, {
height = 21,
filename = "__base__/graphics/entity/decorative/brown-fluff/brown-fluff-07.png",
width = 22
}, {
height = 32,
filename = "__base__/graphics/entity/decorative/brown-fluff/brown-fluff-08.png",
width = 27
}, {
height = 32,
filename = "__base__/graphics/entity/decorative/brown-fluff/brown-fluff-09.png",
width = 27
}, {
height = 19,
filename = "__base__/graphics/entity/decorative/brown-fluff/brown-fluff-10.png",
width = 22
} },
icon = "__base__/graphics/icons/brown-fluff.png",
autoplace = {
order = "a[doodad]-d[fluff]",
peaks = { {
noise_octaves_difference = -2,
noise_persistence = 0.9,
influence = 0.7,
noise_layer = "fluff"
}, {
influence = -0.25
}, {
temperature_max_range = 25,
water_optimal = 0.55,
influence = 0.5,
water_range = 0.15,
water_max_range = 0.25,
min_influence = 0,
temperature_range = 20,
temperature_optimal = 15
} },
sharpness = 1,
placement_density = 3
}
},
["garballo-mini-dry"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-i[garballo]-a[mini-dry]",
collision_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "garballo-mini-dry",
pictures = { {
height = 25,
filename = "__base__/graphics/entity/decorative/garballo-mini-dry/garballo-mini-dry-01.png",
width = 18
}, {
height = 25,
filename = "__base__/graphics/entity/decorative/garballo-mini-dry/garballo-mini-dry-02.png",
width = 27
}, {
height = 21,
filename = "__base__/graphics/entity/decorative/garballo-mini-dry/garballo-mini-dry-03.png",
width = 31
}, {
height = 25,
filename = "__base__/graphics/entity/decorative/garballo-mini-dry/garballo-mini-dry-04.png",
width = 31
}, {
height = 24,
filename = "__base__/graphics/entity/decorative/garballo-mini-dry/garballo-mini-dry-05.png",
width = 31
}, {
height = 27,
filename = "__base__/graphics/entity/decorative/garballo-mini-dry/garballo-mini-dry-06.png",
width = 21
}, {
height = 28,
filename = "__base__/graphics/entity/decorative/garballo-mini-dry/garballo-mini-dry-07.png",
width = 25
}, {
height = 32,
filename = "__base__/graphics/entity/decorative/garballo-mini-dry/garballo-mini-dry-08.png",
width = 26
}, {
height = 24,
filename = "__base__/graphics/entity/decorative/garballo-mini-dry/garballo-mini-dry-09.png",
width = 23
}, {
height = 26,
filename = "__base__/graphics/entity/decorative/garballo-mini-dry/garballo-mini-dry-10.png",
width = 29
}, {
height = 34,
filename = "__base__/graphics/entity/decorative/garballo-mini-dry/garballo-mini-dry-11.png",
width = 43
} },
autoplace = {
order = "a[doodad]-e[garballo]",
peaks = { {
noise_octaves_difference = -2,
noise_persistence = 0.8,
influence = 0.57,
noise_layer = "garballo"
}, {
influence = 0.3,
elevation_optimal = 10,
min_influence = 0,
elevation_range = 0,
elevation_max_range = 10
}, {
noise_octaves_difference = -3,
noise_persistence = 0.9,
influence = 0.01,
noise_layer = "garballo-mini"
}, {
temperature_max_range = 10,
water_optimal = 0.4,
influence = 0.3,
water_range = 0.1,
water_max_range = 0.2,
min_influence = 0,
temperature_range = 5,
temperature_optimal = 25
} },
sharpness = 1,
max_probability = 0.8
},
icon = "__base__/graphics/icons/garballo-mini-dry.png",
render_layer = "object"
},
["green-bush-mini"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-j[bush]-a[mini]-a[green]",
collision_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "green-bush-mini",
pictures = { {
height = 24,
filename = "__base__/graphics/entity/decorative/green-bush-mini/green-bush-mini-01.png",
width = 33
}, {
height = 21,
filename = "__base__/graphics/entity/decorative/green-bush-mini/green-bush-mini-02.png",
width = 30
}, {
height = 26,
filename = "__base__/graphics/entity/decorative/green-bush-mini/green-bush-mini-03.png",
width = 50
}, {
height = 22,
filename = "__base__/graphics/entity/decorative/green-bush-mini/green-bush-mini-04.png",
width = 31
}, {
height = 15,
filename = "__base__/graphics/entity/decorative/green-bush-mini/green-bush-mini-05.png",
width = 16
}, {
height = 15,
filename = "__base__/graphics/entity/decorative/green-bush-mini/green-bush-mini-06.png",
width = 17
}, {
height = 18,
filename = "__base__/graphics/entity/decorative/green-bush-mini/green-bush-mini-07.png",
width = 33
} },
icon = "__base__/graphics/icons/green-bush-mini.png",
autoplace = {
order = "a[doodad]-e[garballo]",
peaks = { {
noise_octaves_difference = -2,
noise_persistence = 0.8,
influence = 0.57,
noise_layer = "garballo"
}, {
influence = 0.3,
elevation_optimal = 5,
min_influence = 0,
elevation_range = 0,
elevation_max_range = 10
}, {
influence = 0.01
}, {
noise_octaves_difference = -3,
influence = 0.005,
noise_persistence = 0.9,
max_influence = 0,
noise_layer = "garballo-mini"
}, {
noise_octaves_difference = -3,
influence = -0.005,
noise_persistence = 0.9,
max_influence = 0,
noise_layer = "garballo-mini"
}, {
temperature_max_range = 10,
water_optimal = 0.4,
influence = 0.3,
water_range = 0.1,
water_max_range = 0.2,
min_influence = 0,
temperature_range = 5,
temperature_optimal = 25
} },
sharpness = 1,
max_probability = 0.8
}
},
["brown-cane-single"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-e[cane]-b[single]-a[brown]",
collision_box = { { -0.9, -0.7 }, { 0.9, 0.7 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -0.7, -0.5 }, { 0.7, 0.5 } },
name = "brown-cane-single",
pictures = { {
height = 60,
shift = { 0.6, -0.4 },
filename = "__base__/graphics/entity/decorative/brown-cane-single/brown-cane-single-01.png",
width = 56
}, {
height = 43,
shift = { 0.3, 0 },
filename = "__base__/graphics/entity/decorative/brown-cane-single/brown-cane-single-02.png",
width = 44
}, {
height = 51,
shift = { 0.3, 0 },
filename = "__base__/graphics/entity/decorative/brown-cane-single/brown-cane-single-03.png",
width = 48
}, {
height = 37,
filename = "__base__/graphics/entity/decorative/brown-cane-single/brown-cane-single-04.png",
width = 45
}, {
height = 57,
shift = { 0.9, -0.4 },
filename = "__base__/graphics/entity/decorative/brown-cane-single/brown-cane-single-05.png",
width = 81
}, {
height = 94,
shift = { 0.1, 0.4 },
filename = "__base__/graphics/entity/decorative/brown-cane-single/brown-cane-single-06.png",
width = 31
} },
icon = "__base__/graphics/icons/brown-cane-single.png",
render_layer = "object"
},
["green-pita-mini"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-d[pita-mini]-a[green]",
collision_box = { { -0.7, -0.7 }, { 0.7, 0.7 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "green-pita-mini",
pictures = { {
height = 29,
filename = "__base__/graphics/entity/decorative/green-pita-mini/green-pita-mini-01.png",
width = 32
}, {
height = 28,
filename = "__base__/graphics/entity/decorative/green-pita-mini/green-pita-mini-02.png",
width = 37
}, {
height = 28,
filename = "__base__/graphics/entity/decorative/green-pita-mini/green-pita-mini-03.png",
width = 35
}, {
height = 28,
filename = "__base__/graphics/entity/decorative/green-pita-mini/green-pita-mini-04.png",
width = 32
} },
autoplace = {
order = "a[doodad]-b[pita]",
sharpness = 0.9,
peaks = { {
influence = -0.3
}, {
noise_octaves_difference = -2,
noise_persistence = 0.5,
influence = 0.7,
noise_layer = "pita"
}, {
noise_octaves_difference = -3,
noise_persistence = 0.9,
influence = 0.01,
noise_layer = "pita-mini"
}, {
temperature_max_range = 15,
water_optimal = 0.15,
influence = 0.5,
water_range = 0.15,
water_max_range = 0.25,
min_influence = 0,
temperature_range = 10,
temperature_optimal = 10
} }
},
icon = "__base__/graphics/icons/green-pita-mini.png",
render_layer = "object"
},
["green-hairy-grass"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-a[grass]-a[hairy]",
collision_box = { { -1, -1 }, { 1, 1 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "green-hairy-grass",
pictures = { {
height = 28,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-01.png",
width = 87
}, {
height = 26,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-02.png",
width = 45
}, {
height = 38,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-03.png",
width = 43
}, {
height = 29,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-04.png",
width = 49
}, {
height = 29,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-05.png",
width = 61
}, {
height = 27,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-06.png",
width = 27
}, {
height = 34,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-07.png",
width = 33
}, {
height = 30,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-08.png",
width = 38
}, {
height = 35,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-09.png",
width = 33
}, {
height = 46,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-10.png",
width = 39
}, {
height = 47,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-11.png",
width = 93
}, {
height = 47,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-12.png",
width = 40
}, {
height = 43,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-13.png",
width = 52
}, {
height = 42,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-14.png",
width = 41
}, {
height = 36,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-15.png",
width = 39
}, {
height = 22,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-16.png",
width = 41
}, {
height = 18,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-17.png",
width = 53
}, {
height = 26,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-18.png",
width = 20
}, {
height = 25,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-19.png",
width = 29
}, {
height = 31,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-20.png",
width = 54
}, {
height = 39,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-21.png",
width = 61
}, {
height = 19,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-22.png",
width = 29
}, {
height = 23,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-23.png",
width = 34
}, {
height = 27,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-24.png",
width = 60
}, {
height = 55,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-25.png",
width = 93
}, {
height = 30,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-26.png",
width = 43
}, {
height = 43,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-27.png",
width = 103
}, {
height = 44,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-28.png",
width = 40
}, {
height = 29,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-29.png",
width = 50
}, {
height = 53,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-30.png",
width = 47
}, {
height = 44,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-31.png",
width = 60
}, {
height = 40,
filename = "__base__/graphics/entity/decorative/green-hairy-grass/green-hairy-grass-32.png",
width = 88
} },
autoplace = {
order = "a[doodad]-f[grass]-b",
peaks = { {
noise_octaves_difference = -2.8,
noise_persistence = 0.5,
influence = 0.3,
noise_layer = "grass2"
}, {
temperature_max_range = 10,
water_optimal = 0.85,
influence = 0.6,
water_range = 0.05,
water_max_range = 0.15,
min_influence = 0,
temperature_range = 5,
temperature_optimal = 25
}, {
temperature_max_range = 7.5,
water_optimal = 0.45,
influence = 0.6,
water_range = 0.05,
water_max_range = 0.15,
min_influence = 0,
temperature_range = 2.5,
temperature_optimal = 12.5
}, {
temperature_max_range = 7.5,
water_optimal = 0.15,
influence = 0.6,
water_range = 0.05,
water_max_range = 0.15,
min_influence = 0,
temperature_range = 2.5,
temperature_optimal = 17.5
} },
sharpness = 0.2,
max_probability = 0.01
},
icon = "__base__/graphics/icons/green-hairy-grass.png",
render_layer = "object"
},
["red-asterisk"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-b[asterisk]-c[red]",
collision_box = { { -0.7, -0.7 }, { 0.7, 0.7 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "red-asterisk",
pictures = { {
height = 29,
filename = "__base__/graphics/entity/decorative/red-asterisk/red-asterisk-01.png",
width = 31
}, {
height = 27,
filename = "__base__/graphics/entity/decorative/red-asterisk/red-asterisk-02.png",
width = 24
}, {
height = 24,
filename = "__base__/graphics/entity/decorative/red-asterisk/red-asterisk-03.png",
width = 28
}, {
height = 24,
filename = "__base__/graphics/entity/decorative/red-asterisk/red-asterisk-04.png",
width = 36
}, {
height = 28,
filename = "__base__/graphics/entity/decorative/red-asterisk/red-asterisk-05.png",
width = 30
}, {
height = 21,
filename = "__base__/graphics/entity/decorative/red-asterisk/red-asterisk-06.png",
width = 32
}, {
height = 26,
filename = "__base__/graphics/entity/decorative/red-asterisk/red-asterisk-07.png",
width = 29
} },
autoplace = {
order = "a[doodad]-z[other]",
peaks = { {
temperature_max_range = 25,
water_optimal = 0.55,
influence = 0.5,
water_range = 0.15,
water_max_range = 0.25,
min_influence = 0,
temperature_range = 20,
temperature_optimal = 15
} },
max_probability = 0.05
},
icon = "__base__/graphics/icons/red-asterisk.png",
render_layer = "object"
},
["orange-coral-mini"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-f[coral]-b[mini]-c[orange]",
collision_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "orange-coral-mini",
pictures = { {
height = 58,
shift = { 0, 0.3 },
filename = "__base__/graphics/entity/decorative/orange-coral-mini/orange-coral-mini-01.png",
width = 50
}, {
height = 28,
shift = { 0.1, 0 },
filename = "__base__/graphics/entity/decorative/orange-coral-mini/orange-coral-mini-02.png",
width = 21
}, {
height = 39,
shift = { 0.3, 0 },
filename = "__base__/graphics/entity/decorative/orange-coral-mini/orange-coral-mini-03.png",
width = 39
}, {
height = 50,
shift = { 0.6, 0.35 },
filename = "__base__/graphics/entity/decorative/orange-coral-mini/orange-coral-mini-04.png",
width = 47
}, {
height = 55,
shift = { 0.25, 0.2 },
filename = "__base__/graphics/entity/decorative/orange-coral-mini/orange-coral-mini-05.png",
width = 33
}, {
height = 42,
filename = "__base__/graphics/entity/decorative/orange-coral-mini/orange-coral-mini-06.png",
width = 36
} },
autoplace = {
order = "a[doodad]-z[other]",
peaks = { {
noise_octaves_difference = -2,
noise_persistence = 0.9,
influence = 0.4,
noise_layer = "coral"
}, {
influence = -0.3
}, {
temperature_max_range = 12.5,
water_optimal = 0.3,
influence = 0.5,
water_range = 0.1,
water_max_range = 0.2,
min_influence = 0,
temperature_range = 7.5,
temperature_optimal = 27.5
} },
sharpness = 0.3,
max_probability = 0.15
},
icon = "__base__/graphics/icons/orange-coral-mini.png",
render_layer = "object"
},
["brown-asterisk"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-b[asterisk]-a[brown]",
collision_box = { { -0.7, -0.7 }, { 0.7, 0.7 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "brown-asterisk",
pictures = { {
height = 26,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-01.png",
width = 30
}, {
height = 27,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-02.png",
width = 24
}, {
height = 23,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-03.png",
width = 27
}, {
height = 26,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-04.png",
width = 35
}, {
height = 25,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-05.png",
width = 30
}, {
height = 32,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-06.png",
width = 46
}, {
height = 31,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-07.png",
width = 46
}, {
height = 15,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-08.png",
width = 18
}, {
height = 14,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-09.png",
width = 21
}, {
height = 17,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-10.png",
width = 16
}, {
height = 18,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-11.png",
width = 20
}, {
height = 18,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-12.png",
width = 21
}, {
height = 19,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-13.png",
width = 22
}, {
height = 22,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-14.png",
width = 28
}, {
height = 21,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-15.png",
width = 30
}, {
height = 22,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-16.png",
width = 26
}, {
height = 15,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-17.png",
width = 22
}, {
height = 27,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-18.png",
width = 21
}, {
height = 20,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-19.png",
width = 21
}, {
height = 58,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-20.png",
width = 71
}, {
height = 59,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-21.png",
width = 78
}, {
height = 49,
filename = "__base__/graphics/entity/decorative/brown-asterisk/brown-asterisk-22.png",
width = 56
} },
autoplace = {
order = "a[doodad]-z[other]",
peaks = { {
temperature_max_range = 30,
water_optimal = 0.3,
influence = 0.5,
water_range = 0.2,
water_max_range = 0.3,
min_influence = 0,
temperature_range = 25,
temperature_optimal = 10
} },
max_probability = 0.02
},
icon = "__base__/graphics/icons/brown-asterisk.png",
render_layer = "object"
},
["green-carpet-grass"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-a[grass]-b[carpet]",
collision_box = { { -2, -2 }, { 2, 2 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
name = "green-carpet-grass",
pictures = { {
height = 73,
filename = "__base__/graphics/entity/decorative/green-carpet-grass/green-carpet-grass-01.png",
width = 105
}, {
height = 164,
filename = "__base__/graphics/entity/decorative/green-carpet-grass/green-carpet-grass-02.png",
width = 185
}, {
height = 171,
filename = "__base__/graphics/entity/decorative/green-carpet-grass/green-carpet-grass-03.png",
width = 173
}, {
height = 172,
filename = "__base__/graphics/entity/decorative/green-carpet-grass/green-carpet-grass-04.png",
width = 106
}, {
height = 186,
filename = "__base__/graphics/entity/decorative/green-carpet-grass/green-carpet-grass-05.png",
width = 204
}, {
height = 138,
filename = "__base__/graphics/entity/decorative/green-carpet-grass/green-carpet-grass-06.png",
width = 149
}, {
height = 160,
filename = "__base__/graphics/entity/decorative/green-carpet-grass/green-carpet-grass-07.png",
width = 173
} },
icon = "__base__/graphics/icons/green-carpet-grass.png",
autoplace = {
order = "a[doodad]-f[grass]-c",
peaks = { {
noise_octaves_difference = -2.8,
noise_persistence = 0.5,
influence = 0.3,
noise_layer = "grass1"
}, {
temperature_max_range = 10,
water_optimal = 0.85,
influence = 0.6,
water_range = 0.05,
water_max_range = 0.15,
min_influence = 0,
temperature_range = 5,
temperature_optimal = 25
}, {
temperature_max_range = 7.5,
water_optimal = 0.45,
influence = 0.6,
water_range = 0.05,
water_max_range = 0.15,
min_influence = 0,
temperature_range = 2.5,
temperature_optimal = 12.5
}, {
temperature_max_range = 7.5,
water_optimal = 0.15,
influence = 0.6,
water_range = 0.05,
water_max_range = 0.15,
min_influence = 0,
temperature_range = 2.5,
temperature_optimal = 17.5
} },
sharpness = 0.7,
max_probability = 0.01
}
},
["green-pita"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-c[pita]-a[green]",
collision_box = { { -0.7, -0.7 }, { 0.7, 0.7 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "green-pita",
pictures = { {
height = 49,
filename = "__base__/graphics/entity/decorative/green-pita/green-pita-01.png",
width = 60
}, {
height = 46,
filename = "__base__/graphics/entity/decorative/green-pita/green-pita-02.png",
width = 62
}, {
height = 56,
filename = "__base__/graphics/entity/decorative/green-pita/green-pita-03.png",
width = 57
}, {
height = 54,
filename = "__base__/graphics/entity/decorative/green-pita/green-pita-04.png",
width = 60
}, {
height = 49,
filename = "__base__/graphics/entity/decorative/green-pita/green-pita-05.png",
width = 60
}, {
height = 47,
filename = "__base__/graphics/entity/decorative/green-pita/green-pita-06.png",
width = 57
}, {
height = 51,
filename = "__base__/graphics/entity/decorative/green-pita/green-pita-07.png",
width = 59
}, {
height = 46,
filename = "__base__/graphics/entity/decorative/green-pita/green-pita-08.png",
width = 60
} },
autoplace = {
order = "a[doodad]-b[pita]",
sharpness = 0.9,
peaks = { {
influence = -0.3
}, {
noise_octaves_difference = -2,
noise_persistence = 0.5,
influence = 0.7,
noise_layer = "pita"
}, {
noise_octaves_difference = -3,
noise_persistence = 0.9,
influence = -0.01,
noise_layer = "pita-mini"
}, {
temperature_max_range = 15,
water_optimal = 0.2,
influence = 0.5,
water_range = 0.1,
water_max_range = 0.2,
min_influence = 0,
temperature_range = 10,
temperature_optimal = 10
} }
},
icon = "__base__/graphics/icons/green-pita.png",
render_layer = "object"
},
["green-coral-mini"] = {
type = "decorative",
subgroup = "grass",
order = "b[decorative]-f[coral]-b[mini]-a[green]",
collision_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
selectable_in_game = false,
flags = { "placeable-neutral", "placeable-off-grid", "not-on-map" },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
name = "green-coral-mini",
pictures = { {
height = 57,
shift = { 0, 0.3 },
filename = "__base__/graphics/entity/decorative/green-coral-mini/green-coral-mini-01.png",
width = 52
}, {
height = 27,
filename = "__base__/graphics/entity/decorative/green-coral-mini/green-coral-mini-02.png",
width = 20
}, {
height = 39,
shift = { 0.2, 0 },
filename = "__base__/graphics/entity/decorative/green-coral-mini/green-coral-mini-03.png",
width = 37
}, {
height = 49,
shift = { 0.4, 0.3 },
filename = "__base__/graphics/entity/decorative/green-coral-mini/green-coral-mini-04.png",
width = 46
}, {
height = 54,
shift = { 0.2, 0.2 },
filename = "__base__/graphics/entity/decorative/green-coral-mini/green-coral-mini-05.png",
width = 33
}, {
height = 41,
shift = { -0.1, 0 },
filename = "__base__/graphics/entity/decorative/green-coral-mini/green-coral-mini-06.png",
width = 34
} },
autoplace = {
order = "a[doodad]-z[other]",
peaks = { {
noise_octaves_difference = -2,
noise_persistence = 0.9,
influence = 0.4,
noise_layer = "coral"
}, {
influence = -0.3
}, {
temperature_max_range = 7.5,
water_optimal = 0.3,
influence = 0.5,
water_range = 0.1,
water_max_range = 0.2,
min_influence = 0,
temperature_range = 2.5,
temperature_optimal = 32.5
} },
sharpness = 0.3,
max_probability = 0.15
},
icon = "__base__/graphics/icons/green-coral-mini.png",
render_layer = "object"
}
},
capsule = {
["basic-electric-discharge-defense-remote"] = {
flags = { "goes-to-quickbar" },
type = "capsule",
name = "basic-electric-discharge-defense-remote",
stack_size = 1,
order = "z",
subgroup = "capsule",
icon = "__base__/graphics/equipment/basic-electric-discharge-defense-equipment-ability.png",
capsule_action = {
equipment = "basic-electric-discharge-defense-equipment",
type = "equipment-remote"
}
},
["basic-grenade"] = {
flags = { "goes-to-quickbar" },
type = "capsule",
name = "basic-grenade",
stack_size = 100,
order = "a[basic-grenade]",
subgroup = "capsule",
icon = "__base__/graphics/icons/basic-grenade.png",
capsule_action = {
attack_parameters = {
ammo_type = {
target_type = "position",
action = {
action_delivery = {
projectile = "basic-grenade",
type = "projectile",
starting_speed = 0.3
},
type = "direct"
},
category = "capsule"
},
projectile_creation_distance = 0.6,
range = 15,
cooldown = 30,
ammo_category = "capsule"
},
type = "throw"
}
},
["destroyer-capsule"] = {
flags = { "goes-to-quickbar" },
type = "capsule",
name = "destroyer-capsule",
stack_size = 100,
order = "f[destroyer-capsule]",
subgroup = "capsule",
icon = "__base__/graphics/icons/destroyer-capsule.png",
capsule_action = {
attack_parameters = {
ammo_type = {
target_type = "position",
action = {
action_delivery = {
projectile = "destroyer-capsule",
type = "projectile",
starting_speed = 0.3
},
type = "direct"
},
category = "capsule"
},
projectile_creation_distance = 0.6,
range = 25,
cooldown = 30,
ammo_category = "capsule"
},
type = "throw"
}
},
["distractor-capsule"] = {
flags = { "goes-to-quickbar" },
type = "capsule",
name = "distractor-capsule",
stack_size = 100,
order = "e[defender-capsule]",
subgroup = "capsule",
icon = "__base__/graphics/icons/distractor-capsule.png",
capsule_action = {
attack_parameters = {
ammo_type = {
target_type = "position",
action = {
action_delivery = {
projectile = "distractor-capsule",
type = "projectile",
starting_speed = 0.3
},
type = "direct"
},
category = "capsule"
},
projectile_creation_distance = 0.6,
range = 25,
cooldown = 30,
ammo_category = "capsule"
},
type = "throw"
}
},
["poison-capsule"] = {
flags = { "goes-to-quickbar" },
type = "capsule",
name = "poison-capsule",
stack_size = 100,
order = "b[poison-capsule]",
subgroup = "capsule",
icon = "__base__/graphics/icons/poison-capsule.png",
capsule_action = {
attack_parameters = {
ammo_type = {
target_type = "position",
action = {
action_delivery = {
projectile = "poison-capsule",
type = "projectile",
starting_speed = 0.3
},
type = "direct"
},
category = "capsule"
},
projectile_creation_distance = 0.6,
range = 25,
cooldown = 30,
ammo_category = "capsule"
},
type = "throw"
}
},
["slowdown-capsule"] = {
flags = { "goes-to-quickbar" },
type = "capsule",
name = "slowdown-capsule",
stack_size = 100,
order = "c[slowdown-capsule]",
subgroup = "capsule",
icon = "__base__/graphics/icons/slowdown-capsule.png",
capsule_action = {
attack_parameters = {
ammo_type = {
target_type = "position",
action = {
action_delivery = {
projectile = "slowdown-capsule",
type = "projectile",
starting_speed = 0.3
},
type = "direct"
},
category = "capsule"
},
projectile_creation_distance = 0.6,
range = 25,
cooldown = 30,
ammo_category = "capsule"
},
type = "throw"
}
},
["raw-fish"] = {
flags = { "goes-to-quickbar" },
type = "capsule",
name = "raw-fish",
stack_size = 100,
order = "f-e-a",
capsule_action = {
attack_parameters = {
ammo_type = {
target_type = "position",
action = {
action_delivery = {
target_effects = {
damage = {
amount = -20,
type = "physical"
},
type = "damage"
},
type = "instant"
},
type = "direct"
},
category = "capsule"
},
range = 0,
cooldown = 30,
ammo_category = "capsule"
},
type = "use-on-self"
},
icon = "__base__/graphics/icons/fish.png",
subgroup = "raw-resource"
},
["defender-capsule"] = {
flags = { "goes-to-quickbar" },
type = "capsule",
name = "defender-capsule",
stack_size = 100,
order = "d[defender-capsule]",
subgroup = "capsule",
icon = "__base__/graphics/icons/defender-capsule.png",
capsule_action = {
attack_parameters = {
ammo_type = {
target_type = "position",
action = {
action_delivery = {
projectile = "defender-capsule",
type = "projectile",
starting_speed = 0.3
},
type = "direct"
},
category = "capsule"
},
projectile_creation_distance = 0.6,
range = 20,
cooldown = 15,
ammo_category = "capsule"
},
type = "throw"
}
}
},
["recipe-category"] = {
["oil-processing"] = {
name = "oil-processing",
type = "recipe-category"
},
crafting = {
name = "crafting",
type = "recipe-category"
},
["crafting-with-fluid"] = {
name = "crafting-with-fluid",
type = "recipe-category"
},
["advanced-crafting"] = {
name = "advanced-crafting",
type = "recipe-category"
},
chemistry = {
name = "chemistry",
type = "recipe-category"
},
smelting = {
name = "smelting",
type = "recipe-category"
}
},
fish = {
fish = {
type = "fish",
subgroup = "creatures",
order = "b-a",
collision_box = { { -0.4, -0.2 }, { 0.4, 0.2 } },
pictures = { {
height = 36,
priority = "extra-high",
filename = "__base__/graphics/entity/fish/fish-1.png",
width = 22
}, {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/fish/fish-2.png",
width = 32
} },
minable = {
mining_time = 1,
result = "raw-fish"
},
flags = { "placeable-neutral", "not-on-map" },
selection_box = { { -0.5, -0.3 }, { 0.5, 0.3 } },
name = "fish",
max_health = 20,
icon = "__base__/graphics/icons/fish.png",
autoplace = {
influence = 0.01
}
}
},
["mining-tool"] = {
["iron-axe"] = {
durability = 4000,
type = "mining-tool",
action = {
action_delivery = {
target_effects = {
damage = {
type = "physical",
amount = 5
},
type = "damage"
},
type = "instant"
},
type = "direct"
},
order = "a[mining]-a[iron-axe]",
flags = { "goes-to-main-inventory" },
name = "iron-axe",
speed = 2.5,
stack_size = 20,
icon = "__base__/graphics/icons/iron-axe.png",
subgroup = "tool"
},
["steel-axe"] = {
durability = 5000,
type = "mining-tool",
action = {
action_delivery = {
target_effects = {
damage = {
type = "physical",
amount = 8
},
type = "damage"
},
type = "instant"
},
type = "direct"
},
order = "a[mining]-b[steel-axe]",
flags = { "goes-to-main-inventory" },
name = "steel-axe",
speed = 4,
stack_size = 20,
icon = "__base__/graphics/icons/steel-axe.png",
subgroup = "tool"
}
},
player = {
player = {
mining_speed = 0.01,
idle_with_gun_animation = {
frame_width = 48,
frame_count = 120,
stripes = { {
filename = "__base__/graphics/entity/player/character-idle-with-gun-1.png",
width_in_frames = 40
}, {
filename = "__base__/graphics/entity/player/character-idle-with-gun-2.png",
width_in_frames = 40
}, {
filename = "__base__/graphics/entity/player/character-idle-with-gun-3.png",
width_in_frames = 40
} },
shift = { 0, -0.6 },
priority = "medium",
direction_count = 5,
frame_height = 66
},
crafting_categories = { "crafting" },
maximum_corner_sliding_distance = 0.7,
order = "a",
collision_box = { { -0.2, -0.2 }, { 0.2, 0.2 } },
mining_categories = { "basic-solid" },
selection_box = { { -0.4, -1.4 }, { 0.4, 0.2 } },
running_sound_animation_positions = { 14, 29 },
running_mask_animation = {
frame_width = 48,
filename = "__base__/graphics/entity/player/character-clothes-run-mask.png",
direction_count = 5,
shift = { 0, -0.6 },
priority = "medium",
frame_count = 30,
frame_height = 66
},
eat = { {
filename = "__base__/sound/eat.ogg",
volume = 1
} },
running_animation = {
frame_width = 48,
filename = "__base__/graphics/entity/player/character-clothes-run.png",
direction_count = 5,
shift = { 0, -0.6 },
priority = "medium",
frame_count = 30,
frame_height = 66
},
icon = "__base__/graphics/icons/player.png",
light = { {
minimum_darkness = 0.3,
intensity = 0.4,
size = 25
}, {
type = "oriented",
intensity = 0.6,
picture = {
filename = "__core__/graphics/light-cone.png",
scale = 2,
priority = "medium",
height = 200,
width = 200
},
shift = { 0, -13 },
minimum_darkness = 0.3,
size = 2
} },
running_aim = {
frame_width = 58,
filename = "__base__/graphics/entity/player/character-clothes-run-aim.png",
direction_count = 18,
shift = { 0, -0.6 },
priority = "medium",
frame_count = 30,
frame_height = 72
},
type = "player",
subgroup = "creatures",
mining_with_tool_particles_animation_positions = { 28 },
mining_with_hands_particles_animation_positions = { 29, 63 },
mining_with_hands_animation = {
frame_width = 48,
frame_count = 80,
stripes = { {
filename = "__base__/graphics/entity/player/character-mine-with-hands-1.png",
width_in_frames = 40
}, {
filename = "__base__/graphics/entity/player/character-mine-with-hands-2.png",
width_in_frames = 40
} },
shift = { 0, -0.6 },
priority = "medium",
direction_count = 5,
frame_height = 66
},
mining_with_tool_animation = {
frame_width = 64,
frame_count = 48,
stripes = { {
filename = "__base__/graphics/entity/player/character-mine-with-tool-1.png",
width_in_frames = 24
}, {
filename = "__base__/graphics/entity/player/character-mine-with-tool-2.png",
width_in_frames = 24
} },
shift = { 0, -0.6 },
priority = "medium",
direction_count = 5,
frame_height = 88
},
idle_animation = {
frame_width = 48,
frame_count = 120,
stripes = { {
filename = "__base__/graphics/entity/player/character-idle-1.png",
width_in_frames = 40
}, {
filename = "__base__/graphics/entity/player/character-idle-2.png",
width_in_frames = 40
}, {
filename = "__base__/graphics/entity/player/character-idle-3.png",
width_in_frames = 40
} },
shift = { 0, -0.6 },
priority = "medium",
direction_count = 5,
frame_height = 66
},
flags = { "pushable", "placeable-player", "placeable-off-grid", "breaths-air", "not-repairable", "not-on-map" },
healing_per_tick = 0.01,
name = "player",
heartbeat = { {
filename = "__base__/sound/heartbeat.ogg"
} },
running_speed = 0.15,
max_health = 100,
distance_per_frame = 0.13,
inventory_size = 60
}
},
["rail-category"] = {
regular = {
name = "regular",
type = "rail-category"
}
},
explosion = {
["huge-explosion"] = {
flags = { "not-on-map" },
type = "explosion",
name = "huge-explosion",
created_effect = {
action_delivery = {
target_effects = { {
type = "create-particle",
speed_from_center_deviation = 0.15,
speed_from_center = 0.08,
initial_vertical_speed_deviation = 0.15,
entity_name = "explosion-remnants-particle",
offset_deviation = { { -0.2, -0.2 }, { 0.2, 0.2 } },
repeat_count = 20,
initial_vertical_speed = 0.08,
initial_height = 0.5
} },
type = "instant"
},
type = "direct"
},
animations = { {
shift = { -0.56, -0.96 },
frame_width = 112,
filename = "__base__/graphics/entity/huge-explosion/huge-explosion.png",
animation_speed = 0.5,
line_length = 6,
priority = "extra-high",
frame_count = 54,
frame_height = 94
} },
sound = { {
filename = "__base__/sound/huge-explosion.ogg",
volume = 1.25
} },
light = {
intensity = 1,
size = 50
}
},
["explosion-gunshot"] = {
flags = { "not-on-map" },
type = "explosion",
name = "explosion-gunshot",
smoke_count = 2,
animations = { {
frame_width = 30,
filename = "__base__/graphics/entity/explosion-gunshot/explosion-gunshot.png",
animation_speed = 0.5,
priority = "extra-high",
frame_count = 5,
frame_height = 30
} },
smoke = "smoke-fast",
smoke_slow_down_factor = 1,
light = {
intensity = 1,
size = 10
}
},
["railgun-beam"] = {
type = "explosion",
animation_speed = 3,
animations = { {
frame_width = 187,
filename = "__base__/graphics/entity/blue-beam/blue-beam.png",
priority = "extra-high",
frame_count = 6,
frame_height = 1
} },
smoke = "smoke-fast",
smoke_slow_down_factor = 1,
flags = { "not-on-map" },
name = "railgun-beam",
smoke_count = 2,
rotate = true,
beam = true,
light = {
intensity = 1,
size = 10
}
},
["water-splash"] = {
flags = { "not-on-map" },
type = "explosion",
name = "water-splash",
animations = { {
shift = { -0.437, 0.5 },
frame_width = 92,
filename = "__base__/graphics/entity/water-splash/water-splash.png",
animation_speed = 0.35,
line_length = 5,
priority = "extra-high",
frame_count = 15,
frame_height = 66
} }
},
explosion = {
type = "explosion",
animations = { {
frame_width = 64,
filename = "__base__/graphics/entity/explosion/explosion-1.png",
animation_speed = 0.5,
priority = "extra-high",
frame_count = 16,
frame_height = 59
}, {
frame_width = 64,
filename = "__base__/graphics/entity/explosion/explosion-2.png",
animation_speed = 0.5,
priority = "extra-high",
frame_count = 16,
frame_height = 57
}, {
frame_width = 64,
filename = "__base__/graphics/entity/explosion/explosion-3.png",
animation_speed = 0.5,
priority = "extra-high",
frame_count = 16,
frame_height = 49
}, {
frame_width = 64,
filename = "__base__/graphics/entity/explosion/explosion-4.png",
animation_speed = 0.5,
priority = "extra-high",
frame_count = 16,
frame_height = 51
} },
smoke = "smoke-fast",
smoke_slow_down_factor = 1,
flags = { "not-on-map" },
name = "explosion",
smoke_count = 2,
sound = { {
filename = "__base__/sound/explosion1.ogg",
volume = 0.8
}, {
filename = "__base__/sound/explosion2.ogg",
volume = 0.8
} },
light = {
intensity = 1,
size = 20
}
},
["laser-bubble"] = {
type = "explosion",
animation_speed = 1,
animations = { {
frame_width = 8,
filename = "__base__/graphics/entity/laser-bubble/laser-bubble.png",
priority = "extra-high",
frame_count = 5,
frame_height = 8
} },
smoke = "smoke-fast",
smoke_slow_down_factor = 1,
flags = { "not-on-map" },
name = "laser-bubble",
smoke_count = 2,
light = {
intensity = 1,
size = 10
}
}
},
["player-port"] = {
["player-port"] = {
type = "player-port",
animation = {
frame_count = 2,
frame_width = 64,
filename = "__base__/graphics/entity/player-port/player-port-animation.png",
frame_height = 64
},
collision_box = { { -0.9, -0.9 }, { 0.9, 0.9 } },
minable = {
mining_time = 1,
result = "player-port"
},
flags = { "placeable-neutral", "player-creation" },
selection_box = { { -1, -1 }, { 1, 1 } },
name = "player-port",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 48,
offset_deviation = { { -0.9, -0.9 }, { 0.9, 0.9 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
max_health = 50,
icon = "__base__/graphics/icons/player-port.png"
}
},
lab = {
lab = {
corpse = "big-remnants",
collision_box = { { -1.2, -1.2 }, { 1.2, 1.2 } },
selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
icon = "__base__/graphics/icons/lab.png",
light = {
intensity = 0.75,
size = 8
},
type = "lab",
working_sound = {
sound = {
filename = "__base__/sound/lab.ogg",
volume = 0.7
},
apparent_volume = 1.5
},
module_slots = 2,
inputs = { "science-pack-1", "science-pack-2", "science-pack-3", "alien-science-pack" },
energy_usage = "60kW",
minable = {
mining_time = 1,
result = "lab"
},
flags = { "placeable-player", "player-creation" },
energy_source = {
usage_priority = "secondary-input",
type = "electric"
},
name = "lab",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 86,
offset_deviation = { { -1.2, -1.2 }, { 1.2, 1.2 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
on_animation = {
frame_width = 113,
filename = "__base__/graphics/entity/lab/lab.png",
animation_speed = 0.33333333333333,
line_length = 11,
shift = { 0.2, 0.15 },
frame_count = 33,
frame_height = 91
},
max_health = 150,
off_animation = {
frame_width = 113,
filename = "__base__/graphics/entity/lab/lab.png",
shift = { 0.2, 0.15 },
frame_count = 1,
frame_height = 91
},
dying_explosion = "huge-explosion"
}
},
["autoplace-control"] = {
stone = {
richness = true,
type = "autoplace-control",
name = "stone",
order = "b-c"
},
["crude-oil"] = {
richness = true,
type = "autoplace-control",
name = "crude-oil",
order = "b-e"
},
["copper-ore"] = {
richness = true,
type = "autoplace-control",
name = "copper-ore",
order = "b-b"
},
["enemy-base"] = {
richness = true,
type = "autoplace-control",
name = "enemy-base",
order = "d-a"
},
["iron-ore"] = {
richness = true,
type = "autoplace-control",
name = "iron-ore",
order = "b-a"
},
coal = {
richness = true,
type = "autoplace-control",
name = "coal",
order = "b-d"
}
},
["transport-belt"] = {
["fast-transport-belt"] = {
corpse = "small-remnants",
fast_replaceable_group = "transport-belt",
animations = {
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
direction_count = 12,
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
collision_box = { { -0.4, -0.4 }, { 0.4, 0.4 } },
ending_patch = {
height = 40,
priority = "extra-high",
width = 40,
sheet = "__base__/graphics/entity/basic-transport-belt/start-end-integration-patches.png"
},
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
speed = 0.0625,
icon = "__base__/graphics/icons/fast-transport-belt.png",
belt_vertical = {
y = 40,
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
ending_bottom = {
y = 120,
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
type = "transport-belt",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 9,
offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
starting_side = {
y = 280,
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
working_sound = {
sound = {
filename = "__base__/sound/basic-transport-belt.ogg",
volume = 0.4
},
max_sounds_per_type = 3
},
starting_bottom = {
y = 240,
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
ending_side = {
y = 160,
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
minable = {
result = "fast-transport-belt",
hardness = 0.2,
mining_time = 0.3
},
flags = { "placeable-neutral", "player-creation" },
ending_top = {
y = 80,
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
name = "fast-transport-belt",
resistances = { {
percent = 50,
type = "fire"
} },
belt_horizontal = {
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
max_health = 50,
starting_top = {
y = 200,
frame_width = 40,
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
animation_speed_coefficient = 32
},
["express-transport-belt"] = {
corpse = "small-remnants",
fast_replaceable_group = "transport-belt",
animations = {
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
direction_count = 12,
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
collision_box = { { -0.4, -0.4 }, { 0.4, 0.4 } },
ending_patch = {
height = 40,
priority = "extra-high",
width = 40,
sheet = "__base__/graphics/entity/basic-transport-belt/start-end-integration-patches.png"
},
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
speed = 0.09375,
icon = "__base__/graphics/icons/express-transport-belt.png",
belt_vertical = {
y = 40,
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
ending_bottom = {
y = 120,
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
type = "transport-belt",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 9,
offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
starting_side = {
y = 280,
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
working_sound = {
sound = {
filename = "__base__/sound/express-transport-belt.ogg",
volume = 0.4
},
max_sounds_per_type = 3
},
starting_bottom = {
y = 240,
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
ending_side = {
y = 160,
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
minable = {
result = "express-transport-belt",
hardness = 0.2,
mining_time = 0.3
},
flags = { "placeable-neutral", "player-creation" },
ending_top = {
y = 80,
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
name = "express-transport-belt",
resistances = { {
percent = 50,
type = "fire"
} },
belt_horizontal = {
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
max_health = 50,
starting_top = {
y = 200,
frame_width = 40,
filename = "__base__/graphics/entity/express-transport-belt/express-transport-belt.png",
priority = "extra-high",
frame_count = 32,
frame_height = 40
},
animation_speed_coefficient = 32
},
["basic-transport-belt"] = {
corpse = "small-remnants",
fast_replaceable_group = "transport-belt",
animations = {
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
direction_count = 12,
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
collision_box = { { -0.4, -0.4 }, { 0.4, 0.4 } },
ending_patch = {
height = 40,
priority = "extra-high",
width = 40,
sheet = "__base__/graphics/entity/basic-transport-belt/start-end-integration-patches.png"
},
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
speed = 0.03125,
icon = "__base__/graphics/icons/basic-transport-belt.png",
belt_vertical = {
y = 40,
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
ending_bottom = {
y = 120,
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
type = "transport-belt",
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 9,
offset_deviation = { { -0.4, -0.4 }, { 0.4, 0.4 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
starting_side = {
y = 280,
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
working_sound = {
sound = {
filename = "__base__/sound/basic-transport-belt.ogg",
volume = 0.4
},
max_sounds_per_type = 3
},
starting_bottom = {
y = 240,
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
ending_side = {
y = 160,
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
minable = {
result = "basic-transport-belt",
hardness = 0.2,
mining_time = 0.3
},
flags = { "placeable-neutral", "player-creation" },
ending_top = {
y = 80,
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
name = "basic-transport-belt",
resistances = { {
percent = 60,
type = "fire"
} },
belt_horizontal = {
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
max_health = 50,
starting_top = {
y = 200,
frame_width = 40,
filename = "__base__/graphics/entity/basic-transport-belt/basic-transport-belt.png",
priority = "extra-high",
frame_count = 16,
frame_height = 40
},
animation_speed_coefficient = 32
}
},
fluid = {
water = {
type = "fluid",
order = "a[fluid]-a[water]",
flow_to_energy_ratio = 0.59,
flow_color = {
b = 0.7,
g = 0.7,
r = 0.7
},
pressure_to_speed_ratio = 0.4,
name = "water",
max_temperature = 100,
heat_capacity = "1KJ",
base_color = {
b = 0.6,
g = 0.34,
r = 0
},
icon = "__base__/graphics/icons/fluid/water.png",
default_temperature = 15
},
["sulfuric-acid"] = {
type = "fluid",
order = "a[fluid]-f[sulfuric-acid]",
flow_to_energy_ratio = 0.59,
flow_color = {
b = 0.5,
g = 0.5,
r = 0.5
},
pressure_to_speed_ratio = 0.4,
name = "sulfuric-acid",
heat_capacity = "1KJ",
max_temperature = 100,
base_color = {
b = 0.2,
g = 0.7,
r = 0
},
icon = "__base__/graphics/icons/fluid/sulfuric-acid.png",
default_temperature = 25
},
["crude-oil"] = {
type = "fluid",
order = "a[fluid]-b[crude-oil]",
flow_to_energy_ratio = 0.59,
flow_color = {
b = 0.5,
g = 0.5,
r = 0.5
},
pressure_to_speed_ratio = 0.4,
name = "crude-oil",
heat_capacity = "1KJ",
max_temperature = 100,
base_color = {
b = 0,
g = 0,
r = 0
},
icon = "__base__/graphics/icons/fluid/crude-oil.png",
default_temperature = 25
},
["light-oil"] = {
type = "fluid",
order = "a[fluid]-d[light-oil]",
flow_to_energy_ratio = 0.59,
flow_color = {
b = 0.9,
g = 0.9,
r = 0.9
},
pressure_to_speed_ratio = 0.4,
name = "light-oil",
heat_capacity = "1KJ",
max_temperature = 100,
base_color = {
b = 0,
g = 0.3,
r = 0.3
},
icon = "__base__/graphics/icons/fluid/light-oil.png",
default_temperature = 25
},
["heavy-oil"] = {
type = "fluid",
order = "a[fluid]-c[heavy-oil]",
flow_to_energy_ratio = 0.59,
flow_color = {
b = 0.5,
g = 0.5,
r = 0.5
},
pressure_to_speed_ratio = 0.4,
name = "heavy-oil",
heat_capacity = "1KJ",
max_temperature = 100,
base_color = {
b = 0.7,
g = 0.7,
r = 0
},
icon = "__base__/graphics/icons/fluid/heavy-oil.png",
default_temperature = 25
},
lubricant = {
type = "fluid",
order = "e[lubricant]",
flow_to_energy_ratio = 0.59,
flow_color = {
b = 0.5,
g = 0.5,
r = 0.5
},
pressure_to_speed_ratio = 0.4,
name = "lubricant",
heat_capacity = "1KJ",
max_temperature = 100,
base_color = {
b = 0.4,
g = 0.6,
r = 0.4
},
icon = "__base__/graphics/icons/fluid/lubricant.png",
default_temperature = 25
},
["petroleum-gas"] = {
type = "fluid",
order = "a[fluid]-e[petroleum-gas]",
flow_to_energy_ratio = 0.59,
flow_color = {
b = 0.5,
g = 0.5,
r = 0.5
},
pressure_to_speed_ratio = 0.4,
name = "petroleum-gas",
heat_capacity = "1KJ",
max_temperature = 100,
base_color = {
b = 0.4,
g = 0,
r = 0.4
},
icon = "__base__/graphics/icons/fluid/petroleum-gas.png",
default_temperature = 25
}
},
["smart-container"] = {
["smart-chest"] = {
corpse = "small-remnants",
connection_point = {
wire = {
green = { 0.3, -0.8 },
red = { 0.3, -0.8 }
},
shadow = {
green = { 0.7, -0.3 },
red = { 0.7, -0.3 }
}
},
fast_replaceable_group = "container",
collision_box = { { -0.35, -0.35 }, { 0.35, 0.35 } },
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
icon = "__base__/graphics/icons/smart-chest.png",
type = "smart-container",
picture = {
filename = "__base__/graphics/entity/smart-chest/smart-chest.png",
height = 41,
priority = "extra-high",
shift = { 0.4, -0.13 },
width = 62
},
minable = {
result = "smart-chest",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "player-creation" },
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 7,
offset_deviation = { { -0.35, -0.35 }, { 0.35, 0.35 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
name = "smart-chest",
resistances = { {
percent = 70,
type = "fire"
} },
inventory_size = 48,
max_health = 150,
close_sound = {
filename = "__base__/sound/metallic-chest-close.ogg",
volume = 0.7
},
open_sound = {
filename = "__base__/sound/metallic-chest-open.ogg",
volume = 0.65
}
}
},
gun = {
["submachine-gun"] = {
flags = { "goes-to-main-inventory" },
type = "gun",
name = "submachine-gun",
stack_size = 1,
order = "a[basic-clips]-b[submachine-gun]",
attack_parameters = {
shell_particle = {
starting_frame_speed_deviation = 0.1,
speed_deviation = 0.03,
name = "shell-particle",
direction_deviation = 0.1,
speed = 0.1,
starting_frame_speed = 0.4,
center = { 0, 0.6 },
creation_distance = 0.6
},
sound = { {
filename = "__base__/sound/gunshot.ogg",
volume = 0.2
} },
movement_slow_down_factor = 0.7,
projectile_creation_distance = 0.6,
range = 15,
cooldown = 4,
ammo_category = "bullet"
},
icon = "__base__/graphics/icons/submachine-gun.png",
subgroup = "gun"
},
shotgun = {
flags = { "goes-to-main-inventory" },
type = "gun",
name = "shotgun",
stack_size = 5,
order = "b[shotgun]-a[basic]",
attack_parameters = {
sound = { {
filename = "__base__/sound/pump-shotgun.ogg",
volume = 0.5
} },
range = 20,
movement_slow_down_factor = 0.6,
projectile_creation_distance = 0.6,
cooldown = 60,
explosion = "explosion-gunshot",
ammo_category = "shotgun-shell"
},
icon = "__base__/graphics/icons/shotgun.png",
subgroup = "gun"
},
["combat-shotgun"] = {
flags = { "goes-to-main-inventory" },
type = "gun",
name = "combat-shotgun",
stack_size = 5,
order = "b[shotgun]-a[combat]",
attack_parameters = {
sound = { {
filename = "__base__/sound/pump-shotgun.ogg",
volume = 0.5
} },
range = 20,
projectile_creation_distance = 0.6,
movement_slow_down_factor = 0.5,
damage_modifier = 1.2,
cooldown = 30,
explosion = "explosion-gunshot",
ammo_category = "shotgun-shell"
},
icon = "__base__/graphics/icons/combat-shotgun.png",
subgroup = "gun"
},
["flame-thrower"] = {
flags = { "goes-to-main-inventory" },
type = "gun",
name = "flame-thrower",
stack_size = 5,
order = "e[flame-thrower]",
attack_parameters = {
movement_slow_down_factor = 0.6,
projectile_creation_distance = 0.6,
range = 15,
cooldown = 2,
ammo_category = "flame-thrower"
},
icon = "__base__/graphics/icons/flame-thrower.png",
subgroup = "gun"
},
railgun = {
flags = { "goes-to-main-inventory" },
type = "gun",
name = "railgun",
stack_size = 5,
order = "c[railgun]",
attack_parameters = {
sound = { {
filename = "__base__/sound/railgun.ogg",
volume = 0.8
} },
movement_slow_down_factor = 0.6,
projectile_creation_distance = 0.6,
range = 20,
cooldown = 180,
ammo_category = "railgun"
},
icon = "__base__/graphics/icons/railgun.png",
subgroup = "gun"
},
["rocket-launcher"] = {
flags = { "goes-to-main-inventory" },
type = "gun",
name = "rocket-launcher",
stack_size = 5,
order = "d[rocket-launcher]",
attack_parameters = {
movement_slow_down_factor = 0.8,
projectile_creation_distance = 0.6,
range = 22,
cooldown = 60,
ammo_category = "rocket"
},
icon = "__base__/graphics/icons/rocket-launcher.png",
subgroup = "gun"
},
pistol = {
flags = { "goes-to-main-inventory" },
type = "gun",
name = "pistol",
stack_size = 5,
order = "a[basic-clips]-a[pistol]",
attack_parameters = {
shell_particle = {
starting_frame_speed_deviation = 0.1,
speed_deviation = 0.03,
name = "shell-particle",
direction_deviation = 0.1,
speed = 0.1,
starting_frame_speed = 0.4,
center = { 0, 0.6 },
creation_distance = 0.6
},
sound = { {
filename = "__base__/sound/gunshot.ogg",
volume = 0.3
} },
movement_slow_down_factor = 0.7,
projectile_creation_distance = 0.6,
range = 15,
cooldown = 10,
ammo_category = "bullet"
},
icon = "__base__/graphics/icons/pistol.png",
subgroup = "gun"
}
},
["battery-equipment"] = {
["battery-equipment"] = {
sprite = {
height = 64,
priority = "medium",
filename = "__base__/graphics/equipment/battery-equipment.png",
width = 32
},
type = "battery-equipment",
name = "battery-equipment",
shape = {
height = 2,
type = "full",
width = 1
},
energy_source = {
type = "electric",
output_flow_limit = "10KW",
usage_priority = "terciary",
buffer_capacity = "1KJ",
input_flow_limit = "10KW"
}
},
["battery-mk2-equipment"] = {
sprite = {
height = 64,
priority = "medium",
filename = "__base__/graphics/equipment/battery-mk2-equipment.png",
width = 32
},
type = "battery-equipment",
name = "battery-mk2-equipment",
shape = {
height = 2,
type = "full",
width = 1
},
energy_source = {
type = "electric",
output_flow_limit = "50KW",
usage_priority = "terciary",
buffer_capacity = "5KJ",
input_flow_limit = "50KW"
}
}
},
pipe = {
pipe = {
corpse = "small-remnants",
fast_replaceable_group = "pipe",
collision_box = { { -0.29, -0.29 }, { 0.29, 0.29 } },
pictures = {
straight_vertical_window = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-straight-vertical-window.png",
width = 44
},
t_down = {
height = 44,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-t-down.png",
width = 40
},
corner_up_left = {
height = 44,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-corner-up-left.png",
width = 44
},
straight_horizontal_window = {
height = 42,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-straight-horizontal-window.png",
width = 32
},
ending_left = {
height = 44,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-ending-left.png",
width = 58
},
ending_down = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-ending-down.png",
width = 44
},
horizontal_window_background = {
height = 42,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-horizontal-window-background.png",
width = 32
},
vertical_window_background = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-vertical-window-background.png",
width = 44
},
ending_up = {
height = 42,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-ending-up.png",
width = 44
},
straight_horizontal = {
height = 42,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-straight-horizontal.png",
width = 32
},
ending_right = {
height = 44,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-ending-right.png",
width = 32
},
middle_temperature_flow = {
height = 18,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/fluid-flow-medium-temperature.png",
width = 160
},
corner_down_right = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-corner-down-right.png",
width = 32
},
fluid_background = {
height = 20,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/fluid-background.png",
width = 32
},
high_temperature_flow = {
height = 18,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/fluid-flow-high-temperature.png",
width = 160
},
t_right = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-t-right.png",
width = 40
},
corner_up_right = {
height = 40,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-corner-up-right.png",
width = 32
},
cross = {
height = 40,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-cross.png",
width = 40
},
t_left = {
height = 42,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-t-left.png",
width = 44
},
straight_vertical = {
height = 42,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-straight-vertical.png",
width = 44
},
straight_vertical_single = {
height = 58,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-straight-vertical-single.png",
width = 44
},
t_up = {
height = 42,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-t-up.png",
width = 32
},
corner_down_left = {
height = 32,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/pipe-corner-down-left.png",
width = 36
},
low_temperature_flow = {
height = 18,
priority = "extra-high",
filename = "__base__/graphics/entity/pipe/fluid-flow-low-temperature.png",
width = 160
}
},
fluid_box = {
base_area = 1,
pipe_connections = { {
position = { 0, -1 }
}, {
position = { 1, 0 }
}, {
position = { 0, 1 }
}, {
position = { -1, 0 }
} }
},
selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
vertical_window_bounding_box = { { -0.28125, -0.40625 }, { 0.03125, 0.125 } },
icon = "__base__/graphics/icons/pipe.png",
type = "pipe",
horizontal_window_bounding_box = { { -0.25, -0.25 }, { 0.25, 0.15625 } },
minable = {
result = "pipe",
hardness = 0.2,
mining_time = 0.5
},
flags = { "placeable-neutral", "player-creation" },
name = "pipe",
resistances = { {
percent = 90,
type = "fire"
} },
max_health = 50,
created_effect = {
action_delivery = {
target_effects = { {
entity_name = "smoke-building",
type = "create-smoke",
speed_from_center = 0.05,
repeat_count = 5,
offset_deviation = { { -0.29, -0.29 }, { 0.29, 0.29 } },
initial_height = 0
} },
type = "instant"
},
type = "direct"
},
working_sound = {
match_volume_to_activity = true,
sound = { {
filename = "__base__/sound/pipe.ogg",
volume = 0.65
} },
max_sounds_per_type = 3
}
}
}
},
module_info = {
base = {
description = "Basic mod with all the default game data and standard campaign.",
author = "Factorio team",
contact = "dev@factorio.com",
version = "0.10.12",
homepage = "http://www.factorio.com",
dependencies = { "core" },
localPath = "/Applications/factorio.app/Contents/data/base",
name = "base",
title = "Base Mod"
},
core = {
contact = "dev@factorio.com",
version = "0.10.12",
name = "core",
homepage = "http://www.factorio.com",
dependencies = {},
author = "Factorio team",
localPath = "/Applications/factorio.app/Contents/data/core",
title = "Core Factorio data"
}
},
extend = 'function() { "<function 1>" }',
isdemo = false,
clear = 'function() { "<function 1>" }'
}
|
gpl-3.0
|
djscheuf/LearnCSharp
|
DJS/Common/DJS.Common.Examples.Tests/Homeworks/Session3/NodeTest.cs
|
1165
|
using System;
using System.Security;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace DJS.Common.Examples.Tests.Homeworks.Session3
{
[TestClass]
public class NodeTest
{
[TestMethod]
public void ConstructorParamters()
{
// Arrange
var expectedValue = 5;
// Act
var result = new DJSNode<int>(expectedValue);
// Assert
Assert.AreEqual(expectedValue,result.Value);
}
[TestMethod]
public void SetNext()
{
// Arrange
var expectedNext = new DJSNode<int>(6);
var expectedValue = 5;
var current = new DJSNode<int>(expectedValue);
// Act
current.Next = expectedNext;
// Assert
var result = current.Next;
Assert.AreEqual(6,result.Value);
}
}
public class DJSNode<T>
{
private T _value;
public DJSNode(T input)
{
_value = input;
}
public T Value { get { return _value; } }
public DJSNode<T> Next { get; set; }
}
}
|
gpl-3.0
|
oel-mediateam/uwex-media-wp-theme
|
searchform.php
|
364
|
<!-- search -->
<form class="search" method="get" action="<?php echo home_url(); ?>" role="search">
<input class="search-input" type="search" name="s" placeholder="<?php _e( 'To search, type and hit enter.', 'uwsmedia' ); ?>">
<button class="search-submit" type="submit" role="button"><?php _e( 'Search', 'uwsmedia' ); ?></button>
</form>
<!-- /search -->
|
gpl-3.0
|
calmofthestorm/suncatcher
|
include/suncatcher/PatherStateInterface.hh
|
1385
|
// This file is part of Suncatcher
// Alex Roper <alex@aroper.net>
//
// Suncatcher is free software: you can redistribute it and/or modify it under
// the terms of version 3 of the GNU General Public License as published by the
// Free Software Foundation.
//
// Suncatcher is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with
// Suncatcher. If not, see <http://www.gnu.org/licenses/>.
//
// Copyright 2014 Alex Roper
#ifndef PATHERSTATEINTERFACE_3eb633db853b48f49cbc1b3c1617acf5
#define PATHERSTATEINTERFACE_3eb633db853b48f49cbc1b3c1617acf5
namespace suncatcher {
namespace graph {
class PatherStateInterface {
public:
virtual bool get_expanded(Coord cell) const = 0;
virtual void set_expanded(Coord cell, bool value) = 0;
virtual float get_distance(Coord cell) const = 0;
virtual void set_distance(Coord cell, float value) = 0;
virtual Coord get_previous(Coord cell) const = 0;
virtual void set_previous(Coord cell, Coord value) = 0;
virtual void clear() = 0;
};
} // namespace grap
} // namespace suncatcher
#endif /* PATHERSTATEINTERFACE_3eb633db853b48f49cbc1b3c1617acf5 */
|
gpl-3.0
|
hanamvu/C4E11
|
SS1/tur_a_circle.py
|
313
|
from turtle import *
from random import *
speed(0)
colormode(255)
for side_n in range(15,2,-1):
color((randint(1, 255),randint(1, 255),randint(1, 255)),(randint(1, 255),randint(1, 255),randint(1, 255)))
begin_fill()
for i in range(side_n):
forward(100)
left(360/side_n)
end_fill()
|
gpl-3.0
|
NewmanMDB/VimConfig
|
tags/unity5/UnityEngine/FogMode.cs
|
173
|
namespace UnityEngine
{
using System;
public enum FogMode
{
Exponential = 2,
ExponentialSquared = 3,
Linear = 1
}
}
|
gpl-3.0
|
kal9mondal/Simple-Java-Game
|
src/gameObject/ObjectID.java
|
69
|
package gameObject;
public enum ObjectID {
PLAYER, ENEMY, STATIC
}
|
gpl-3.0
|
luisgustavossdd/TBD
|
framework/PodSixNet/async.py
|
659
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
""" monkey patched version of asynchat to allow map argument on all version of Python, and the best version of the poll function. """
from sys import version
import asynchat
import asyncore
if float(version[:3]) < 2.5:
from asyncore import poll2 as poll
else:
from asyncore import poll
if float(version[:3]) < 2.6:
def asynchat_monkey_init(self, conn=None, map=None):
self.ac_in_buffer = ''
self.ac_out_buffer = ''
self.producer_fifo = asynchat.fifo()
asyncore.dispatcher.__init__(self, sock=conn, map=map)
asynchat.async_chat.__init__ = asynchat_monkey_init
|
gpl-3.0
|
gohdan/DFC
|
known_files/hashes/bitrix/modules/main/install/components/bitrix/main.share/templates/flat/script.map.js
|
61
|
Bitrix 16.5 Business Demo = 7e602536e5102acd335f58a3cd44c8b0
|
gpl-3.0
|
universityofglasgow/moodle
|
enrol/gudatabase/classes/task/sync_course.php
|
1590
|
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package enrol_gudatabase
* @copyright 2019 Howard Miller
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace enrol_gudatabase\task;
defined('MOODLE_INTERNAL') || die;
class sync_course extends \core\task\adhoc_task {
public function execute() {
global $DB;
// Get enrolment plugin
$plugin = enrol_get_plugin('gudatabase');
// Get custom data (and courseid)
$data = $this->get_custom_data();
$courseid = $data->courseid;
$newcourse = $data->newcourse;
if ($course = $DB->get_record('course', ['id' => $courseid])) {
mtrace('enrol_gudatabase: processing course ' . $course->fullname);
$plugin->process_course($newcourse, $course);
} else {
mtrace('enrol_gudatabase: warning, course no longer exists id=' . $courseid);
}
}
}
|
gpl-3.0
|
andrasfuchs/BioBalanceDetector
|
Tools/KiCad_FreeRouting/FreeRouting-miho-master/freerouting-master/src/main/java/eu/mihosoft/freerouting/rules/NetClasses.java
|
5638
|
/*
* Copyright (C) 2014 Alfons Wirtz
* website www.freerouting.net
*
* Copyright (C) 2017 Michael Hoffer <info@michaelhoffer.de>
* Website www.freerouting.mihosoft.eu
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License at <http://www.gnu.org/licenses/>
* for more details.
*
* NetRules.java
*
* Created on 7. April 2005, 07:52
*/
package eu.mihosoft.freerouting.rules;
/**
* Contains the array of net classes for eu.mihosoft.freerouting.interactive routing.
*
* @author Alfons Wirtz
*/
public class NetClasses implements java.io.Serializable
{
/**
* Returns the number of classes in this array.
*/
public int count()
{
return class_arr.size();
}
/**
* Returns the net class with index p_index.
*/
public NetClass get(int p_index)
{
assert p_index >= 0 && p_index <= class_arr.size() - 1;
return class_arr.get(p_index);
}
/**
* Returns the net class with name p_name, or null, if no such class exists.
*/
public NetClass get(String p_name)
{
for (NetClass curr_class : this.class_arr)
{
if (curr_class.get_name().equals(p_name))
{
return curr_class;
}
}
return null;
}
/**
* Appends a new empty class with name p_name to the class array
*/
NetClass append(String p_name, eu.mihosoft.freerouting.board.LayerStructure p_layer_structure, ClearanceMatrix p_clearance_matrix)
{
NetClass new_class = new NetClass(p_name, p_layer_structure, p_clearance_matrix);
class_arr.add(new_class);
return new_class;
}
/**
* Appends a new empty class to the class array. A name for the class is created internally
*/
NetClass append(eu.mihosoft.freerouting.board.LayerStructure p_layer_structure, ClearanceMatrix p_clearance_matrix, java.util.Locale p_locale)
{
java.util.ResourceBundle resources =
java.util.ResourceBundle.getBundle("eu.mihosoft.freerouting.rules.Default", p_locale);
String name_front = resources.getString("class");
String new_name = null;
Integer index = 0;
for (;;)
{
++index;
new_name = name_front + index.toString();
if (this.get(new_name) == null)
{
break;
}
}
return append(new_name, p_layer_structure, p_clearance_matrix);
}
/**
* Looks, if the list contains a net class with trace half widths all equal to p_trace_half_width,
* trace clearance class equal to p_trace_clearance_class and via rule equal to p_cia_rule.
* Returns null, if no such net class was found.
*/
public NetClass find(int p_trace_half_width, int p_trace_clearance_class, ViaRule p_via_rule)
{
for (NetClass curr_class : this.class_arr)
{
if (curr_class.get_trace_clearance_class() == p_trace_clearance_class && curr_class.get_via_rule() == p_via_rule)
{
boolean trace_widths_equal = true;
for (int i = 0; i < curr_class.layer_count(); ++i)
{
if (curr_class.get_trace_half_width(i) != p_trace_half_width)
{
trace_widths_equal = false;
break;
}
}
if (trace_widths_equal)
{
return curr_class;
}
}
}
return null;
}
/**
* Looks, if the list contains a net class with trace half width[i] all equal to p_trace_half_width_arr[i]
* for 0 <= i < layer_count, trace clearance class equal to p_trace_clearance_class
* and via rule equal to p_via_rule. Returns null, if no such net class was found.
*/
public NetClass find(int[] p_trace_half_width_arr, int p_trace_clearance_class, ViaRule p_via_rule)
{
for (NetClass curr_class : this.class_arr)
{
if (curr_class.get_trace_clearance_class() == p_trace_clearance_class && curr_class.get_via_rule() == p_via_rule
&& p_trace_half_width_arr.length == curr_class.layer_count())
{
boolean trace_widths_equal = true;
for (int i = 0; i < curr_class.layer_count(); ++i)
{
if (curr_class.get_trace_half_width(i) != p_trace_half_width_arr[i])
{
trace_widths_equal = false;
break;
}
}
if (trace_widths_equal)
{
return curr_class;
}
}
}
return null;
}
/**
* Removes p_net_class from this list.
* Returns false, if p_net_class was not contained in the list.
*/
public boolean remove(NetClass p_net_class)
{
return this.class_arr.remove(p_net_class);
}
private final java.util.Vector<NetClass> class_arr = new java.util.Vector<NetClass>();
}
|
gpl-3.0
|
jonaski/strawberry
|
src/covermanager/spotifycoverprovider.cpp
|
19242
|
/*
* Strawberry Music Player
* Copyright 2020, Jonas Kvinge <jonas@jkvinge.net>
*
* Strawberry is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Strawberry is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "config.h"
#include <algorithm>
#include <QtGlobal>
#include <QObject>
#include <QList>
#include <QVariant>
#include <QByteArray>
#include <QString>
#include <QUrl>
#include <QUrlQuery>
#include <QDateTime>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QSslError>
#include <QCryptographicHash>
#include <QJsonDocument>
#include <QJsonValue>
#include <QJsonObject>
#include <QJsonArray>
#include <QDesktopServices>
#include <QMessageBox>
#include <QtDebug>
#include "core/application.h"
#include "core/network.h"
#include "core/logging.h"
#include "core/song.h"
#include "core/utilities.h"
#include "core/timeconstants.h"
#include "internet/localredirectserver.h"
#include "albumcoverfetcher.h"
#include "jsoncoverprovider.h"
#include "spotifycoverprovider.h"
const char *SpotifyCoverProvider::kSettingsGroup = "Spotify";
const char *SpotifyCoverProvider::kOAuthAuthorizeUrl = "https://accounts.spotify.com/authorize";
const char *SpotifyCoverProvider::kOAuthAccessTokenUrl = "https://accounts.spotify.com/api/token";
const char *SpotifyCoverProvider::kOAuthRedirectUrl = "http://localhost:63111/";
const char *SpotifyCoverProvider::kClientIDB64 = "ZTZjY2Y2OTQ5NzY1NGE3NThjOTAxNWViYzdiMWQzMTc=";
const char *SpotifyCoverProvider::kClientSecretB64 = "N2ZlMDMxODk1NTBlNDE3ZGI1ZWQ1MzE3ZGZlZmU2MTE=";
const char *SpotifyCoverProvider::kApiUrl = "https://api.spotify.com/v1";
const int SpotifyCoverProvider::kLimit = 10;
SpotifyCoverProvider::SpotifyCoverProvider(Application *app, QObject *parent) : JsonCoverProvider("Spotify", true, true, 2.5, true, true, app, parent), network_(new NetworkAccessManager(this)), server_(nullptr), expires_in_(0), login_time_(0) {
refresh_login_timer_.setSingleShot(true);
connect(&refresh_login_timer_, SIGNAL(timeout()), SLOT(RequestAccessToken()));
QSettings s;
s.beginGroup(kSettingsGroup);
access_token_ = s.value("access_token").toString();
refresh_token_ = s.value("refresh_token").toString();
expires_in_ = s.value("expires_in").toLongLong();
login_time_ = s.value("login_time").toLongLong();
s.endGroup();
if (!refresh_token_.isEmpty()) {
qint64 time = expires_in_ - (QDateTime::currentDateTime().toSecsSinceEpoch() - login_time_);
if (time < 6) time = 6;
refresh_login_timer_.setInterval(time * kMsecPerSec);
refresh_login_timer_.start();
}
}
SpotifyCoverProvider::~SpotifyCoverProvider() {
while (!replies_.isEmpty()) {
QNetworkReply *reply = replies_.takeFirst();
disconnect(reply, nullptr, this, nullptr);
reply->abort();
reply->deleteLater();
}
}
void SpotifyCoverProvider::Authenticate() {
QUrl redirect_url(kOAuthRedirectUrl);
if (!server_) {
server_ = new LocalRedirectServer(this);
server_->set_https(false);
int port = redirect_url.port();
int port_max = port + 10;
bool success = false;
forever {
server_->set_port(port);
if (server_->Listen()) { success = true; break; }
++port;
if (port > port_max) break;
}
if (!success) {
AuthError(server_->error());
server_->deleteLater();
server_ = nullptr;
return;
}
connect(server_, SIGNAL(Finished()), this, SLOT(RedirectArrived()));
}
code_verifier_ = Utilities::CryptographicRandomString(44);
code_challenge_ = QString(QCryptographicHash::hash(code_verifier_.toUtf8(), QCryptographicHash::Sha256).toBase64(QByteArray::Base64UrlEncoding));
if (code_challenge_.lastIndexOf(QChar('=')) == code_challenge_.length() - 1) {
code_challenge_.chop(1);
}
const ParamList params = ParamList() << Param("client_id", QByteArray::fromBase64(kClientIDB64))
<< Param("response_type", "code")
<< Param("redirect_uri", redirect_url.toString())
<< Param("state", code_challenge_);
QUrlQuery url_query;
for (const Param ¶m : params) {
url_query.addQueryItem(QUrl::toPercentEncoding(param.first), QUrl::toPercentEncoding(param.second));
}
QUrl url(kOAuthAuthorizeUrl);
url.setQuery(url_query);
const bool result = QDesktopServices::openUrl(url);
if (!result) {
QMessageBox messagebox(QMessageBox::Information, tr("Spotify Authentication"), tr("Please open this URL in your browser") + QString(":<br /><a href=\"%1\">%1</a>").arg(url.toString()), QMessageBox::Ok);
messagebox.setTextFormat(Qt::RichText);
messagebox.exec();
}
}
void SpotifyCoverProvider::Deauthenticate() {
access_token_.clear();
refresh_token_.clear();
expires_in_ = 0;
login_time_ = 0;
QSettings s;
s.beginGroup(kSettingsGroup);
s.remove("access_token");
s.remove("refresh_token");
s.remove("expires_in");
s.remove("login_time");
s.endGroup();
refresh_login_timer_.stop();
}
void SpotifyCoverProvider::RedirectArrived() {
if (!server_) return;
if (server_->error().isEmpty()) {
QUrl url = server_->request_url();
if (url.isValid()) {
QUrlQuery url_query(url);
if (url_query.hasQueryItem("error")) {
AuthError(QUrlQuery(url).queryItemValue("error"));
}
else if (url_query.hasQueryItem("code") && url_query.hasQueryItem("state")) {
qLog(Debug) << "Spotify: Authorization URL Received" << url;
QString code = url_query.queryItemValue("code");
QString state = url_query.queryItemValue("state");
QUrl redirect_url(kOAuthRedirectUrl);
redirect_url.setPort(server_->url().port());
RequestAccessToken(code, redirect_url);
}
else {
AuthError(tr("Redirect missing token code or state!"));
}
}
else {
AuthError(tr("Received invalid reply from web browser."));
}
}
else {
AuthError(server_->error());
}
server_->close();
server_->deleteLater();
server_ = nullptr;
}
void SpotifyCoverProvider::RequestAccessToken(const QString code, const QUrl redirect_url) {
refresh_login_timer_.stop();
ParamList params = ParamList() << Param("client_id", QByteArray::fromBase64(kClientIDB64))
<< Param("client_secret", QByteArray::fromBase64(kClientSecretB64));
if (!code.isEmpty() && !redirect_url.isEmpty()) {
params << Param("grant_type", "authorization_code");
params << Param("code", code);
params << Param("redirect_uri", redirect_url.toString());
}
else if (!refresh_token_.isEmpty() && is_enabled()) {
params << Param("grant_type", "refresh_token");
params << Param("refresh_token", refresh_token_);
}
else {
return;
}
QUrlQuery url_query;
for (const Param ¶m : params) {
url_query.addQueryItem(QUrl::toPercentEncoding(param.first), QUrl::toPercentEncoding(param.second));
}
QUrl new_url(kOAuthAccessTokenUrl);
QNetworkRequest req(new_url);
#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)
req.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::NoLessSafeRedirectPolicy);
#else
req.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
#endif
req.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
QString auth_header_data = QByteArray::fromBase64(kClientIDB64) + QString(":") + QByteArray::fromBase64(kClientSecretB64);
req.setRawHeader("Authorization", "Basic " + auth_header_data.toUtf8().toBase64());
QByteArray query = url_query.toString(QUrl::FullyEncoded).toUtf8();
QNetworkReply *reply = network_->post(req, query);
replies_ << reply;
connect(reply, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(HandleLoginSSLErrors(QList<QSslError>)));
connect(reply, &QNetworkReply::finished, [=] { AccessTokenRequestFinished(reply); });
}
void SpotifyCoverProvider::HandleLoginSSLErrors(QList<QSslError> ssl_errors) {
for (const QSslError &ssl_error : ssl_errors) {
login_errors_ += ssl_error.errorString();
}
}
void SpotifyCoverProvider::AccessTokenRequestFinished(QNetworkReply *reply) {
if (!replies_.contains(reply)) return;
replies_.removeAll(reply);
disconnect(reply, nullptr, this, nullptr);
reply->deleteLater();
if (reply->error() != QNetworkReply::NoError || reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() != 200) {
if (reply->error() != QNetworkReply::NoError && reply->error() < 200) {
// This is a network error, there is nothing more to do.
AuthError(QString("%1 (%2)").arg(reply->errorString()).arg(reply->error()));
return;
}
else {
// See if there is Json data containing "error" and "error_description" then use that instead.
QByteArray data = reply->readAll();
QJsonParseError json_error;
QJsonDocument json_doc = QJsonDocument::fromJson(data, &json_error);
if (json_error.error == QJsonParseError::NoError && !json_doc.isNull() && !json_doc.isEmpty() && json_doc.isObject()) {
QJsonObject json_obj = json_doc.object();
if (!json_obj.isEmpty() && json_obj.contains("error") && json_obj.contains("error_description")) {
QString error = json_obj["error"].toString();
QString error_description = json_obj["error_description"].toString();
login_errors_ << QString("Authentication failure: %1 (%2)").arg(error).arg(error_description);
}
}
if (login_errors_.isEmpty()) {
if (reply->error() != QNetworkReply::NoError) {
login_errors_ << QString("%1 (%2)").arg(reply->errorString()).arg(reply->error());
}
else {
login_errors_ << QString("Received HTTP code %1").arg(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt());
}
}
AuthError();
return;
}
}
QByteArray data = reply->readAll();
QJsonParseError json_error;
QJsonDocument json_doc = QJsonDocument::fromJson(data, &json_error);
if (json_error.error != QJsonParseError::NoError) {
Error(QString("Failed to parse Json data in authentication reply: %1").arg(json_error.errorString()));
return;
}
if (json_doc.isEmpty()) {
AuthError("Authentication reply from server has empty Json document.");
return;
}
if (!json_doc.isObject()) {
AuthError("Authentication reply from server has Json document that is not an object.", json_doc);
return;
}
QJsonObject json_obj = json_doc.object();
if (json_obj.isEmpty()) {
AuthError("Authentication reply from server has empty Json object.", json_doc);
return;
}
if (!json_obj.contains("access_token") || !json_obj.contains("expires_in")) {
AuthError("Authentication reply from server is missing access token or expires in.", json_obj);
return;
}
access_token_ = json_obj["access_token"].toString();
if (json_obj.contains("refresh_token")) {
refresh_token_ = json_obj["refresh_token"].toString();
}
expires_in_ = json_obj["expires_in"].toInt();
login_time_ = QDateTime::currentDateTime().toSecsSinceEpoch();
QSettings s;
s.beginGroup(kSettingsGroup);
s.setValue("access_token", access_token_);
s.setValue("refresh_token", refresh_token_);
s.setValue("expires_in", expires_in_);
s.setValue("login_time", login_time_);
s.endGroup();
if (expires_in_ > 0) {
refresh_login_timer_.setInterval(expires_in_ * kMsecPerSec);
refresh_login_timer_.start();
}
qLog(Debug) << "Spotify: Authentication was successful, got access token" << access_token_ << "expires in" << expires_in_;
emit AuthenticationComplete(true);
emit AuthenticationSuccess();
}
bool SpotifyCoverProvider::StartSearch(const QString &artist, const QString &album, const QString &title, const int id) {
if (access_token_.isEmpty()) return false;
if (artist.isEmpty() && album.isEmpty() && title.isEmpty()) return false;
QString type;
QString extract;
QString query = artist;
if (album.isEmpty() && !title.isEmpty()) {
type = "track";
extract = "tracks";
if (!query.isEmpty()) query.append(" ");
query.append(title);
}
else {
type = "album";
extract = "albums";
if (!album.isEmpty()) {
if (!query.isEmpty()) query.append(" ");
query.append(album);
}
}
ParamList params = ParamList() << Param("q", query)
<< Param("type", type)
<< Param("limit", QString::number(kLimit));
QUrlQuery url_query;
for (const Param ¶m : params) {
url_query.addQueryItem(QUrl::toPercentEncoding(param.first), QUrl::toPercentEncoding(param.second));
}
QUrl url(kApiUrl + QString("/search"));
url.setQuery(url_query);
QNetworkRequest req(url);
#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)
req.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::NoLessSafeRedirectPolicy);
#else
req.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
#endif
req.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
req.setRawHeader("Authorization", "Bearer " + access_token_.toUtf8());
QNetworkReply *reply = network_->get(req);
replies_ << reply;
connect(reply, &QNetworkReply::finished, [=] { HandleSearchReply(reply, id, extract); });
return true;
}
void SpotifyCoverProvider::CancelSearch(const int id) { Q_UNUSED(id); }
QByteArray SpotifyCoverProvider::GetReplyData(QNetworkReply *reply) {
QByteArray data;
if (reply->error() == QNetworkReply::NoError && reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() == 200) {
data = reply->readAll();
}
else {
if (reply->error() != QNetworkReply::NoError && reply->error() < 200) {
// This is a network error, there is nothing more to do.
Error(QString("%1 (%2)").arg(reply->errorString()).arg(reply->error()));
}
else {
data = reply->readAll();
QJsonParseError parse_error;
QJsonDocument json_doc = QJsonDocument::fromJson(data, &parse_error);
QString error;
if (parse_error.error == QJsonParseError::NoError && !json_doc.isEmpty() && json_doc.isObject()) {
QJsonObject json_obj = json_doc.object();
if (!json_obj.isEmpty() && json_obj.contains("error") && json_obj["error"].isObject()) {
QJsonObject obj_error = json_obj["error"].toObject();
if (obj_error.contains("status") && obj_error.contains("message")) {
int status = obj_error["status"].toInt();
QString message = obj_error["message"].toString();
error = QString("%1 (%2)").arg(message).arg(status);
if (status == 401) access_token_.clear();
}
}
}
if (error.isEmpty()) {
if (reply->error() != QNetworkReply::NoError) {
if (reply->error() == 204) access_token_.clear();
error = QString("%1 (%2)").arg(reply->errorString()).arg(reply->error());
}
else {
error = QString("Received HTTP code %1").arg(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt());
}
}
Error(error);
}
return QByteArray();
}
return data;
}
void SpotifyCoverProvider::HandleSearchReply(QNetworkReply *reply, const int id, const QString &extract) {
if (!replies_.contains(reply)) return;
replies_.removeAll(reply);
disconnect(reply, nullptr, this, nullptr);
reply->deleteLater();
QByteArray data = GetReplyData(reply);
if (data.isEmpty()) {
emit SearchFinished(id, CoverSearchResults());
return;
}
QJsonObject json_obj = ExtractJsonObj(data);
if (json_obj.isEmpty()) {
emit SearchFinished(id, CoverSearchResults());
return;
}
if (!json_obj.contains(extract) || !json_obj[extract].isObject()) {
Error(QString("Json object is missing %1 object.").arg(extract), json_obj);
emit SearchFinished(id, CoverSearchResults());
return;
}
json_obj = json_obj[extract].toObject();
if (!json_obj.contains("items") || !json_obj["items"].isArray()) {
Error(QString("%1 object is missing items array.").arg(extract), json_obj);
emit SearchFinished(id, CoverSearchResults());
return;
}
QJsonArray array_items = json_obj["items"].toArray();
if (array_items.isEmpty()) {
emit SearchFinished(id, CoverSearchResults());
return;
}
CoverSearchResults results;
for (const QJsonValue &value_item : array_items) {
if (!value_item.isObject()) {
continue;
}
QJsonObject obj_item = value_item.toObject();
QJsonObject obj_album = obj_item;
if (obj_item.contains("album") && obj_item["album"].isObject()) {
obj_album = obj_item["album"].toObject();
}
if (!obj_album.contains("artists") || !obj_album.contains("name") || !obj_album.contains("images") || !obj_album["artists"].isArray() || !obj_album["images"].isArray()) {
continue;
}
QJsonArray array_artists = obj_album["artists"].toArray();
QJsonArray array_images = obj_album["images"].toArray();
QString album = obj_album["name"].toString();
QStringList artists;
for (const QJsonValue &value_artist : array_artists) {
if (!value_artist.isObject()) continue;
QJsonObject obj_artist = value_artist.toObject();
if (!obj_artist.contains("name")) continue;
artists << obj_artist["name"].toString();
}
for (const QJsonValue &value_image : array_images) {
if (!value_image.isObject()) continue;
QJsonObject obj_image = value_image.toObject();
if (!obj_image.contains("url") || !obj_image.contains("width") || !obj_image.contains("height")) continue;
int width = obj_image["width"].toInt();
int height = obj_image["height"].toInt();
if (width < 300 || height < 300) continue;
QUrl url(obj_image["url"].toString());
CoverSearchResult result;
result.album = album;
result.image_url = url;
result.image_size = QSize(width, height);
if (!artists.isEmpty()) result.artist = artists.first();
results << result;
}
}
emit SearchFinished(id, results);
}
void SpotifyCoverProvider::AuthError(const QString &error, const QVariant &debug) {
if (!error.isEmpty()) login_errors_ << error;
for (const QString &e : login_errors_) Error(e);
if (debug.isValid()) qLog(Debug) << debug;
emit AuthenticationFailure(login_errors_);
emit AuthenticationComplete(false, login_errors_);
login_errors_.clear();
}
void SpotifyCoverProvider::Error(const QString &error, const QVariant &debug) {
qLog(Error) << "Spotify:" << error;
if (debug.isValid()) qLog(Debug) << debug;
}
|
gpl-3.0
|
MrHaribo/MicroNet
|
MicroNet.Model/src/main/java/micronet/annotation/ResponseParameters.java
|
336
|
package micronet.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.METHOD)
public @interface ResponseParameters {
MessageParameter[] value() default {};
}
|
gpl-3.0
|
ClaroBot/Distribution
|
plugin/external-user-group-synchronization/Resources/modules/synchronization/user/user-sync-modal.controller.js
|
464
|
/**
* Created by panos on 6/7/17.
*/
export class UserSyncModalController {
constructor($uibModalInstance, roles) {
this.roles = roles
this._$uibModalInstance = $uibModalInstance
this.cas = 'true'
this.role = this.roles[0]
}
ok() {
this._$uibModalInstance.close({'role':this.role, 'cas':this.cas})
}
cancel() {
this._$uibModalInstance.dismiss('cancel')
}
}
UserSyncModalController.$inject = [ '$uibModalInstance', 'roles' ]
|
gpl-3.0
|
gpospelov/BornAgain
|
GUI/coregui/Views/SampleDesigner/InterferenceFunctionViews.cpp
|
3060
|
// ************************************************************************************************
//
// BornAgain: simulate and fit reflection and scattering
//
//! @file GUI/coregui/Views/SampleDesigner/InterferenceFunctionViews.cpp
//! @brief Implements classes InterferenceFunctionViews
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
// ************************************************************************************************
#include "GUI/coregui/Views/SampleDesigner/InterferenceFunctionViews.h"
#include "GUI/coregui/Views/SampleDesigner/DesignerHelper.h"
InterferenceFunction1DLatticeView::InterferenceFunction1DLatticeView(QGraphicsItem* parent)
: ConnectableView(parent)
{
setName("Interference1DLattice");
setColor(QColor(255, 236, 139));
setRectangle(DesignerHelper::getInterferenceFunctionBoundingRect());
addPort("out", NodeEditorPort::OUTPUT, NodeEditorPort::INTERFERENCE);
m_roundpar = 3;
}
InterferenceFunction2DLatticeView::InterferenceFunction2DLatticeView(QGraphicsItem* parent)
: ConnectableView(parent)
{
setName("Interference2DLattice");
setColor(QColor(255, 236, 139));
setRectangle(DesignerHelper::getInterferenceFunctionBoundingRect());
addPort("out", NodeEditorPort::OUTPUT, NodeEditorPort::INTERFERENCE);
m_roundpar = 3;
}
InterferenceFunction2DParaCrystalView::InterferenceFunction2DParaCrystalView(QGraphicsItem* parent)
: ConnectableView(parent)
{
setName("Interference2DParaCrystal");
setColor(QColor(255, 236, 139));
setRectangle(DesignerHelper::getInterferenceFunctionBoundingRect());
addPort("out", NodeEditorPort::OUTPUT, NodeEditorPort::INTERFERENCE);
m_roundpar = 3;
}
InterferenceFunctionFinite2DLatticeView::InterferenceFunctionFinite2DLatticeView(
QGraphicsItem* parent)
: ConnectableView(parent)
{
setName("InterferenceFinite2DLattice");
setColor(QColor(255, 236, 139));
setRectangle(DesignerHelper::getInterferenceFunctionBoundingRect());
addPort("out", NodeEditorPort::OUTPUT, NodeEditorPort::INTERFERENCE);
m_roundpar = 3;
}
InterferenceFunctionHardDiskView::InterferenceFunctionHardDiskView(QGraphicsItem* parent)
: ConnectableView(parent)
{
setName("InterferenceHardDisk");
setColor(QColor(255, 236, 139));
setRectangle(DesignerHelper::getInterferenceFunctionBoundingRect());
addPort("out", NodeEditorPort::OUTPUT, NodeEditorPort::INTERFERENCE);
m_roundpar = 3;
}
InterferenceFunctionRadialParaCrystalView::InterferenceFunctionRadialParaCrystalView(
QGraphicsItem* parent)
: ConnectableView(parent)
{
setName("InterferenceRadialParaCrystal");
setColor(QColor(255, 236, 139));
setRectangle(DesignerHelper::getInterferenceFunctionBoundingRect());
addPort("out", NodeEditorPort::OUTPUT, NodeEditorPort::INTERFERENCE);
m_roundpar = 3;
}
|
gpl-3.0
|
Tinchosan/wingpanel
|
admin/modulos/listas_precios/lista_precio_nuevo_accion.php
|
2397
|
<?php
require_once '../../sistema/sesiones.php';
iniciar_sesion();
require_once '../../sistema/genericas.php';
require_once '../../sistema/mysqli_db.php';
$bd = new mysqli_db();
$bd->conectar();
if (esta_registrada_sesion("admin-id-wingpanel")) {
$origen = $_GET['origen'];
//TOMAMOS LOS VALORES DEL POST
$msj_aviso = "";
$arr_datos = validar_formulario("post", "titulo-string-Titulo,"
."ganancia-string-Ganancia");
$foco = $arr_datos['foco'];
$hay_error = false;
if ($arr_datos['error'] != false) {
//VEMOS SI EXISTE EL RUBRO
$sqlExiste = "SELECT * FROM lista_precios WHERE titulo = '$arr_datos[titulo]' AND ganancia = '$arr_datos[ganancia]'";
$existemoneda = $bd->existe($sqlExiste);
if ($existemoneda) {
$hay_error = true;
$msj_aviso = "La lista de precios ya ha sido cargada al sistema, intente con otro.";
}
} else {
$hay_error = true;
$msj_aviso = "No se completo correctamente el campo $foco";
}
if ($hay_error) {
$arr_json = array(
"correcto" => false,
"mensaje" => "<div class='alert alert-danger'>$msj_aviso</div>",
"foco" => "$foco"
);
} else {
//GUARDAMOS EN LA BASE DE DATOS
$valor_formato = str_replace(',', '.', $arr_datos['ganancia']);
$valor_float = floatval($valor_formato);
$sqlmoneda = "INSERT INTO lista_precios (titulo, ganancia)
VALUES ('$arr_datos[titulo]',$valor_float)";
$bd->ejecutar($sqlmoneda);
$idlista = $bd->id();
//REALIZAMOS EL LOG DE LA ACCION
require_once '../../sistema/log.php';
$accion = tomar_valor_sesion("admin-nombre-wingpanel") . " registro la lista de precio $arr_datos[titulo]";
logbd($accion, tomar_valor_sesion("admin-id-wingpanel"));
$arr_json = array(
"correcto" => true,
"mensaje" => "",
"redireccion" => "abm_lista_precio.php?resaltar=$idlista&permiso=$origen#ancla_$idlista"
);
}
} else {
$arr_json = array(
"correcto" => false,
"mensaje" => "<div class='alert alert-danger'>Sesion Caducada, reingrese al sistema.</div>",
"redireccion" => "./index.php"
);
}
echo json_encode($arr_json);
?>
|
gpl-3.0
|
jamesbrunet/mandroid
|
src/Assets/Scripts/PlayerController.cs
|
3282
|
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
// Our playercontroller is responsible for:
// -Keeping track of its speed
// -Picking up other game objects
// -Keeping track of the score
// The speed tracking, pickups, and score is from
// -Checking win/loss states.
public class PlayerController : MonoBehaviour {
public float speed;
public Text countText;
public Text winText;
public bool win = false;
public bool alive = true;
public GameObject explosionParticles;
public int score;
//Fuel
public float fuel;
public Slider fuelSlider;
private Rigidbody rb;
//Getters
public float getSpeed()
{
return speed;
}
public bool getWin()
{
return win;
}
public bool getAlive()
{
return alive;
}
public int getScore()
{
return score;
}
public float getFuel()
{
return fuel;
}
//Setters
public void setSpeed(float newSpeed)
{
newSpeed = speed;
}
public void setWin(bool newWin)
{
newWin = win;
}
public void setAlive(bool newAlive)
{
newAlive = alive;
}
public void setScore(int newScore)
{
newScore = score;
}
public void setFuel(float newFuel)
{
newFuel = fuel;
}
void Start () {
if (Application.loadedLevel == 1) {
PlayerPrefs.SetInt ("score", 0);
}
if (Application.loadedLevel == 3)
{
win = false;
print("Score loading!");
score = PlayerPrefs.GetInt("score");
}
else if (Application.loadedLevel == 5)
{
win = false;
print("Score loading!");
score = PlayerPrefs.GetInt("score");
}
else
{
score = 0;
}
this.gameObject.SetActive(true);
Screen.sleepTimeout = SleepTimeout.NeverSleep;
fuel = 2000;
rb = GetComponent<Rigidbody>();
SetCountText ();
winText.text = "";
}
void FixedUpdate () {
fuelSlider.value = fuel;
}
public void isDestroyed()
{
//this.GetComponent<ParticleSystem>().Play();
alive = false;
this.gameObject.SetActive(false);
//winText.text = "You died!";
}
void OnTriggerEnter(Collider other) {
if (other.gameObject.CompareTag ("Pickup")) {
score += 1;
SetCountText ();
PlayerPrefs.SetInt("score", score);
}
if (other.gameObject.CompareTag("LevelBounds")){
isDestroyed();
}
if (other.gameObject.CompareTag("Exit"))
{
win = true;
}
if (other.gameObject.CompareTag("Asteroid"))
{
isDestroyed();
}
}
void SetCountText(){
countText.text = "Count: " + score.ToString ();
//Win first level with max score
if (score >= 12 && Application.loadedLevel == 1) {
win = true;
}
//Win second level with max score
if (score >= 24 && Application.loadedLevel == 3)
{
win = true;
}
if (score >= 36 && Application.loadedLevel == 5)
{
win = true;
}
}
public void spendFuel()
{
fuel -= 1;
}
}
|
gpl-3.0
|
kindahl/ckcore
|
include/ckcore/unix/directory.hh
|
7157
|
/*
* The ckCore library provides core software functionality.
* Copyright (C) 2006-2012 Christian Kindahl
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file include/ckcore/unix/directory.hh
* @brief Defines the Unix directory class.
*/
#pragma once
#include <map>
#include <dirent.h>
#include "ckcore/file.hh"
#include "ckcore/path.hh"
namespace ckcore
{
/**
* @brief The class for dealing with directories on Unix.
*/
class Directory
{
public:
/**
* @brief Class for iterating directory contents.
*
* Please note that each iterator (except for end iterators) allocates
* an instance to the directory which will not be released until the
* Directory (not Iterator) object is destroyed. In other words, a good
* way of abusing this library is to create lots of iteators while
* keeping the directory object alive.
*/
class Iterator
{
private:
DIR *dir_handle_;
struct dirent *cur_ent_;
void next();
public:
/**
* Constructs an Iterator object.
*/
Iterator();
/**
* Constructs an Iterator object.
* @param [in] dir A reference to the Directory object to iterate over.
*/
Iterator(const Directory &dir);
/**
* Returns the name of the file or directory that the iterator currently
* points at.
* @return The name of the file or directory that the iterator points at.
*/
tstring operator*() const;
/**
* Moves the iterator to the next file or directory residing in the
* directory.
* @return An Iterator object pointing at the next file or directory.
*/
Iterator &operator++();
/**
* Moves the iterator to the next file or directory residing in the
* directory.
* @return An Iterator object pointing at the next file or directory.
*/
Iterator &operator++(int);
/**
* Tests the equivalence of this and another iterator.
* @param [in] it The iterator to use for comparison.
* @return If the iterators are equal true is returned, otherwise false.
*/
bool operator==(const Iterator &it) const;
/**
* Tests the non-equivalence of this and another iterator.
* @param [in] it The iterator to use for comparison.
* @return If the iterators are equal true is returned, otherwise false.
*/
bool operator!=(const Iterator &it) const;
};
private:
Path dir_path_;
std::map<Iterator *,DIR *> dir_handles_;
public:
/**
* Constructs a Directory object.
* @param [in] dir_path The path to the directory.
*/
Directory(const Path &dir_path);
/**
* Destructs the Directory object.
*/
~Directory();
/**
* Returns the full directory path name.
* @return The full directory path name.
*/
const tstring &name() const;
/**
* Creates an iterator pointing to the first file or directory in the
* current directory.
* @return An Iteator object pointing to the first file or directory.
*/
Iterator begin() const;
/**
* Creats an iterator poiting beyond the last file or directory in the
* directory in the current directory.
* @return An Iteator object pointing beyond the last file or directory.
*/
Iterator end() const;
/**
* Creates the directory unless it already exist.
* @return If successfull true is returned, otherwise false.
*/
bool create() const;
/**
* Removes the directory if it exist.
* @return If successfull true is returned, otherwise false.
*/
bool remove() const;
/**
* Tests if the current directory exist.
* @return If the directory exist true is returned, otherwise false.
*/
bool exist() const;
/**
* Obtains time stamps on when the current directory was last accessed,
* last modified and created.
* @param [out] access_time Time of last access.
* @param [out] modify_time Time of last modification.
* @param [out] create_time Time of creation (last status change on Linux).
* @return If successfull true is returned, otherwise false.
*/
bool time(struct tm &access_time,struct tm &modify_time,
struct tm &create_time) const;
/**
* Creates the specified directory unless it already exist.
* @return If successfull true is returned, otherwise false.
*/
static bool create(const Path &dir_path);
/**
* Removes the specified directory if it exist.
* @return If successfull true is returned, otherwise false.
*/
static bool remove(const Path &dir_path);
/**
* Tests if the specified directory exist.
* @return If the directory exist true is returned, otherwise false.
*/
static bool exist(const Path &dir_path);
/**
* Obtains time stamps on when the specified directory was last accessed,
* last modified and created.
* @param [in] dir_path The path to the directory.
* @param [out] access_time Time of last access.
* @param [out] modify_time Time of last modification.
* @param [out] create_time Time of creation (last status change on Linux).
* @return If successfull true is returned, otherwise false.
*/
static bool time(const Path &dir_path,struct tm &access_time,
struct tm &modify_time,struct tm &create_time);
/**
* Creates a Directory object describing a temporary directory on the hard
* drive. The directory path is pointing to an unique directory name in the
* default temporary directory of the current system. The directory is not
* automatically created.
* @return Directory object to a temporary directory.
*/
static Directory temp();
};
}
|
gpl-3.0
|
anupkdas-nus/global_synapses
|
pyNN-dispackgaes/common/__init__.py
|
1412
|
# encoding: utf-8
"""
Defines a backend-independent, partial implementation of the PyNN API
Backend simulator modules are not required to use any of the code herein,
provided they provide the correct interface, but it is suggested that they use
as much as is consistent with good performance (optimisations may require
overriding some of the default definitions given here).
Utility functions and classes:
is_conductance()
check_weight()
Base classes to be sub-classed by individual backends:
IDMixin
Population
PopulationView
Assembly
Projection
Function-factories to generate backend-specific API functions:
build_reset()
build_state_queries()
build_create()
build_connect()
build_record()
Common implementation of API functions:
set()
initialize()
Function skeletons to be extended by backends:
setup()
end()
run()
Global constants:
DEFAULT_MAX_DELAY
DEFAULT_TIMESTEP
DEFAULT_MIN_DELAY
:copyright: Copyright 2006-2016 by the PyNN team, see AUTHORS.
:license: CeCILL, see LICENSE for details.
"""
from .populations import IDMixin, BasePopulation, Population, PopulationView, Assembly, is_conductance
from .projections import Projection, Connection
from .procedural_api import build_create, build_connect, set, build_record, initialize
from .control import setup, end, build_run, build_reset, build_state_queries
|
gpl-3.0
|
mars-sim/mars-sim
|
mars-sim-ui/src/main/java/org/mars_sim/msp/ui/swing/tool/monitor/VehicleTableModel.java
|
24999
|
/*
* Mars Simulation Project
* VehicleTableModel.java
* @date 2021-10-23
* @author Barry Evans
*/
package org.mars_sim.msp.ui.swing.tool.monitor;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.SwingUtilities;
import org.mars_sim.msp.core.Coordinates;
import org.mars_sim.msp.core.GameManager;
import org.mars_sim.msp.core.GameManager.GameMode;
import org.mars_sim.msp.core.Msg;
import org.mars_sim.msp.core.Simulation;
import org.mars_sim.msp.core.Unit;
import org.mars_sim.msp.core.UnitEvent;
import org.mars_sim.msp.core.UnitEventType;
import org.mars_sim.msp.core.UnitManager;
import org.mars_sim.msp.core.UnitManagerEvent;
import org.mars_sim.msp.core.UnitManagerEventType;
import org.mars_sim.msp.core.UnitManagerListener;
import org.mars_sim.msp.core.UnitType;
import org.mars_sim.msp.core.malfunction.Malfunction;
import org.mars_sim.msp.core.person.ai.mission.Mission;
import org.mars_sim.msp.core.person.ai.mission.MissionEvent;
import org.mars_sim.msp.core.person.ai.mission.MissionEventType;
import org.mars_sim.msp.core.person.ai.mission.MissionListener;
import org.mars_sim.msp.core.person.ai.mission.MissionManager;
import org.mars_sim.msp.core.person.ai.mission.MissionManagerListener;
import org.mars_sim.msp.core.person.ai.mission.NavPoint;
import org.mars_sim.msp.core.person.ai.mission.TravelMission;
import org.mars_sim.msp.core.person.ai.mission.VehicleMission;
import org.mars_sim.msp.core.resource.AmountResource;
import org.mars_sim.msp.core.resource.ResourceUtil;
import org.mars_sim.msp.core.structure.Settlement;
import org.mars_sim.msp.core.structure.building.function.cooking.PreparingDessert;
import org.mars_sim.msp.core.vehicle.Crewable;
import org.mars_sim.msp.core.vehicle.Vehicle;
import org.mars_sim.msp.ui.swing.tool.Conversion;
/**
* The VehicleTableModel that maintains a list of Vehicle objects.
* It maps key attributes of the Vehicle into Columns.
*/
@SuppressWarnings("serial")
public class VehicleTableModel extends UnitTableModel {
//private DecimalFormat decFormatter = new DecimalFormat("#,###,###.#");
private static final Logger logger = Logger.getLogger(VehicleTableModel.class.getName());
private final static String AT = "At ";
private static String ON = "On";
private static String OFF = "Off";
private static String TRUE = "True";
private static String FALSE = "False";
// Column indexes
private final static int NAME = 0;
private final static int TYPE = 1;
private final static int HOME = 2;
private final static int LOCATION = 3;
private final static int DESTINATION = 4;
private final static int DESTDIST = 5;
private final static int MISSION = 6;
private final static int CREW = 7;
// private final static int BOTS = 8;
private final static int DRIVER = 8;
private final static int STATUS = 9;
private final static int BEACON = 10;
private final static int RESERVED = 11;
private final static int SPEED = 12;
private final static int MALFUNCTION = 13;
private final static int OXYGEN = 14;
private final static int METHANE = 15;
private final static int WATER = 16;
private final static int FOOD = 17;
private final static int DESSERT = 18;
private final static int ROCK_SAMPLES = 19;
private final static int ICE = 20;
/** The number of Columns. */
private final static int COLUMNCOUNT = 21;
/** Names of Columns. */
private static String columnNames[];
/** Names of Columns. */
private static Class<?> columnTypes[];
/**
* Class initialiser creates the static names and classes.
*/
static {
columnNames = new String[COLUMNCOUNT];
columnTypes = new Class[COLUMNCOUNT];
columnNames[NAME] = "Name";
columnTypes[NAME] = String.class;
columnNames[TYPE] = "Type";
columnTypes[TYPE] = String.class;
columnNames[HOME] = "Home";
columnTypes[HOME] = String.class;
columnNames[LOCATION] = "Location";
columnTypes[LOCATION] = String.class;
columnNames[DESTINATION] = "Next Waypoint";
columnTypes[DESTINATION] = Coordinates.class;
columnNames[DESTDIST] = "Dist. to next [km]";
columnTypes[DESTDIST] = Integer.class;
columnNames[MISSION] = "Mission";
columnTypes[MISSION] = String.class;
columnNames[CREW] = "Crew";
columnTypes[CREW] = Integer.class;
// columnNames[BOTS] = "Bots";
// columnTypes[BOTS] = Integer.class;
columnNames[DRIVER] = "Driver";
columnTypes[DRIVER] = String.class;
columnNames[STATUS] = "Status";
columnTypes[STATUS] = String.class;
columnNames[BEACON] = "Beacon";
columnTypes[BEACON] = String.class;
columnNames[RESERVED] = "Reserved";
columnTypes[RESERVED] = String.class;
columnNames[SPEED] = "Speed";
columnTypes[SPEED] = Integer.class;
columnNames[MALFUNCTION] = "Malfunction";
columnTypes[MALFUNCTION] = String.class;
columnNames[OXYGEN] = "Oxygen";
columnTypes[OXYGEN] = Integer.class;
columnNames[METHANE] = "Methane";
columnTypes[METHANE] = Integer.class;
columnNames[WATER] = "Water";
columnTypes[WATER] = Integer.class;
columnNames[FOOD] = "Food";
columnTypes[FOOD] = Integer.class;
columnNames[DESSERT] = "Dessert";
columnTypes[DESSERT] = Integer.class;
columnNames[ROCK_SAMPLES] = "Rock Samples";
columnTypes[ROCK_SAMPLES] = Integer.class;
columnNames[ICE] = "Ice";
columnTypes[ICE] = Integer.class;
}
private final static int foodID = ResourceUtil.foodID;
private final static int oxygenID = ResourceUtil.oxygenID;
private final static int waterID = ResourceUtil.waterID;
private final static int methaneID = ResourceUtil.methaneID;
private final static int rockSamplesID = ResourceUtil.rockSamplesID;
private final static int iceID = ResourceUtil.iceID;
private final static AmountResource [] availableDesserts = PreparingDessert.getArrayOfDessertsAR();
private static UnitManager unitManager = Simulation.instance().getUnitManager();
private static MissionManager missionManager = Simulation.instance().getMissionManager();
// Data members
private int mapSizeCache = 0;
private UnitManagerListener unitManagerListener;
private LocalMissionManagerListener missionManagerListener;
private Map<Vehicle, Map<Integer, Double>> resourceCache;
private GameMode mode;
private Settlement commanderSettlement;
private Settlement settlement;
/**
* Constructs a VehicleTableModel object. It creates the list of possible
* Vehicles from the Unit manager.
*
* @param unitManager Proxy manager contains displayable Vehicles.
*/
public VehicleTableModel() throws Exception {
super(
Msg.getString("VehicleTableModel.tabName"),
"VehicleTableModel.countingVehicles", //$NON-NLS-1$
columnNames,
columnTypes
);
if (GameManager.getGameMode() == GameMode.COMMAND) {
mode = GameMode.COMMAND;
commanderSettlement = unitManager.getCommanderSettlement();
setSource(commanderSettlement.getAllAssociatedVehicles());
}
else
setSource(unitManager.getVehicles());
init();
}
public VehicleTableModel(Settlement settlement) throws Exception {
super(
Msg.getString("VehicleTableModel.tabName"),
"VehicleTableModel.countingVehicles", //$NON-NLS-1$
columnNames,
columnTypes
);
this.settlement = settlement;
setSource(settlement.getAllAssociatedVehicles());
init();
}
public void init() {
unitManagerListener = new LocalUnitManagerListener();
unitManager.addUnitManagerListener(unitManagerListener);
missionManagerListener = new LocalMissionManagerListener();
}
/**
* Return the value of a Cell
* @param rowIndex Row index of the cell.
* @param columnIndex Column index of the cell.
*/
public Object getValueAt(int rowIndex, int columnIndex) {
Object result = null;
if (rowIndex < getUnitNumber()) {
Vehicle vehicle = (Vehicle)getUnit(rowIndex);
Map<Integer, Double> resourceMap = resourceCache.get(vehicle);
try {
// Invoke the appropriate method, switch is the best solution
// although disliked by some
switch (columnIndex) {
case NAME : {
result = vehicle.getName();
} break;
case TYPE : {
result = Conversion.capitalize(vehicle.getDescription());
} break;
case HOME : {
Settlement as = vehicle.getAssociatedSettlement();
if (as != null) {
result = as.getName();
}
else {
result = vehicle.getCoordinates().getFormattedString();
}
} break;
case LOCATION : {
Settlement settle = vehicle.getSettlement();
if (settle != null) {
result = settle.getName();
}
else {
result = vehicle.getCoordinates().getFormattedString();
}
} break;
case DESTINATION : {
result = null;
Mission mission = missionManager.getMissionForVehicle(vehicle);
if ((mission != null) && (mission instanceof VehicleMission)) {
VehicleMission vehicleMission = (VehicleMission) mission;
String status = vehicleMission.getTravelStatus();
if (status != null) {
if (status.equals(TravelMission.TRAVEL_TO_NAVPOINT)) {
NavPoint destination = vehicleMission.getNextNavpoint();
if (destination.isSettlementAtNavpoint())
result = destination.getSettlement().getName();
else
result = Conversion.capitalize(destination.getDescription()) + " - " + destination.getLocation().getFormattedString();
}
else if (status.equals(TravelMission.AT_NAVPOINT)) {
NavPoint destination = vehicleMission.getCurrentNavpoint();
// result = destination.getLocation().getFormattedString();
result = Conversion.capitalize(destination.getDescription());
}
}
}
} break;
case DESTDIST : {
Mission mission = missionManager.getMissionForVehicle(vehicle);
if ((mission != null) && (mission instanceof VehicleMission)) {
VehicleMission vehicleMission = (VehicleMission) mission;
try {
result = Math.round(vehicleMission.getCurrentLegRemainingDistance()*10.0)/10.0;
}
catch (Exception e) {
logger.log(Level.SEVERE,"Error getting current leg remaining distance.");
e.printStackTrace(System.err);
}
}
else result = null;
} break;
case MISSION : {
Mission mission = missionManager.getMissionForVehicle(vehicle);
if (mission != null) {
result = mission.getFullMissionDesignation();//getDescription();.getName();
}
else result = null;
} break;
case CREW : {
if (vehicle instanceof Crewable)
result = ((Crewable) vehicle).getCrewNum();
else result = 0;
} break;
// case BOTS : {
// if (vehicle instanceof Crewable)
// result = ((Crewable) vehicle).getRobotCrewNum();
// else result = 0;
// } break;
case DRIVER : {
if (vehicle.getOperator() != null) {
result = vehicle.getOperator().getName();
}
else {
result = null;
}
} break;
case SPEED : {
result = Math.round(vehicle.getSpeed()*10.0)/10.0;
} break;
// Status is a combination of Mechanical failure and maintenance
case STATUS : {
result = vehicle.printStatusTypes();
} break;
case BEACON : {
if (vehicle.isBeaconOn()) result = ON;
else result = OFF;
} break;
case RESERVED : {
if (vehicle.isReserved()) result = TRUE;
else result = FALSE;
} break;
case MALFUNCTION: {
Malfunction failure = vehicle.getMalfunctionManager().getMostSeriousMalfunction();
if (failure != null) result = failure.getName();
} break;
case WATER : {
//result = decFormatter.format(resourceMap.get(AmountResource.findAmountResource(LifeSupport.WATER)));
double value = resourceMap.get(waterID);
if (value == 0)
result = "--";
else
result = value;
} break;
case FOOD : {
//result = decFormatter.format(resourceMap.get(AmountResource.findAmountResource(LifeSupport.FOOD)));
double value = resourceMap.get(foodID);
if (value == 0)
result = "--";
else
result = value;
} break;
case DESSERT : {
double sum = 0;
int mapSize = resourceMap.size();
if (mapSizeCache != mapSize) {
mapSizeCache = mapSize ;
}
for (Integer ar : resourceMap.keySet()) {
for(AmountResource n : availableDesserts) {
//if (n.getName().equals(ar.getName())) {
//if (n.equals(ar)) {
if (n.getID() == ar) {
double amount = resourceMap.get(ar);
sum += amount;
break;
}
}
}
double value = Double.valueOf(sum);
if (value == 0)
result = "--";
else
result = value;
} break;
case OXYGEN : {
//result = decFormatter.format(resourceMap.get(AmountResource.findAmountResource(LifeSupport.OXYGEN)));
double value = resourceMap.get(oxygenID);
if (value == 0)
result = "--";
else
result = value;
} break;
case METHANE : {
//result = decFormatter.format(resourceMap.get(AmountResource.findAmountResource("methane")));
double value = resourceMap.get(methaneID);
if (value == 0)
result = "--";
else
result = value;
} break;
case ROCK_SAMPLES : {
//result = decFormatter.format(resourceMap.get(AmountResource.findAmountResource("rock samples")));
double value = resourceMap.get(rockSamplesID);
if (value == 0)
result = "--";
else
result = value;
} break;
case ICE : {
//result = decFormatter.format(resourceMap.get(AmountResource.findAmountResource("ice")));
result = resourceMap.get(iceID);
} break;
}
}
catch (Exception e) {
logger.log(Level.SEVERE, "getValueAt() cannot return a valid result", e);
e.printStackTrace(System.err);
}
}
return result;
}
/**
* Catch unit update event.
* @param event the unit event.
*/
public void unitUpdate(UnitEvent event) {
Unit unit = (Unit) event.getSource();
if (unit.getUnitType() == UnitType.VEHICLE) {
Vehicle vehicle = (Vehicle) unit;
int unitIndex = -1;
Object source = event.getTarget();
UnitEventType eventType = event.getType();
if (mode == GameMode.COMMAND) {
if (vehicle.getAssociatedSettlement().getName().equalsIgnoreCase(commanderSettlement.getName()))
unitIndex = 0;
}
else {
unitIndex = getUnitIndex(vehicle);
}
if (unitIndex > -1) {
int columnNum = -1;
if (eventType == UnitEventType.NAME_EVENT) columnNum = NAME;
else if (eventType == UnitEventType.LOCATION_EVENT) columnNum = LOCATION;
else if (eventType == UnitEventType.INVENTORY_STORING_UNIT_EVENT ||
eventType == UnitEventType.INVENTORY_RETRIEVING_UNIT_EVENT) {
if (((Unit)source).getUnitType() == UnitType.PERSON) columnNum = CREW;
// else if (source instanceof Robot) columnNum = BOTS;
}
else if (eventType == UnitEventType.OPERATOR_EVENT) columnNum = DRIVER;
else if (eventType == UnitEventType.STATUS_EVENT) columnNum = STATUS;
else if (eventType == UnitEventType.EMERGENCY_BEACON_EVENT) columnNum = BEACON;
else if (eventType == UnitEventType.RESERVED_EVENT) columnNum = RESERVED;
else if (eventType == UnitEventType.SPEED_EVENT) columnNum = SPEED;
else if (eventType == UnitEventType.MALFUNCTION_EVENT) columnNum = MALFUNCTION;
else if (eventType == UnitEventType.INVENTORY_RESOURCE_EVENT) {
int target = -1;
if (source instanceof AmountResource) {
target = ((AmountResource)source).getID();
}
else if (source instanceof Integer) {
target = (Integer)source;
// if (target < ResourceUtil.FIRST_ITEM_RESOURCE_ID)
// ; // continue
if (target >= ResourceUtil.FIRST_ITEM_RESOURCE_ID)
// if it's an item resource, quit
return;
}
try {
int tempColumnNum = -1;
double currentValue = 0.0;
Map<Integer, Double> resourceMap = resourceCache.get(vehicle);
if (target == oxygenID) {
tempColumnNum = OXYGEN;
currentValue = resourceMap.get(oxygenID);
}
else if (target == methaneID) {
tempColumnNum = METHANE;
currentValue = resourceMap.get(methaneID);
}
else if (target == foodID) {
tempColumnNum = FOOD;
currentValue = resourceMap.get(foodID);
}
else if (target == waterID) {
tempColumnNum = WATER;
currentValue = resourceMap.get(waterID);
}
else if (target == rockSamplesID) {
tempColumnNum = ROCK_SAMPLES;
currentValue = resourceMap.get(rockSamplesID);
}
else if (target == iceID) {
tempColumnNum = ICE;
currentValue = resourceMap.get(iceID);
}
else {
// Put together a list of available dessert
for(AmountResource ar : availableDesserts) {
if (target == ar.getID()) {
tempColumnNum = DESSERT;
currentValue = resourceMap.get(ar.getID());
}
}
}
if (tempColumnNum > -1 && unitIndex > -1) {
currentValue = Math.round (currentValue * 10.0 ) / 10.0;
double newValue = Math.round (getResourceStored(unit, target) * 10.0 ) / 10.0;
if (currentValue != newValue) {
columnNum = tempColumnNum;
resourceMap.put(target, newValue);
}
}
}
catch (Exception e) {
logger.log(Level.SEVERE, "Issues with unitUpdate()", e);
}
}
if (columnNum > -1 && unitIndex > -1) {
SwingUtilities.invokeLater(new VehicleTableCellUpdater(unitIndex, columnNum));
}
}
}
}
/**
* Defines the source data from this table
*/
private void setSource(Collection<Vehicle> source) {
Iterator<Vehicle> iter = source.iterator();
while(iter.hasNext()) addUnit(iter.next());
}
/**
* Add a unit to the model.
* @param newUnit Unit to add to the model.
*/
protected void addUnit(Unit newUnit) {
if (resourceCache == null) resourceCache = new HashMap<>();
if (!resourceCache.containsKey(newUnit)) {
try {
Map<Integer, Double> resourceMap = new HashMap<Integer, Double>();
resourceMap.put(foodID, Math.round(100.0 * getResourceStored(newUnit, foodID))/100.0);
resourceMap.put(oxygenID, Math.round(100.0 * getResourceStored(newUnit, oxygenID))/100.0);
resourceMap.put(waterID, Math.round(100.0 * getResourceStored(newUnit, waterID))/100.0);
resourceMap.put(methaneID, Math.round(100.0 *getResourceStored(newUnit, methaneID))/100.0);
resourceMap.put(rockSamplesID, Math.round(100.0 *getResourceStored(newUnit, rockSamplesID))/100.0);
resourceMap.put(iceID, Math.round(100.0 *getResourceStored(newUnit, iceID))/100.0);
// Put together a list of available dessert
for(AmountResource ar : availableDesserts) {
resourceMap.put(ar.getID(), Math.round(100.0 *getResourceStored(newUnit, ar.getID()))/100.0);
}
resourceCache.put((Vehicle)newUnit, resourceMap);
}
catch (Exception e) {
logger.log(Level.SEVERE, "addUnit() does not work when creating resourceCache", e);
}
}
super.addUnit(newUnit);
}
/**
* Remove a unit to the model.
* @param oldUnit Unit to remove from the model.
*/
protected void removeUnit(Unit oldUnit) {
if (resourceCache == null) resourceCache = new HashMap<>();
if (resourceCache.containsKey(oldUnit)) {
Map<Integer, Double> resourceMap = resourceCache.get(oldUnit);
resourceMap.clear();
resourceCache.remove(oldUnit);
}
super.removeUnit(oldUnit);
}
/**
* Gets the Double amount of resources stored in a unit.
* @param unit the unit to check.
* @param resource the resource to check.
* @return amount of resource.
*/
private double getResourceStored(Unit unit, int resource) {
return Math.round(((Vehicle)unit).getAmountResourceStored(resource) * 100.0) / 100.0;
}
/**
* Prepares the model for deletion.
*/
public void destroy() {
super.destroy();
unitManager.removeUnitManagerListener(unitManagerListener);
unitManager = null;
unitManagerListener = null;
if (missionManagerListener != null) {
missionManagerListener.destroy();
}
missionManagerListener = null;
if (resourceCache != null) {
resourceCache.clear();
}
resourceCache = null;
}
/**
* UnitManagerListener inner class.
*/
private class LocalUnitManagerListener implements UnitManagerListener {
/**
* Catch unit manager update event.
* @param event the unit event.
*/
public void unitManagerUpdate(UnitManagerEvent event) {
Unit unit = event.getUnit();
UnitManagerEventType eventType = event.getEventType();
if (unit.getUnitType() == UnitType.VEHICLE) {
boolean change = false;
if (mode == GameMode.COMMAND) {
if (unit.getAssociatedSettlement().getName().equalsIgnoreCase(commanderSettlement.getName()))
change = true;
}
else {
change = true;
}
if (change) {
if (eventType == UnitManagerEventType.ADD_UNIT) {
if (!containsUnit(unit)) addUnit(unit);
}
else if (eventType == UnitManagerEventType.REMOVE_UNIT) {
if (containsUnit(unit)) removeUnit(unit);
}
}
}
}
}
private class LocalMissionManagerListener implements MissionManagerListener {
private List<Mission> missions;
private MissionListener missionListener;
LocalMissionManagerListener() {
missionListener = new LocalMissionListener();
if (mode == GameMode.COMMAND) {
missions = missionManager.getMissionsForSettlement(commanderSettlement);
}
else {
missions = missionManager.getMissions();
}
for (Mission m : missions)
addMission(m);
}
/**
* Adds a new mission.
* @param mission the new mission.
*/
public void addMission(Mission mission) {
mission.addMissionListener(missionListener);
updateVehicleMissionCell(mission);
}
/**
* Removes an old mission.
* @param mission the old mission.
*/
public void removeMission(Mission mission){
mission.removeMissionListener(missionListener);
updateVehicleMissionCell(mission);
}
private void updateVehicleMissionCell(Mission mission) {
// if (mission instanceof VehicleMission) {
// Vehicle vehicle = ((VehicleMission) mission).getVehicle();
// if (vehicle != null) {
// int unitIndex = getUnitIndex(vehicle);
// SwingUtilities.invokeLater(new VehicleTableCellUpdater(unitIndex, MISSION));
// }
// }
// Update all table cells because construction/salvage mission may affect more than one vehicle.
fireTableDataChanged();
}
/**
* Prepares for deletion.
*/
public void destroy() {
//Iterator<Mission> i = missions.iterator();
//while (i.hasNext()) removeMission(i.next());
for (Mission m : missions) removeMission(m);
missions = null;
missionListener = null;
}
}
/**
* Inner class for updating a cell in the vehicle table.
*/
private class VehicleTableCellUpdater implements Runnable {
private int row;
private int column;
private VehicleTableCellUpdater(int row, int column) {
this.row = row;
this.column = column;
}
public void run() {
fireTableCellUpdated(row, column);
}
}
/**
* MissionListener inner class.
*/
private class LocalMissionListener implements MissionListener {
/**
* Catch mission update event.
* @param event the mission event.
*/
public void missionUpdate(MissionEvent event) {
Mission mission = (Mission) event.getSource();
MissionEventType eventType = event.getType();
int columnNum = -1;
if (eventType == MissionEventType.TRAVEL_STATUS_EVENT ||
eventType == MissionEventType.NAVPOINTS_EVENT
) columnNum = DESTINATION;
else if (eventType == MissionEventType.DISTANCE_EVENT) columnNum = DESTDIST;
else if (eventType == MissionEventType.VEHICLE_EVENT) columnNum = MISSION;
if (columnNum > -1) {
if (mission instanceof VehicleMission) {
Vehicle vehicle = ((VehicleMission) mission).getVehicle();
if (vehicle != null) {
int unitIndex = getUnitIndex(vehicle);
if (unitIndex > -1)
SwingUtilities.invokeLater(new VehicleTableCellUpdater(unitIndex, columnNum));
}
}
}
}
}
}
|
gpl-3.0
|
maleadt/stockplay
|
src/interfaces/desktop/StockPlayAdministration/src/com/kapti/administration/helpers/StockPlayeIDLoginScreen.java
|
8134
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.kapti.administration.helpers;
import com.kapti.client.user.User;
import com.kapti.client.user.UserFactory;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.awt.HeadlessException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ResourceBundle;
import java.util.concurrent.ExecutionException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingWorker;
import org.jdesktop.swingx.JXErrorPane;
/**
*
* @author Thijs
*/
public class StockPlayeIDLoginScreen extends JFrame implements PropertyChangeListener, LoginScreen, ActionListener {
JPanel panel = null;
JLabel step1Label = new JLabel(translations.getString("EID_1"));
JLabel step2Label = new JLabel(translations.getString("EID_2"));
JLabel step3Label = new JLabel(translations.getString("EID_3"));
JLabel step4Label = new JLabel(translations.getString("EID_4"));
JLabel step5Label = new JLabel(translations.getString("EID_5"));
JLabel titleLabel = new JLabel(translations.getString("EID_LOGIN_TITLE"));
JButton cancelButton = new JButton(translations.getString("EID_LOGIN_CANCEL"));
private final static Color activeColor = Color.BLACK;
private final static Color inactiveColor = Color.LIGHT_GRAY;
private static final ResourceBundle translations = ResourceBundle.getBundle("com/kapti/administration/translations");
private long RRN = -1;
private List<ActionListener> listeners = new ArrayList<ActionListener>();
public void addActionListener(ActionListener listener) {
listeners.add(listener);
}
public void removeActionListener(ActionListener listener) {
listeners.remove(listener);
}
private void fireActionEvent(ActionEvent e) {
for (ActionListener listener : listeners) {
listener.actionPerformed(e);
}
}
public StockPlayeIDLoginScreen() throws HeadlessException {
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setLayout(new BorderLayout());
//instellen van titel
titleLabel.setFont(titleLabel.getFont().deriveFont(Font.BOLD, 20));
titleLabel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
add(titleLabel, BorderLayout.NORTH);
panel = new JPanel();
panel.setBorder(BorderFactory.createEmptyBorder(0, 15, 15, 15));
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
panel.add(step1Label);
panel.add(step2Label);
panel.add(step3Label);
panel.add(step4Label);
panel.add(step5Label);
add(panel, BorderLayout.CENTER);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
if (eIDWorker.isDone() && RRN > 0) {
fireActionEvent(new ActionEvent(this, 1, ""));
} else {
fireActionEvent(new ActionEvent(this, 0, ""));
}
}
});
add(cancelButton, BorderLayout.SOUTH);
cancelButton.addActionListener(this);
pack();
setLocationRelativeTo(null);
eIDWorker.addPropertyChangeListener(this);
eIDWorker.execute();
}
private void showStep(int i) {
step1Label.setForeground(i == 1 ? activeColor : inactiveColor);
step2Label.setForeground(i == 2 ? activeColor : inactiveColor);
step3Label.setForeground(i == 3 ? activeColor : inactiveColor);
step4Label.setForeground(i == 4 ? activeColor : inactiveColor);
step5Label.setForeground(i == 5 ? activeColor : inactiveColor);
}
SwingWorker<User, Integer> eIDWorker = new SwingWorker<User, Integer>() {
@Override
protected User doInBackground() throws Exception {
this.setProgress(1);
eIDService eid = new eIDService();
this.setProgress(2);
eid.findCard();
this.setProgress(3);
eid.readCard();
//we zoeken nu deze gebruiker op op de server
StockPlayPreferences prefs = new StockPlayPreferences();
UserFactory uf = UserFactory.getInstance();
if (!uf.verifyLogin(prefs.getEidAdminUsername(), prefs.getEidAdminPassword())) {
JOptionPane.showMessageDialog(rootPane, translations.getString("EID_SERVER_ERROR_MESSAGE"), translations.getString("EID_SERVER_ERROR_TITLE"), JOptionPane.ERROR_MESSAGE);
return null;
}
Collection<User> users = uf.getUsersDetailsByFilter("rrn == '" + eid.getRijksRegisterNummer() + "'");
Iterator<User> it = users.iterator();
if (!it.hasNext()) {
JOptionPane.showMessageDialog(rootPane, translations.getString("EID_NOACCOUNT_ERROR_MESSAGE"), translations.getString("EID_NOACCOUNT_ERROR_TITLE"), JOptionPane.ERROR_MESSAGE);
return null;
}
User user = it.next();
this.setProgress(4);
while (!eid.isAuthenticated()) {
eid.verifyPIN();
if (!eid.isAuthenticated()) {
if (eid.isUserCancelled()) {
JOptionPane.showMessageDialog(rootPane, translations.getString("EID_PINCANCEL_ERROR_MESSAGE"), translations.getString("EID_PINCANCEL_ERROR_TITLE"), JOptionPane.ERROR_MESSAGE);
return null;
} else {
if (JOptionPane.showConfirmDialog(rootPane, String.format(translations.getString("EID_PIN_ERROR_MESSAGE"), eid.getTriesLeft()), translations.getString("EID_PIN_ERROR_TITLE"), JOptionPane.YES_NO_CANCEL_OPTION)
!= JOptionPane.YES_OPTION) {
return null;
}
}
}
}
this.setProgress(5);
uf.setLoggedInUser(user);
return user;
}
@Override
protected void done() {
try {
//TODO sessieid ophalen bij de backend
user = get();
success = user != null;
fireActionEvent(new ActionEvent(this, success ? 1 : 0, ""));
} catch (InterruptedException ex) {
fireActionEvent(new ActionEvent(this, 0, ""));
Logger.getLogger(StockPlayeIDLoginScreen.class.getName()).log(Level.SEVERE, null, ex);
} catch (ExecutionException ex) {
JXErrorPane.showDialog(new Exception(translations.getString("EID_PROCESS_ERROR"), ex));
fireActionEvent(new ActionEvent(this, 0, ""));
Logger.getLogger(StockPlayeIDLoginScreen.class.getName()).log(Level.SEVERE, null, ex);
}
setVisible(false);
super.done();
}
};
public void propertyChange(PropertyChangeEvent evt) {
showStep(eIDWorker.getProgress());
}
protected boolean loggedIn;
/**
* Get the value of loggedIn
*
* @return the value of loggedIn
*/
public boolean isLoggedIn() {
return loggedIn;
}
private User user = null;
private boolean success = false;
public User getUser() {
return user;
}
public boolean isSuccess() {
return success;
}
public void actionPerformed(ActionEvent e) {
fireActionEvent(new ActionEvent(this, 0, ""));
setVisible(false);
}
}
|
gpl-3.0
|
AmosJindao/movie
|
tests/src/main/java/tests/jdk8/date/LocalDateTest.java
|
1336
|
package tests.jdk8.date;
import java.time.*;
/**
* Created on 2017/1/19.
*/
public class LocalDateTest {
public static void main(String[] args) {
System.out.println(today());
printYMD();
birthday();
toInstant();
}
static LocalDate today(){
LocalDate today = LocalDate.now();
return today;
}
static void printYMD(){
LocalDate td = today();
System.out.println("year:"+td.getYear()+" month:"+td.getMonthValue()+" day:"+td.getDayOfMonth()+
"\nmon.:"+td.getMonth()+" yearDay:"+td.getDayOfYear()+" weekday:"+td.getDayOfWeek() +" weekdayint:"+td.getDayOfWeek().getValue());
}
static void birthday(){
LocalDate dateOfBirth = LocalDate.of(2010, 01, 26);
MonthDay birthday = MonthDay.of(dateOfBirth.getMonth(), dateOfBirth.getDayOfMonth());
MonthDay currentMonthDay = MonthDay.from(LocalDate.now());
if(currentMonthDay.equals(birthday)){
System.out.println("Many Many happy returns of the day !!");
}else{
System.out.println("Sorry, today is not your birthday");
}
}
static void toInstant(){
Instant instant = LocalDateTime.now().toInstant(ZoneOffset.of("+0"));
System.out.println(instant);
}
}
|
gpl-3.0
|
phiros/nepi
|
examples/ns3/local_csma_p2p_star_ping.py
|
5591
|
#!/usr/bin/env python
#
# NEPI, a framework to manage network experiments
# Copyright (C) 2013 INRIA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Author: Alina Quereilhac <alina.quereilhac@inria.fr>
"""
network topology:
n6
|
p2p
|
n4
|
n1 -- p2p -- n2 -- csma -- n5 -- p2p -- n8
|
n3
|
p2p
|
n7
"""
from nepi.execution.ec import ExperimentController
def add_node(ec, simu):
## Add a ns-3 node with its protocol stack
nsnode = ec.register_resource("ns3::Node")
ec.register_connection(nsnode, simu)
ipv4 = ec.register_resource("ns3::Ipv4L3Protocol")
ec.register_connection(nsnode, ipv4)
arp = ec.register_resource("ns3::ArpL3Protocol")
ec.register_connection(nsnode, arp)
icmp = ec.register_resource("ns3::Icmpv4L4Protocol")
ec.register_connection(nsnode, icmp)
return nsnode
def add_p2p_dev(ec, nsnode, ip, prefix):
# Add a point to point net device to the node
dev = ec.register_resource("ns3::PointToPointNetDevice")
ec.set(dev, "ip", ip)
ec.set(dev, "prefix", prefix)
ec.register_connection(nsnode, dev)
queue = ec.register_resource("ns3::DropTailQueue")
ec.register_connection(dev, queue)
return dev
def add_csma_dev(ec, nsnode, ip, prefix):
dev = ec.register_resource("ns3::CsmaNetDevice")
ec.set(dev, "ip", ip)
ec.set(dev, "prefix", prefix)
ec.register_connection(nsnode, dev)
queue = ec.register_resource("ns3::DropTailQueue")
ec.register_connection(dev, queue)
return dev
def add_csma_chan(ec, devs):
# Create channel
chan = ec.register_resource("ns3::CsmaChannel")
ec.set(chan, "Delay", "0s")
for dev in devs:
ec.register_connection(chan, dev)
return chan
def add_p2p_chan(ec, dev1, dev2):
# Add a point to point channel
chan = ec.register_resource("ns3::PointToPointChannel")
ec.set(chan, "Delay", "0s")
ec.register_connection(chan, dev1)
ec.register_connection(chan, dev2)
return chan
ec = ExperimentController(exp_id = "ns3-csma-p2p-ping")
# Simulation will run in a remote machine
node = ec.register_resource("linux::Node")
ec.set(node, "hostname", "localhost")
# Add a simulation resource
simu = ec.register_resource("linux::ns3::Simulation")
ec.set(simu, "verbose", True)
ec.set(simu, "enableDump", True)
ec.register_connection(simu, node)
# Add simulated nodes
nsnode1 = add_node(ec, simu)
nsnode2 = add_node(ec, simu)
nsnode3 = add_node(ec, simu)
nsnode4 = add_node(ec, simu)
nsnode5 = add_node(ec, simu)
nsnode6 = add_node(ec, simu)
nsnode7 = add_node(ec, simu)
nsnode8 = add_node(ec, simu)
# Build the start topology
dev12 = add_p2p_dev(ec, nsnode1, "10.0.1.1", "30")
dev21 = add_p2p_dev(ec, nsnode2, "10.0.1.2", "30")
p2p1 = add_p2p_chan(ec, dev12, dev21)
dev46 = add_p2p_dev(ec, nsnode4, "10.0.2.1", "30")
dev64 = add_p2p_dev(ec, nsnode6, "10.0.2.2", "30")
p2p2 = add_p2p_chan(ec, dev46, dev64)
dev37 = add_p2p_dev(ec, nsnode3, "10.0.3.1", "30")
dev73 = add_p2p_dev(ec, nsnode7, "10.0.3.2", "30")
p2p3 = add_p2p_chan(ec, dev37, dev73)
dev85 = add_p2p_dev(ec, nsnode5, "10.0.4.1", "30")
dev58 = add_p2p_dev(ec, nsnode8, "10.0.4.2", "30")
p2p4 = add_p2p_chan(ec, dev85, dev58)
dev2 = add_csma_dev(ec, nsnode2, "10.0.0.1", "24")
dev3 = add_csma_dev(ec, nsnode3, "10.0.0.2", "24")
dev4 = add_csma_dev(ec, nsnode4, "10.0.0.3", "24")
dev5 = add_csma_dev(ec, nsnode5, "10.0.0.4", "24")
csma1 = add_csma_chan(ec, [dev2, dev3, dev4, dev5])
## Add routes
# Add n2 as default gw for n1
r1 = ec.register_resource("ns3::Route")
ec.set(r1, "network", "0.0.0.0")
ec.set(r1, "prefix", "30")
ec.set(r1, "nexthop", "10.0.1.2")
ec.register_connection(r1, nsnode1)
# Add route to n8 from n2
r28 = ec.register_resource("ns3::Route")
ec.set(r28, "network", "10.0.4.0")
ec.set(r28, "prefix", "30")
ec.set(r28, "nexthop", "10.0.0.4")
ec.register_connection(r28, nsnode2)
# Add n5 as default gw for n8
r8 = ec.register_resource("ns3::Route")
ec.set(r8, "network", "0.0.0.0")
ec.set(r8, "prefix", "30")
ec.set(r8, "nexthop", "10.0.4.1")
ec.register_connection(r8, nsnode8)
# Add route to n1 from n5
r51 = ec.register_resource("ns3::Route")
ec.set(r51, "network", "10.0.1.0")
ec.set(r51, "prefix", "30")
ec.set(r51, "nexthop", "10.0.0.1")
ec.register_connection(r51, nsnode5)
### create pinger
ping = ec.register_resource("ns3::V4Ping")
ec.set (ping, "Remote", "10.0.4.2")
ec.set (ping, "Interval", "1s")
ec.set (ping, "Verbose", True)
ec.set (ping, "StartTime", "0s")
ec.set (ping, "StopTime", "20s")
ec.register_connection(ping, nsnode1)
ec.deploy()
ec.wait_finished([ping])
stdout = ec.trace(simu, "stdout")
ec.shutdown()
print "PING OUTPUT", stdout
|
gpl-3.0
|
AA25/visualisationEngine
|
lang/en/vpl.php
|
24793
|
<?php
// This file is part of VPL for Moodle - http://vpl.dis.ulpgc.es/
//
// VPL for Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// VPL for Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with VPL for Moodle. If not, see <http://www.gnu.org/licenses/>.
$string ['about'] = 'About';
$string ['acceptcertificates'] = 'Accept self signed certificates';
$string ['acceptcertificates_description'] = 'If the execution servers are not using self signed certificates uncheck this option';
$string ['acceptcertificatesnote'] = "<p>You are using an encrypted connection.<p/>
<p>To use an encrypted connection with the execution servers it is required you accept its certificates.</p>
<p>If you have problems with this process, you can try to use a http (unencrypted) connection or other browser.</p>
<p>Please, click on the following links (server #) and accept the offered certificate.</p>";
$string ['addfile'] = 'Add file';
$string ['advanced'] = 'Advanced';
$string ['allfiles'] = 'All files';
$string ['allsubmissions'] = 'All submissions';
$string ['anyfile'] = 'Any file';
$string ['attemptnumber'] = 'Attempt number {$a}';
$string ['automaticevaluation'] = 'Automatic evaluation';
$string ['automaticgrading'] = 'Automatic grade';
$string ['averageperiods'] = 'Average periods {$a}';
$string ['averagetime'] = 'Average time {$a}';
$string ['basedon'] = 'Based on';
$string ['basic'] = 'Basic';
$string ['binaryfile'] = 'Binary File';
$string ['browserupdate'] = 'Please update your browser to the last version<br />or use another that supports Websocket.';
$string ['calculate'] = 'Calculate';
$string ['changesNotSaved'] = 'Changes have not been saved';
$string ['check_jail_servers'] = 'Check execution servers';
$string ['clipboard'] = 'Clipboard';
$string ['closed'] = 'Closed';
$string ['comments'] = 'Comments';
$string ['compilation'] = 'Compilation';
$string ['connected'] = 'connected';
$string ['connecting'] = 'connecting';
$string ['connection_closed'] = 'connection closed';
$string ['connection_fail'] = 'connection fail';
$string ['console'] = 'Console';
$string ['copy'] = 'Copy';
$string ['create_new_file'] = 'Create a new file';
$string ['currentstatus'] = 'Current status';
$string ['cut'] = 'Cut';
$string ['datesubmitted'] = 'Date submitted';
$string ['debug'] = 'Debug';
$string ['debugging'] = 'Debugging';
$string ['defaultexefilesize'] = 'Maximum default execution file size';
$string ['defaultexememory'] = 'Maximum default memory used';
$string ['defaultexeprocesses'] = 'Maximum default number of processes';
$string ['defaultexetime'] = 'Maximum default execution time';
$string ['defaultfilesize'] = 'Default maximum upload file size';
$string ['defaultresourcelimits'] = 'Default execution resources limits';
$string ['delete'] = 'Delete';
$string ['delete_file_fq'] = "delete '{\$a}' file?";
$string ['delete_file_q'] = 'Delete file?';
$string ['deleteallsubmissions'] = 'Delete all submissions';
$string ['description'] = 'Description';
$string ['diff'] = 'diff';
$string ['discard_submission_period'] = 'Discard submission period';
$string ['discard_submission_period_description'] = 'For each student and assignment, the system tries to discard submissions. The system keep the last one and at least a submission for every period';
$string ['download'] = 'Download';
$string ['downloadallsubmissions'] = 'Download all submissions';
$string ['duedate'] = 'Due date';
$string ['edit'] = 'Edit';
$string ['editing'] = 'Editing';
$string ['evaluate'] = 'Evaluate';
$string ['evaluateonsubmission'] = 'Evaluate just on submission';
$string ['evaluating'] = 'Evaluating';
$string ['evaluation'] = 'Evaluation';
$string ['examples'] = 'Examples';
$string ['execution'] = 'Execution';
$string ['executionfiles'] = 'Execution files';
$string ['executionoptions'] = 'Execution options';
$string ['file'] = 'File';
$string ['file_name'] = 'File name';
$string ['fileadded'] = "The '{\$a}' file has been added";
$string ['filedeleted'] = "The '{\$a}' file has been deleted";
$string ['filelist'] = "File list";
$string ['filenotadded'] = 'File has not been added';
$string ['fileNotChanged'] = 'File has not changed';
$string ['filenotdeleted'] = 'The \'{$a}\' file has NOT been deleted';
$string ['filenotrenamed'] = 'The \'{$a}\' file has NOT been renamed';
$string ['filerenamed'] = "The '{\$a->from}' file has been renamed to '{\$a->to}'";
$string ['filesChangedNotSaved'] = 'Files have changed but they have not been saved';
$string ['filesNotChanged'] = 'Files have not changed';
$string ['filestoscan'] = 'Files to scan';
$string ['fileupdated'] = "The '{\$a}' file has been updated";
$string ['find'] = "Find";
$string ['find_replace'] = 'Find/Replace';
$string ['fulldescription'] = 'Full description';
$string ['fullscreen'] = 'Fullscreen';
$string ['getjails'] = 'Get execution servers';
$string ['gradeandnext'] = 'Grade & next';
$string ['graded'] = 'Graded';
$string ['gradedbyuser'] = 'Graded by user';
$string ['gradedon'] = "Evaluated on";
$string ['gradedonby'] = 'Reviewed on {$a->date} by {$a->gradername}';
$string ['gradenotremoved'] = 'The grade has NOT been removed. Check activity config in the gradebook.';
$string ['gradenotsaved'] = 'The grade has NOT been saved. Check activity config in the gradebook.';
$string ['gradeoptions'] = 'Grade options';
$string ['grader'] = "Evaluator";
$string ['gradercomments'] = 'Assessment report';
$string ['graderemoved'] = 'The grade has been removed';
$string ['groupwork'] = 'Group work';
$string ['inconsistentgroup'] = 'You are not member of only one group (0 o >1)';
$string ['incorrect_file_name'] = 'Incorrect file name';
$string ['individualwork'] = 'Individual work';
$string ['instanceselection'] = 'VPL selection';
$string ['isexample'] = 'This activity acts as example';
$string ['jail_servers'] = 'Execution servers list';
$string ['jail_servers_config'] = 'Execution servers config';
$string ['jail_servers_description'] = 'Write a line for each server';
$string ['joinedfiles'] = 'Joined selected files';
$string ['keepfiles'] = 'Files to keep when running';
$string ['keyboard'] = 'Keyboard';
$string ['lasterror'] = 'Last error info';
$string ['lasterrordate'] = 'Last error date';
$string ['listofcomments'] = 'List of comments';
$string ['listsimilarity'] = 'List of similarities found';
$string ['listwatermarks'] = 'Water marks list';
$string ['load'] = 'Load';
$string ['loading'] = 'Loading';
$string ['local_jail_servers'] = 'Local execution servers';
$string ['manualgrading'] = 'Manual grading';
$string ['maxexefilesize'] = 'Maximum execution file size';
$string ['maxexememory'] = 'Maximum memory used';
$string ['maxexeprocesses'] = 'Maximum number of processes';
$string ['maxexetime'] = 'Maximum execution time';
$string ['maxfiles'] = 'Maximum number of files';
$string ['maxfilesexceeded'] = 'Maximum number of files exceeded';
$string ['maxfilesize'] = 'Maximum upload file size';
$string ['maxfilesizeexceeded'] = 'Maximum file size exceeded';
$string ['maximumperiod'] = 'Maximum period {$a}';
$string ['maxresourcelimits'] = 'Maximum execution resources limits';
$string ['maxsimilarityoutput'] = 'Maximum output by similarity';
$string ['menucheck_jail_servers'] = 'Check execution servers';
$string ['menuexecutionfiles'] = 'Execution files';
$string ['menuexecutionoptions'] = 'Options';
$string ['menukeepfiles'] = 'Files to keep';
$string ['menulocal_jail_servers'] = 'Local execution servers';
$string ['menuresourcelimits'] = 'Resources limits';
$string ['minsimlevel'] = 'Minimum similarity level to show';
$string ['moduleconfigtitle'] = 'VPL Module Config';
$string ['modulename'] = 'Virtual programming lab';
$string ['modulenameplural'] = 'Virtual programming labs';
$string ['new'] = 'New';
$string ['new_file_name'] = 'New file name';
$string ['next'] = 'Next';
$string ['nojailavailable'] = 'No execution server available';
$string ['noright'] = 'You don\'t have right to access';
$string ['nosubmission'] = 'No submission available';
$string ['notexecuted'] = 'Not executed';
$string ['notgraded'] = 'Not graded';
$string ['notsaved'] = 'Not saved';
$string ['novpls'] = 'No virtual programming lab defined';
$string ['nowatermark'] = 'Own water marks {$a}';
$string ['nsubmissions'] = '{$a} submissions';
$string ['numcluster'] = 'Cluster {$a}';
$string ['open'] = 'Open';
$string ['opnotallowfromclient'] = 'Action not allowed from this machine';
$string ['options'] = 'Options';
$string ['optionsnotsaved'] = 'Options have not been saved';
$string ['optionssaved'] = 'Options have been saved';
$string ['origin'] = 'Origin';
$string ['othersources'] = 'Other sources to add to the scan';
$string ['outofmemory'] = 'Out of memory';
$string ['paste'] = 'Paste';
$string ['pluginadministration'] = 'VPL administration';
$string ['pluginname'] = 'Virtual programming lab';
$string ['previoussubmissionslist'] = 'Previous submissions list';
$string ['print'] = 'Print';
$string ['proposedgrade'] = 'Proposed grade: {$a}';
$string ['proxy'] = 'proxy';
$string ['proxy_description'] = 'Proxy from Moodle to execution servers';
$string ['redo'] = 'Redo';
$string ['regularscreen'] = 'Regular screen';
$string ['removegrade'] = 'Remove grade';
$string ['rename'] = 'Rename';
$string ['rename_file'] = 'Rename file';
$string ['replace_find'] = 'Replace/Find';
$string ['requestedfiles'] = 'Requested files';
$string ['requirednet'] = 'Allowed submission from net';
$string ['requiredpassword'] = 'A password is required';
$string ['resetfiles'] = 'Reset files';
$string ['resetvpl'] = 'Reset {$a}';
$string ['resourcelimits'] = 'Resources limits';
$string ['restrictededitor'] = 'Dissable external file upload, paste and drop external content';
$string ['retrieve'] = 'Retrieve results';
$string ['run'] = 'Run';
$string ['running'] = 'Running';
$string ['save'] = 'Save';
$string ['save'] = 'Save';
$string ['savecontinue'] = 'Save and continue';
$string ['saved'] = 'Saved';
$string ['savedfile'] = "The '{\$a}' file has been saved";
$string ['saveoptions'] = 'save options';
$string ['saving'] = 'Saving';
$string ['scanactivity'] = 'Activity';
$string ['scandirectory'] = 'Directory';
$string ['scanningdir'] = 'Scanning directory ...';
$string ['scanoptions'] = 'Scan options';
$string ['scanother'] = 'Scan similarities in added sources';
$string ['scanzipfile'] = 'Zip file';
$string ['select_all'] = 'Select all';
$string ['server'] = 'Server';
$string ['serverexecutionerror'] = 'Server execution error';
$string ['shortdescription'] = 'Short description';
$string ['shortcuts'] = 'Keyboard shortcuts';
$string ['similarity'] = 'Similarity';
$string ['similarto'] = 'Similar to';
$string ['startdate'] = 'Avaliable from';
$string ['submission'] = 'Submission';
$string ['submissionperiod'] = 'Submission period';
$string ['submissionrestrictions'] = 'Submission restrictions';
$string ['submissions'] = 'Submissions';
$string ['submissionselection'] = 'Submission selection';
$string ['submissionslist'] = 'Submissions list';
$string ['submissionview'] = 'Submission view';
$string ['submittedby'] = 'Submitted by {$a}';
$string ['submittedon'] = 'Submitted on';
$string ['submittedonp'] = 'Submitted on {$a}';
$string ['sureresetfiles'] = 'Do you want to lost all your work and reset the files to its original state?';
$string ['test'] = 'Test activity';
$string ['testcases'] = 'Test cases';
$string ['timelimited'] = 'Time limited';
$string ['timeleft'] = 'Time left';
$string ['timeout'] = 'Timeout';
$string ['timeunlimited'] = 'Time unlimited';
$string ['totalnumberoferrors'] = "Errors";
$string ['undo'] = 'Undo';
$string ['unexpected_file_name'] = "Incorrect file name: expected '{\$a->expected}' and found '{\$a->found}'";
$string ['unzipping'] = 'Unzipping ...';
$string ['uploadfile'] = 'Upload file';
$string ['usevariations'] = 'Use variations';
$string ['usewatermarks'] = 'Use watermarks';
$string ['usewatermarks_description'] = 'Adds watermarks to student\'s files (only to supported languages)';
$string ['variation'] = 'Variation {$a}';
$string ['variation_options'] = 'Variation options';
$string ['variations'] = 'Variations';
$string ['variations_unused'] = 'This activity has variations, but are disabled';
$string ['variationtitle'] = 'Variation title';
$string ['varidentification'] = 'Identification';
$string ['visiblegrade'] = 'Visible';
$string ['vpl:addinstance'] = 'Add new vpl instances';
$string ['vpl:grade'] = 'Grade VPL assignment';
$string ['vpl:manage'] = 'Manage VPL assignment';
$string ['vpl:setjails'] = 'Set execution servers for particular VPL instances';
$string ['vpl:similarity'] = 'Search VPL assignment similarity';
$string ['vpl:submit'] = 'Submit VPL assignment';
$string ['vpl:view'] = 'View full VPL assignment description';
$string ['vpl'] = 'Virtual Programming Lab';
$string ['VPL_COMPILATIONFAILED'] = 'The compilation or preparation of execution has failed';
$string ['vpl_debug.sh'] = 'This script prepares the debugging';
$string ['vpl_evaluate.cases'] = 'Test cases for evaluation';
$string ['vpl_evaluate.sh'] = 'This script prepares the evaluation';
$string ['vpl_run.sh'] = 'This script prepares the execution';
$string ['workingperiods'] = 'Working periods';
$string ['worktype'] = 'Type of work';
$string ['websocket_protocol'] = 'WebSocket protocol';
$string ['websocket_protocol_description'] = 'Type of WebSocket protocol (ws:// or wss://) used by the browser to connect to execution servers.';
$string ['always_use_wss'] = 'Always use encrypted (wss) websocket protocol';
$string ['always_use_ws'] = 'Always use unencrypted (ws) websocket protocol';
$string ['depends_on_https'] = 'Use ws or wss depending on if using http or https';
$string ['check_jail_servers_help'] = "<p>This page check and show the status of execution servers used
for this activity.</p>";
$string ['executionfiles_help'] = '<h2>Introduction</h2>
<p>Here you set the files that are needed to prepare the execution,
debug or assessment of a submission. This includes scripting files,
program test files and data files.</p>
<h2>Default script to run or debug</h2>
<p>If you don\'t set script files for run or debug submissions, the system
will resolve the language you use (based on file name extensions) and use a
predefined script.
<h2>Automatic evaluation</h2>
<p>The incorporates features to facilitate the evaluation of student\'s submissions.
This feature allows to run the student program and check its output for a given input.
To set up the evaluation cases you must populate the file "vpl_evaluate.cases".
<p>The file "vpl_evaluate.cases" has the following format:
<ul>
<li> "<strong>case </strong>= Description of case": Optional. Set an start of test case definition.</li>
<li> "<strong>input </strong>= text": can use several lines. Ends with other instruction.</li>
<li> "<strong>output </strong>= text": can use several lines. Ends with other instruction. A case can have differents correct output. There are three types of output: numbers, text and exact test:
<ul>
<li> <strong>number</strong>: defined as sequence of numbers (integers and floats). Only numbers in the output are checked, other text are ignored. Floats are checked with tolerance</li>
<li> <strong>text</strong>: defined as text without double quote. Only words are checked and the rest of chars are ignored, the comparation is case-insensitive </li>
<li> <strong>exact text</strong>: defined as text into double quote. The exact match is used to test the output.</li>
</ul>
</li>
<li> "<strong>grade reduction</strong> = [value|percentage%]" : By default an error reduces student\'s grade
(starts with maxgrade) by (grade_range/number of cases) but with this instruction you can change
the reduction value or percentage.</li>
</ul>
</p>
<h2>General use</h2>
<p>A new file can be added by writing its name in the box "<b>Add file</b>"
and then clicking on the button "<b>Add file</b>".</p>
<p>An existing file can be uploaded by means of the "<b>Upload file</b>".<p>All the added or uploaded files can
be edited, and all of them, except the three scripting files mentioned
below, can be renamed or deleted.</p>
<h2>Manual run, execute or evaluation</h2>
<p>Three scripting files to prepare each of the actions may be set.
These files have predefined names: <b>vpl_run.sh</b> (execution),
<b>vpl_debug.sh</b> (debug) and <b>vpl_evaluate.sh</b> (assessment).</p>
<p>The execution of any of those scripting files should generate a
file named <b>vpl_execution</b>.
This file must be a binary executable or a script beginning with "#!/bin/sh ".
The non-generation of this file impedes to run the selected action.</p>
<p>If the activity that you are configuring is "based on" other activity,
the files of the base activity are added automatically.
The contents of the vpl_run.sh, vpl_debug.sh and vpl_evaluate.sh files
are concatenated from the deepest level of "based on" to the current.</P>
<p>Finally, the file <b>vpl_environment.sh</b> is automatically added.
This scripting file contain information about the submission.
The information come as environment variables: </p>
<ul> <li> LANG: used language. </li>
<li> LC_ALL: same value as LANG. </li>
<li> VPL_MAXTIME: maximum execution time in seconds. </li>
<li> VPL_FILEBASEURL: URL to access the files of the course. </li>
<li> VPL_SUBFILE#: each name of the files submitted by the student. # Ranges from 0 to number of submitted files. </Li>
<li> VPL_SUBFILES: list of all submitted files. </li>
<li> VPL_VARIATION + id: where id is the variation order starting with 0 and the value is the value of the variation. </li>
</ul>
If the action requested is evaluation, then the following vars are added too.
<ul>
<li>VPL_MAXTIME: max time of execution in seconds.</li>
<li>VPL_MAXMEMORY: max memmory usable</li>
<li>VPL_MAXFILESIZE: max file size in byte that can be create.</li>
<li>VPL_MAXPROCESSES: max number of procceses that can be run simultaneous.</li>
<Li>VPL_FILEBASEURL: URL to the course files.</Li>
<li>VPL_GRADEMIN: Min grade for this activity</li>
<li>VPL_GRADEMAX: Max grade for this activity</li>
</ul>
<h2>Assessment result</h2>
<p>Evaluation output is processed to extract, if possible, comments and a proposed grade for the assessment.
Comments can be set in two ways: with a line comment defined by a line beginning with \'Comment :=>>\' or
with block comments starting with a line containing only \'<|--\' and ending with a line containing only \'--|>\'.
The grade is taken from the last line that begins with \'Grade :=>>\'.
</p>';
$string ['executionoptions_help'] = '<p>Various execution options are set in this page</p>
<ul>
<li><b>Based on</b>: sets other VPL instance from which some features are imported:
<ul><li>Execution files (concatenating the predefined scripting files)</li>
<li>Limits for the execution resources.</li>
<li>Variations, that are concatenating to generate multivariations.</li>
<li>Maximun length for each file to be uploaded with the submission</li>
</ul>
</li>
<li><b>Run</b>, <b>Debug</b> and <b>Evalaute</b>: must be set to \'Yes\' if the corresponding action can be executed when editing the submission. This affects to the students only, users with capability of grading can always execute these actions.</li>
<li><b>Evaluate just on submission</b>: the submission is evaluated automatically when it is uploaded.</li>
<li><b>Automatic grading</b>: if the evaluation result includes grading codes, they are used to set the grade automatically.</li>
</ul>';
$string ['fulldescription_help'] = '<p>You must write here a full description for the activity.</p>
<p>If you don\'t write anything here, the short description is shown instead.</p>
<p>If you want to evaluate automatically, the interfaces for the assignments must be detailed and non-ambiguous.</p>';
$string ['keepfiles_help'] = '<p>Due to security issues, the files added as "Execution files" are deleted before running the file vpl_execution.</p>
If any of those files is needed during the execution (by example, to be used as test data), it must be marked here.';
$string ['local_jail_servers_help'] = '<p>Here you can set the local execution servers added for this activity and those
that are based on it.</p>
<p>Enter the full URL of a server on each line. You can use blank lines
and comments starting the line with "#".</p>
<p>This activity will use as execution server list: the servers sets here
plus the server list set in the "based on" activity
plus the list of common execution servers.
If you want to prevent this activity and derived ones
from using other servers, then you have to add a line
containing "end_of_jails" at the end of the server list.
</p>';
$string ['modulename_help'] = '<p>VPL is a activity module for Moodle that manage programming assignments and whose salient features are:
</p>
<ul>
<li>Enable to edit the programs source code in the browser</li>
<li>Students can run interactively programs in the browser</li>
<li>You can run tests to review the programs.</li>
<li>Allows searching for similarity between files.</li>
<li>Allows setting editing restrictions and avoiding external text pasting.</li>
</ul>
<p><a href="http://vpl.dis.ulpgc.es">Virtual Programming lab Home Page</a></p>';
$string ['modulename_link'] = 'mod/vpl/view';
$string ['requestedfiles_help'] = '<p>Here you set names and its initial content up for the requested files to the max number of files that was set in the basic description of the activity.</p>
<p>If you don\'t set names for whole number of files, the unnamed files are optional and can have any name.</p>
<p>You also can add contents to the requested files, so these contents will be available the first time that they will be opened with the editor, if no previous submission exists.</p>';
$string ['resourcelimits_help'] = '<p>You can set limits for the execution time, the memory used, the execution files sizes and the number of processes to be executed simultaneously.</p>
<p>These limits are used when running the scripting files vpl_run.sh, vpl_debug.sh and vpl_evaluate.sh and the file vpl_execution built by them.</p>
<p>If this activity is based on other activity, the limits can be affected by those set in the base activity and its ancestors or in the global configuration of the module.</p>';
$string ['testcases_help'] = '<p>This feature allows to run the student program and check its output for a given input. To set up the evaluation cases you must populate the file "vpl_evaluate.cases".</p>
<p>The file "vpl_evaluate.cases" has the following format:
<ul>
<li> "<strong>case </strong>= Description of case": Optional. Set an start of test case definition.</li>
<li> "<strong>input </strong>= text": can use several lines. Ends with other instruction.</li>
<li> "<strong>output </strong>= text": can use several lines. Ends with other instruction. A case can have differents correct output. There are three types of output: numbers, text and exact test:
<ul>
<li> <strong>number</strong>: defined as sequence of numbers (integers and floats). Only numbers in the output are checked, other text are ignored. Floats are checked with tolerance</li>
<li> <strong>text</strong>: defined as text without double quote. Only words are checked and the rest of chars are ignored, the comparation is case-insensitive </li>
<li> <strong>exact text</strong>: defined as text into double quote. The exact match is used to test the output.</li>
</ul>
</li>
<li> "<strong>grade reduction</strong> = [value|percentage%]" : By default an error reduces student\'s grade (starts with maxgrade) by (grade_range/number of cases) but with this instruction
you can change the reduction value or percentage.</li>
</ul>';
$string ['variations_help'] = '<p>A set of variations can be defined for an activity. These variations are randomly assigned to the students.</p>
<p>Here you can indicate if this activity has variations, put a title for the set of variations, and to add the desired variations.</p>
<p>Each variation has an identification code and a description. The identification code is used by the <b>vpl_enviroment.sh</b> file to pass
the variation assigned to each student to the script files. The description, formatted in HTML, is shown to the students that have assigned
the corresponding variation.</p>';
|
gpl-3.0
|
cjkirk09/ourBzrflag
|
bzagents/show_field.py
|
3190
|
#!/usr/bin/env python
"""
README
This should get some of the boilerplate out of the way for you in visualizing
your potential fields.
Notably absent from this code is anything dealing with vectors, the
interaction of mutliple fields, etc. Your code will be a lot easier if you
define your potential fields in terms of vectors (angle, magnitude). For
plotting, however, you'll need to turn them back into dx and dy.
"""
import matplotlib.pyplot as plt
from pylab import *
import math
import random
from math import atan2, cos, sin, sqrt, pi
from bzrc import Answer
##### PLOTTING FUNCTIONS #####
def show_obstacle(plot, points):
"""Draw a polygon. Points is a list of [x,y] tuples
"""
for p1, p2 in zip(points, [points[-1]] + list(points)):
plot.plot([p1[0], p2[0]], [p1[1], p2[1]], 'b')
def show_arrows(plot, potential_func, obstacles, xlim=(-400, 400), ylim=(-400, 400), res=20):
"""
Arguments:
fns: a list of potential field functions
xlim, ylim: the limits of the plot
res: resolution for (spacing between) arrows
"""
plot.set_xlim(xlim)
plot.set_ylim(ylim)
for x in range(xlim[0], xlim[1] + res, res):
for y in range(ylim[0], ylim[1] + res, res):
tank = Answer()
tank.x = x
tank.y = y
tank.index = 1
tank.goal = "-"
dx, dy = potential_func(tank, obstacles)
if dx + dy == 0: continue
plot.arrow(x, y, dx, dy, head_width=res/7.0, color='red', linewidth=.3)
def plot_single(potential_func, obstacles, filename, xlim=(-400, 400), ylim=(-400, 400)):
"""Plot a potential function and some obstacles, and write the resulting
image to a file"""
print "Generating", filename
fig = plt.figure()
plot = plt.subplot(111)
show_arrows(plot, potential_func, obstacles, xlim=xlim, ylim=ylim)
for obstacle in obstacles:
show_obstacle(plot, obstacle.get_corners())
fig.savefig(filename, format='png')
#### TRIVIAL EXAMPLE FUNCTIONS ####
def random_field(x, y, res):
"""
NOTE: Your potential field calculator should probably work in vectors
(angle, magnitude), but you need to return dx, dy for plotting.
Arguments:
x: the x position for which to calculate the potential field
y: the y position for which to calculate the potential field
res: current plotting resolution (helpful for scaling down your
vectors for display, so they don't all overlap each other)
Returns:
dx, dy: the change in x and y for the arrow to point.
"""
return random.randint(-res, res), random.randint(-res, res)
def unidirectional(x, y, res):
"""Another simple example"""
return res, res/2
def bidirectional(x, y, res):
if x > 0:
return res, res/2
else:
return -res, res/2
def main():
triangle = ((0, 0), (100, 100), (-100, 50))
plot_single(random_field, [triangle], 'random.png')
plot_single(unidirectional, [triangle], 'unidirectional.png')
plot_single(bidirectional, [triangle], 'bidirectional.png')
if __name__ == '__main__':
main()
# vim: et sw=4 sts=4
|
gpl-3.0
|
NathanKell/Ferram-Aerospace-Research
|
FerramAerospaceResearch/LEGACYferram4/FARControllableSurface.cs
|
36646
|
/*
Ferram Aerospace Research v0.15.6.3 "Kindelberger"
=========================
Aerodynamics model for Kerbal Space Program
Copyright 2015, Michael Ferrara, aka Ferram4
This file is part of Ferram Aerospace Research.
Ferram Aerospace Research is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Ferram Aerospace Research is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Ferram Aerospace Research. If not, see <http://www.gnu.org/licenses/>.
Serious thanks: a.g., for tons of bugfixes and code-refactorings
stupid_chris, for the RealChuteLite implementation
Taverius, for correcting a ton of incorrect values
Tetryds, for finding lots of bugs and issues and not letting me get away with them, and work on example crafts
sarbian, for refactoring code for working with MechJeb, and the Module Manager updates
ialdabaoth (who is awesome), who originally created Module Manager
Regex, for adding RPM support
DaMichel, for some ferramGraph updates and some control surface-related features
Duxwing, for copy editing the readme
CompatibilityChecker by Majiir, BSD 2-clause http://opensource.org/licenses/BSD-2-Clause
Part.cfg changes powered by sarbian & ialdabaoth's ModuleManager plugin; used with permission
http://forum.kerbalspaceprogram.com/threads/55219
ModularFLightIntegrator by Sarbian, Starwaster and Ferram4, MIT: http://opensource.org/licenses/MIT
http://forum.kerbalspaceprogram.com/threads/118088
Toolbar integration powered by blizzy78's Toolbar plugin; used with permission
http://forum.kerbalspaceprogram.com/threads/60863
*/
using System;
using System.Collections.Generic;
using UnityEngine;
using KSP;
using FerramAerospaceResearch;
namespace ferram4
{
public class FARControllableSurface : FARWingAerodynamicModel, ILiftProvider, ITorqueProvider
{
protected Transform movableSection = null;
protected Transform MovableSection
{
get
{
if (movableSection == null)
{
movableSection = part.FindModelTransform(transformName); //And the transform
if (!MovableOrigReady)
{
// In parts copied by symmetry, these fields should already be set,
// while the transform may not be in the original orientation anymore.
MovableOrig = movableSection.localRotation; //Its original orientation
MovableOrigReady = true;
}
if (Vector3.Dot(MovableSection.right, part.partTransform.right) > 0)
flipAxis = false;
else
flipAxis = true;
}
return movableSection;
}
}
private bool flipAxis = false;
[KSPField(isPersistant = false)]
public Vector3 controlSurfacePivot = new Vector3(1f, 0f, 0f);
[KSPField(isPersistant = false)]
public float ctrlSurfFrac = 1;
private float invCtrlSurfFrac = 1;
[KSPField(isPersistant = false)]
public string transformName = "obj_ctrlSrf";
// These TWO fields MUST be set up so that they are copied by Object.Instantiate.
// Otherwise detaching and re-attaching wings with deflected flaps etc breaks until save/load.
[SerializeField]
protected Quaternion MovableOrig = Quaternion.identity;
[SerializeField]
private bool MovableOrigReady = false;
// protected int MovableSectionFlip = 1;
[KSPField(guiName = "Std. Ctrl", guiActiveEditor = true, guiActive = true), UI_Toggle(affectSymCounterparts = UI_Scene.All, scene = UI_Scene.All, disabledText = "Settings", enabledText = "Settings")]
bool showStdCtrl = false;
bool prevStdCtrl = true;
[KSPField(guiName = "Pitch %", isPersistant = true, guiActiveEditor = false, guiActive = false), UI_FloatRange(affectSymCounterparts = UI_Scene.All, maxValue = 100.0f, minValue = -100f, scene = UI_Scene.All, stepIncrement = 5f)]
public float pitchaxis = 100.0f;
[KSPField(guiName = "Yaw %", isPersistant = true, guiActiveEditor = false, guiActive = false), UI_FloatRange(affectSymCounterparts = UI_Scene.All, maxValue = 100.0f, minValue = -100f, scene = UI_Scene.All, stepIncrement = 5f)]
public float yawaxis = 100.0f;
[KSPField(guiName = "Roll %", isPersistant = true, guiActiveEditor = false, guiActive = false), UI_FloatRange(affectSymCounterparts = UI_Scene.All, maxValue = 100.0f, minValue = -100f, scene = UI_Scene.All, stepIncrement = 5f)]
public float rollaxis = 100.0f;
[KSPField(guiName = "AoA %", isPersistant = true, guiActiveEditor = false, guiActive = false), UI_FloatRange(affectSymCounterparts = UI_Scene.All, maxValue = 200.0f, minValue = -200f, scene = UI_Scene.All, stepIncrement = 5f)]
public float pitchaxisDueToAoA = 0.0f;
[KSPField(guiName = "BrakeRudder %", isPersistant = true, guiActiveEditor = false, guiActive = false), UI_FloatRange(affectSymCounterparts = UI_Scene.All, maxValue = 100.0f, minValue = -100f, scene = UI_Scene.All, stepIncrement = 5f)]
public float brakeRudder = 0.0f;
[KSPField(guiName = "Ctrl Dflct", guiActiveEditor = false, isPersistant = true), UI_FloatRange(affectSymCounterparts = UI_Scene.All, maxValue = 40, minValue = -40, scene = UI_Scene.All, stepIncrement = 0.5f)]
public float maxdeflect = 15;
[KSPField(guiName = "Flp/splr", guiActiveEditor = true, guiActive = true), UI_Toggle(affectSymCounterparts = UI_Scene.All, scene = UI_Scene.All, disabledText = "Settings", enabledText = "Settings")]
bool showFlpCtrl = false;
bool prevFlpCtrl = true;
[KSPField(guiName = "Flap", isPersistant = true, guiActiveEditor = false, guiActive = false), UI_Toggle(affectSymCounterparts = UI_Scene.All, enabledText = "Active", scene = UI_Scene.All, disabledText = "Inactive")]
public bool isFlap;
bool prevIsFlap;
[KSPField(guiName = "Spoiler", isPersistant = true, guiActiveEditor = false, guiActive = false), UI_Toggle(affectSymCounterparts = UI_Scene.All, enabledText = "Active", scene = UI_Scene.All, disabledText = "Inactive")]
public bool isSpoiler;
bool prevIsSpoiler;
[KSPField(isPersistant = true, guiName = "Flap setting")]
public int flapDeflectionLevel = 2;
[KSPField(guiName = "Flp/splr Dflct", guiActiveEditor = false, isPersistant = true), UI_FloatRange(affectSymCounterparts = UI_Scene.All, maxValue = 85, minValue = -85, scene = UI_Scene.All, stepIncrement = 0.5f)]
public float maxdeflectFlap = 15;
protected double PitchLocation = 0;
protected double YawLocation = 0;
protected double RollLocation = 0;
protected double BrakeRudderLocation = 0;
protected double BrakeRudderSide = 0;
protected int flapLocation = 0;
protected int spoilerLocation = 0;
private double AoAsign = 1;
private double AoAdesiredControl = 0; //DaMichel: treat desired AoA's from flap and stick inputs separately for different animation rates
private double AoAdesiredFlap = 0;
private double AoAcurrentControl = 0; // current deflection due to control inputs
private double AoAcurrentFlap = 0; // current deflection due to flap/spoiler deployment
private double AoAoffset = 0; // total current deflection
private double lastAoAoffset = 0;
private Vector3d deflectedNormal = Vector3d.forward;
public static double timeConstant = 0.25;
public static double timeConstantFlap = 10;
public static double timeConstantSpoiler = 0.75;
public bool brake = false;
private bool justStarted = false;
private Transform lastReferenceTransform = null;
[FARAction("Activate Spoiler", FARActionGroupConfiguration.ID_SPOILER)] // use our new FARAction for configurable action group assignemnt
public void ActivateSpoiler(KSPActionParam param)
{
brake = !(param.type > 0);
}
[FARAction("Increase Flap Deflection", FARActionGroupConfiguration.ID_INCREASE_FLAP_DEFLECTION)] // use our new FARAction for configurable action group assignemnt
public void IncreaseDeflect(KSPActionParam param)
{
param.Cooldown = 0.25f;
SetDeflection(flapDeflectionLevel + 1);
}
[KSPEvent(name = "DeflectMore", active = false, guiActive = true, guiName = "Deflect more")]
public void DeflectMore()
{
SetDeflection(flapDeflectionLevel + 1);
UpdateFlapDeflect();
}
[FARAction("Decrease Flap Deflection", FARActionGroupConfiguration.ID_DECREASE_FLAP_DEFLECTION)] // use our new FARAction for configurable action group assignemnt
public void DecreaseDeflect(KSPActionParam param)
{
param.Cooldown = 0.25f;
SetDeflection(flapDeflectionLevel - 1);
}
[KSPEvent(name = "DeflectLess", active = false, guiActive = true, guiName = "Deflect less")]
public void DeflectLess()
{
SetDeflection(flapDeflectionLevel - 1);
UpdateFlapDeflect();
}
private void UpdateFlapDeflect()
{
for (int i = 0; i < part.symmetryCounterparts.Count; i++)
{
Part p = part.symmetryCounterparts[i];
for (int j = 0; j < p.Modules.Count; j++)
{
PartModule m = p.Modules[j];
if (m is FARControllableSurface)
(m as FARControllableSurface).SetDeflection(this.flapDeflectionLevel);
}
}
}
//[KSPEvent(guiName = "Std. Ctrl Settings", guiActiveEditor = true, guiActive = false)]
void CheckFieldVisibility()
{
if (showStdCtrl != prevStdCtrl)
{
Fields["pitchaxis"].guiActiveEditor = showStdCtrl;
Fields["yawaxis"].guiActiveEditor = showStdCtrl;
Fields["rollaxis"].guiActiveEditor = showStdCtrl;
Fields["pitchaxisDueToAoA"].guiActiveEditor = showStdCtrl;
Fields["brakeRudder"].guiActiveEditor = showStdCtrl;
Fields["maxdeflect"].guiActiveEditor = showStdCtrl;
Fields["pitchaxis"].guiActive = showStdCtrl;
Fields["yawaxis"].guiActive = showStdCtrl;
Fields["rollaxis"].guiActive = showStdCtrl;
Fields["pitchaxisDueToAoA"].guiActive = showStdCtrl;
Fields["brakeRudder"].guiActive = showStdCtrl;
Fields["maxdeflect"].guiActive = showStdCtrl;
prevStdCtrl = showStdCtrl;
}
if (showFlpCtrl != prevFlpCtrl)
{
Fields["isFlap"].guiActiveEditor = showFlpCtrl;
Fields["isSpoiler"].guiActiveEditor = showFlpCtrl;
Fields["maxdeflectFlap"].guiActiveEditor = showFlpCtrl;
Fields["isFlap"].guiActive = showFlpCtrl;
Fields["isSpoiler"].guiActive = showFlpCtrl;
Fields["maxdeflectFlap"].guiActive = showFlpCtrl;
prevFlpCtrl = showFlpCtrl;
}
if(isFlap != prevIsFlap)
{
prevIsFlap = isFlap;
isSpoiler = false;
prevIsSpoiler = false;
UpdateEvents();
}
if(isSpoiler != prevIsSpoiler)
{
prevIsSpoiler = isSpoiler;
isFlap = false;
prevIsFlap = false;
UpdateEvents();
}
}
public void SetDeflection(int newstate)
{
flapDeflectionLevel = Math.Max(0, Math.Min(3, newstate));
UpdateEvents();
}
public void UpdateEvents()
{
Fields["flapDeflectionLevel"].guiActive = isFlap;
Events["DeflectMore"].active = isFlap && flapDeflectionLevel < 3;
Events["DeflectLess"].active = isFlap && flapDeflectionLevel > 0;
if (!isFlap)
flapDeflectionLevel = 0;
}
public override void Initialization()
{
base.Initialization();
if (part.Modules.GetModule<ModuleControlSurface>())
{
part.RemoveModule(part.Modules.GetModule<ModuleControlSurface>());
}
OnVesselPartsChange += CalculateSurfaceFunctions;
UpdateEvents();
prevIsFlap = isFlap;
prevIsSpoiler = isSpoiler;
if (!isFlap)
flapDeflectionLevel = 0;
justStarted = true;
if(vessel)
lastReferenceTransform = vessel.ReferenceTransform;
invCtrlSurfFrac = 1 / ctrlSurfFrac;
if (FARDebugValues.allowStructuralFailures)
{
FARPartStressTemplate template;
foreach (FARPartStressTemplate temp in FARAeroStress.StressTemplates)
if (temp.name == "ctrlSurfStress")
{
template = temp;
double maxForceMult = Math.Pow(massMultiplier, FARAeroUtil.massStressPower);
YmaxForce *= 1 - ctrlSurfFrac;
XZmaxForce *= 1 - ctrlSurfFrac;
double tmp = template.YmaxStress; //in MPa
tmp *= S * ctrlSurfFrac * maxForceMult;
YmaxForce += tmp;
tmp = template.XZmaxStress; //in MPa
tmp *= S * ctrlSurfFrac * maxForceMult;
XZmaxForce += tmp;
break;
}
}
//if (HighLogic.LoadedSceneIsEditor) //should be unneeded now
// FixAllUIRanges();
}
public override void FixedUpdate()
{
if (justStarted)
CalculateSurfaceFunctions();
if (HighLogic.LoadedSceneIsFlight && (object)part != null && (object)vessel != null)
{
bool process = part.isControllable || (justStarted && isFlap);
if (process && (object)MovableSection != null && part.Rigidbody)
{
// Set member vars for desired AoA
if (isSpoiler)
AoAOffsetFromSpoilerDeflection();
else
AoAOffsetFromFlapDeflection();
AoAOffsetFromControl();
//DaMichel: put deflection change here so that AoAOffsetFromControlInput does only the thing which the name suggests
ChangeDeflection();
DeflectionAnimation();
}
}
CheckFieldVisibility();
base.FixedUpdate();
justStarted = false;
if(vessel && vessel.ReferenceTransform != lastReferenceTransform)
{
justStarted = true;
lastReferenceTransform = vessel.ReferenceTransform;
}
}
void CheckShielded()
{
if (NUFAR_areaExposedFactor < 0.1 * S && NUFAR_totalExposedAreaFactor != 0)
{
if (Math.Abs(AoAoffset) > 5)
isShielded = false;
else
isShielded = true;
}
}
#region Deflection
public void CalculateSurfaceFunctions()
{
if (HighLogic.LoadedSceneIsEditor && (!FlightGlobals.ready || (object)vessel == null || (object)part.partTransform == null))
return;
if (part.symMethod == SymmetryMethod.Mirror || part.symmetryCounterparts.Count < 1)
{
if (HighLogic.LoadedSceneIsFlight)
flapLocation = Math.Sign(Vector3.Dot(vessel.ReferenceTransform.forward, part.partTransform.forward)); //figure out which way is up
else
flapLocation = Math.Sign(Vector3.Dot(EditorLogic.RootPart.partTransform.forward, part.partTransform.forward)); //figure out which way is up
spoilerLocation = -flapLocation;
}
else if (part.parent != null)
{
flapLocation = Math.Sign(Vector3.Dot(part.partTransform.position - part.parent.partTransform.position, part.partTransform.forward));
spoilerLocation = flapLocation;
}
else
{
flapLocation = 1;
spoilerLocation = flapLocation;
}
Vector3 CoM = Vector3.zero;
float mass = 0;
for (int i = 0; i < VesselPartList.Count; i++)
{
Part p = VesselPartList[i];
CoM += p.transform.position * p.mass;
mass += p.mass;
}
CoM /= mass;
if (HighLogic.LoadedSceneIsEditor && (isFlap || isSpoiler))
SetControlStateEditor(CoM, part.partTransform.up, 0, 0, 0, 0, false);
float roll2 = 0;
if (HighLogic.LoadedSceneIsEditor)
{
Vector3 CoMoffset = (part.partTransform.position - CoM).normalized;
PitchLocation = Vector3.Dot(part.partTransform.forward, EditorLogic.RootPart.partTransform.forward) * Math.Sign(Vector3.Dot(CoMoffset, EditorLogic.RootPart.partTransform.up));
YawLocation = -Vector3.Dot(part.partTransform.forward, EditorLogic.RootPart.partTransform.right) * Math.Sign(Vector3.Dot(CoMoffset, EditorLogic.RootPart.partTransform.up));
RollLocation = Vector3.Dot(part.partTransform.forward, EditorLogic.RootPart.partTransform.forward) * Math.Sign(Vector3.Dot(CoMoffset, -EditorLogic.RootPart.partTransform.right));
roll2 = Vector3.Dot(part.partTransform.forward, EditorLogic.RootPart.partTransform.right) * Math.Sign(Vector3.Dot(CoMoffset, EditorLogic.RootPart.partTransform.forward));
BrakeRudderLocation = Vector3.Dot(part.partTransform.forward, EditorLogic.RootPart.partTransform.forward);
BrakeRudderSide = Math.Sign(Vector3.Dot(CoMoffset, EditorLogic.RootPart.partTransform.right));
AoAsign = Math.Sign(Vector3.Dot(part.partTransform.up, EditorLogic.RootPart.partTransform.up));
}
else
{
//Figures out where the ctrl surface is; this must be done after physics starts to get vessel COM
Vector3 CoMoffset = (part.partTransform.position - CoM).normalized;
PitchLocation = Vector3.Dot(part.partTransform.forward, vessel.ReferenceTransform.forward) * Math.Sign(Vector3.Dot(CoMoffset, vessel.ReferenceTransform.up));
YawLocation = -Vector3.Dot(part.partTransform.forward, vessel.ReferenceTransform.right) * Math.Sign(Vector3.Dot(CoMoffset, vessel.ReferenceTransform.up));
RollLocation = Vector3.Dot(part.partTransform.forward, vessel.ReferenceTransform.forward) * Math.Sign(Vector3.Dot(CoMoffset, -vessel.ReferenceTransform.right));
roll2 = Vector3.Dot(part.partTransform.forward, vessel.ReferenceTransform.right) * Math.Sign(Vector3.Dot(CoMoffset, vessel.ReferenceTransform.forward));
BrakeRudderLocation = Vector3.Dot(part.partTransform.forward, vessel.ReferenceTransform.forward);
BrakeRudderSide = Mathf.Sign(Vector3.Dot(CoMoffset, vessel.ReferenceTransform.right));
AoAsign = Math.Sign(Vector3.Dot(part.partTransform.up, vessel.ReferenceTransform.up));
}
//PitchLocation *= PitchLocation * Mathf.Sign(PitchLocation);
//YawLocation *= YawLocation * Mathf.Sign(YawLocation);
//RollLocation = RollLocation * RollLocation * Mathf.Sign(RollLocation) + roll2 * roll2 * Mathf.Sign(roll2);
RollLocation += roll2;
//DaMichel: this is important to force a reset of the flap/spoiler model orientation to the desired value.
// What apparently happens on loading a new flight scene is that first the model (obj_ctrlSrf)
// orientation is set correctly by DeflectionAnimation(). But then the orientations is mysteriously
// zeroed-out. And this definitely doesn't happen in this module. However OnVesselPartsChange
// subscribers are called afterwards, so we have a chance to fix the broken orientation state.
lastAoAoffset = double.MaxValue;
}
private void AoAOffsetFromSpoilerDeflection()
{
if (brake)
AoAdesiredFlap = maxdeflectFlap * spoilerLocation;
else
AoAdesiredFlap = 0;
AoAdesiredFlap = FARMathUtil.Clamp(AoAdesiredFlap, -Math.Abs(maxdeflectFlap), Math.Abs(maxdeflectFlap));
}
private void AoAOffsetFromFlapDeflection()
{
AoAdesiredFlap = maxdeflectFlap * flapLocation * flapDeflectionLevel * 0.33333333333;
AoAdesiredFlap = FARMathUtil.Clamp(AoAdesiredFlap, -Math.Abs(maxdeflectFlap), Math.Abs(maxdeflectFlap));
}
private void AoAOffsetFromControl()
{
AoAdesiredControl = 0;
if ((object)vessel != null && vessel.atmDensity > 0)
{
if (pitchaxis != 0.0)
{
AoAdesiredControl += PitchLocation * vessel.ctrlState.pitch * pitchaxis * 0.01;
}
if (yawaxis != 0.0)
{
AoAdesiredControl += YawLocation * vessel.ctrlState.yaw * yawaxis * 0.01;
}
if (rollaxis != 0.0)
{
AoAdesiredControl += RollLocation * vessel.ctrlState.roll * rollaxis * 0.01;
}
if (brakeRudder != 0.0)
{
AoAdesiredControl += BrakeRudderLocation * Math.Max(0.0, BrakeRudderSide * vessel.ctrlState.yaw) * brakeRudder * 0.01;
}
AoAdesiredControl *= maxdeflect;
if (pitchaxisDueToAoA != 0.0)
{
Vector3d vel = this.GetVelocity();
double velMag = vel.magnitude;
if (velMag > 5)
{
//Vector3 tmpVec = vessel.ReferenceTransform.up * Vector3.Dot(vessel.ReferenceTransform.up, vel) + vessel.ReferenceTransform.forward * Vector3.Dot(vessel.ReferenceTransform.forward, vel); //velocity vector projected onto a plane that divides the airplane into left and right halves
//double AoA = Vector3.Dot(tmpVec.normalized, vessel.ReferenceTransform.forward);
double AoA = base.CalculateAoA(vel); //using base.CalculateAoA gets the deflection using WingAeroModel's code, which does not account for deflection; this gives us the AoA that the surface _would_ be at if it hadn't deflected at all.
AoA = FARMathUtil.rad2deg * AoA;
if (double.IsNaN(AoA))
AoA = 0;
AoAdesiredControl += AoA * pitchaxisDueToAoA * 0.01;
}
}
AoAdesiredControl *= AoAsign;
AoAdesiredControl = FARMathUtil.Clamp(AoAdesiredControl, -Math.Abs(maxdeflect), Math.Abs(maxdeflect));
}
}
public override double CalculateAoA(Vector3d velocity)
{
// Use the vector computed by DeflectionAnimation
Vector3d perp = part_transform.TransformDirection(deflectedNormal);
double PerpVelocity = Vector3d.Dot(perp, velocity.normalized);
return Math.Asin(FARMathUtil.Clamp(PerpVelocity, -1, 1));
}
// Had to add this one since the parent class don't use AoAoffset and adding it would break GetWingInFrontOf
public double CalculateAoA(Vector3d velocity, double AoAoffset)
{
double radAoAoffset = AoAoffset * FARMathUtil.deg2rad * ctrlSurfFrac;
Vector3 perp = part_transform.TransformDirection(new Vector3d(0, Math.Sin(radAoAoffset), Math.Cos(radAoAoffset)));
double PerpVelocity = Vector3d.Dot(perp, velocity.normalized);
return Math.Asin(FARMathUtil.Clamp(PerpVelocity, -1, 1));
}
//DaMichel: Factored the time evolution for deflection AoA into this function. This one results into an exponential asympotic
//"decay" towards the desired value. Good for stick inputs, i suppose, and the original method.
private static double BlendDeflectionExp(double current, double desired, double timeConstant, bool forceSetToDesired)
{
double error = desired - current;
if (!forceSetToDesired && Math.Abs(error) >= 0.1) // DaMichel: i changed the threshold since i noticed a "bump" at max deflection
{
double recip_timeconstant = 1 / timeConstant;
double tmp1 = error * recip_timeconstant;
current += FARMathUtil.Clamp((double)TimeWarp.fixedDeltaTime * tmp1, -Math.Abs(0.6 * error), Math.Abs(0.6 * error));
}
else
current = desired;
return current;
}
//DaMichel: Similarly, this is used for constant rate movment towards the desired value. I presume it is more realistic for
//for slow moving flaps and spoilers. It looks better anyways.
//ferram4: The time constant specifies the time it would take for a first-order system to reach its steady-state value,
//assuming that it was proportional to only the initial error, not the error as a function of time
private static double BlendDeflectionLinear(double current, double desired, double maximumDeflection, double timeConstant, bool forceSetToDesired)
{
double error = desired - current;
if (!forceSetToDesired && Math.Abs(error) >= 0.1)
{
double degreesPerSecond = Math.Max(Math.Abs(maximumDeflection), Math.Abs(current)) / timeConstant;
double tmp = current + (double)TimeWarp.fixedDeltaTime * degreesPerSecond * Math.Sign(desired - current);
if(error > 0)
current = FARMathUtil.Clamp(tmp, current, desired);
else
current = FARMathUtil.Clamp(tmp, desired, current);
}
else
return desired;
return current;
}
// Determines current deflection contributions from stick and flap/spoiler settings and update current total deflection (AoAoffset).
private void ChangeDeflection()
{
if (AoAcurrentControl != AoAdesiredControl)
AoAcurrentControl = BlendDeflectionExp(AoAcurrentControl, AoAdesiredControl, timeConstant, justStarted);
if (AoAcurrentFlap != AoAdesiredFlap)
AoAcurrentFlap = BlendDeflectionLinear(AoAcurrentFlap, AoAdesiredFlap, maxdeflectFlap, isSpoiler ? timeConstantSpoiler : timeConstantFlap, justStarted);
AoAoffset = AoAcurrentFlap + AoAcurrentControl;
}
/// <summary>
/// This animates a deflection based on AoAoffset
/// </summary>
protected void DeflectionAnimation()
{
// Don't recalculate on insignificant variations
if (Math.Abs(lastAoAoffset - AoAoffset) < 0.01)
return;
lastAoAoffset = AoAoffset;
// Compute a vector for CalculateAoA
double radAoAoffset = AoAoffset * FARMathUtil.deg2rad * ctrlSurfFrac;
deflectedNormal.y = Math.Sin(radAoAoffset);
double tmp = 1 - deflectedNormal.y * deflectedNormal.y;
if (tmp < 0)
tmp = 0;
deflectedNormal.z = Math.Sqrt(tmp);
// Visually animate the surface
MovableSection.localRotation = MovableOrig;
if (AoAoffset != 0)
{
Quaternion localRot;
if (flipAxis)
localRot = Quaternion.FromToRotation(deflectedNormal, new Vector3(0, 0, 1));
else
localRot = Quaternion.FromToRotation(new Vector3(0, 0, 1), deflectedNormal);
MovableSection.localRotation *= localRot;
}
CheckShielded();
}
public void SetControlStateEditor(Vector3 CoM, Vector3 velocityVec, float pitch, float yaw, float roll, int flap, bool brake)
{
if (HighLogic.LoadedSceneIsEditor)
{
Transform partTransform = part.partTransform;
Transform rootTransform = EditorLogic.RootPart.partTransform;
Vector3 CoMoffset = (partTransform.position - CoM);
PitchLocation = Vector3.Dot(partTransform.forward, rootTransform.forward) * Math.Sign(Vector3.Dot(CoMoffset, rootTransform.up));
YawLocation = -Vector3.Dot(partTransform.forward, rootTransform.right) * Math.Sign(Vector3.Dot(CoMoffset, rootTransform.up));
RollLocation = Vector3.Dot(partTransform.forward, rootTransform.forward) * Math.Sign(Vector3.Dot(CoMoffset, -rootTransform.right));
BrakeRudderLocation = Vector3.Dot(partTransform.forward, rootTransform.forward);
BrakeRudderSide = Mathf.Sign(Vector3.Dot(CoMoffset, rootTransform.right));
AoAsign = Math.Sign(Vector3.Dot(partTransform.up, rootTransform.up));
AoAdesiredControl = 0;
if (pitchaxis != 0.0)
{
AoAdesiredControl += PitchLocation * pitch * pitchaxis * 0.01;
}
if (yawaxis != 0.0)
{
AoAdesiredControl += YawLocation * yaw * yawaxis * 0.01;
}
if (rollaxis != 0.0)
{
AoAdesiredControl += RollLocation * roll * rollaxis * 0.01;
}
if (brakeRudder != 0.0)
{
AoAdesiredControl += BrakeRudderLocation * Math.Max(0.0, BrakeRudderSide * yawaxis) * brakeRudder * 0.01;
}
AoAdesiredControl *= maxdeflect;
if (pitchaxisDueToAoA != 0.0)
{
Vector3 tmpVec = rootTransform.up * Vector3.Dot(rootTransform.up, velocityVec) + rootTransform.forward * Vector3.Dot(rootTransform.forward, velocityVec); //velocity vector projected onto a plane that divides the airplane into left and right halves
double AoA = base.CalculateAoA(tmpVec.normalized); //using base.CalculateAoA gets the deflection using WingAeroModel's code, which does not account for deflection; this gives us the AoA that the surface _would_ be at if it hadn't deflected at all.
AoA = FARMathUtil.rad2deg * AoA;
if (double.IsNaN(AoA))
AoA = 0;
AoAdesiredControl += AoA * pitchaxisDueToAoA * 0.01;
}
AoAdesiredControl *= AoAsign;
AoAdesiredControl = FARMathUtil.Clamp(AoAdesiredControl, -Math.Abs(maxdeflect), Math.Abs(maxdeflect));
AoAcurrentControl = AoAdesiredControl;
AoAcurrentFlap = 0;
if (part.symMethod == SymmetryMethod.Mirror || part.symmetryCounterparts.Count < 1)
{
if (HighLogic.LoadedSceneIsFlight)
flapLocation = Math.Sign(Vector3.Dot(vessel.ReferenceTransform.forward, part.partTransform.forward)); //figure out which way is up
else
flapLocation = Math.Sign(Vector3.Dot(EditorLogic.RootPart.partTransform.forward, part.partTransform.forward)); //figure out which way is up
spoilerLocation = -flapLocation;
}
else if (part.parent != null)
{
flapLocation = Math.Sign(Vector3.Dot(part.partTransform.position - part.parent.partTransform.position, part.partTransform.forward));
spoilerLocation = flapLocation;
}
else
{
flapLocation = 1;
spoilerLocation = flapLocation;
}
if (isFlap)
AoAcurrentFlap += maxdeflectFlap * flapLocation * flap * 0.3333333333333;
else if (isSpoiler)
AoAcurrentFlap += brake ? maxdeflectFlap * spoilerLocation : 0;
AoAdesiredFlap = AoAcurrentFlap;
AoAoffset = AoAcurrentFlap + AoAcurrentControl;
DeflectionAnimation();
}
}
#endregion
public override void OnLoad(ConfigNode node)
{
base.OnLoad(node);
bool tmpBool;
if (node.HasValue("pitchaxis"))
{
if (bool.TryParse(node.GetValue("pitchaxis"), out tmpBool))
{
if (tmpBool)
pitchaxis = 100;
else
pitchaxis = 0;
}
}
if (node.HasValue("yawaxis"))
{
if (bool.TryParse(node.GetValue("yawaxis"), out tmpBool))
{
if (tmpBool)
yawaxis = 100;
else
yawaxis = 0;
}
}
if (node.HasValue("rollaxis"))
{
if (bool.TryParse(node.GetValue("rollaxis"), out tmpBool))
{
if (tmpBool)
rollaxis = 100;
else
rollaxis = 0;
}
}
}
//For some reason, all the UIRange values are saved in the config files, and there is no way to prevent that
//This makes the options limited for people loading old crafts with new FAR
//This resets the values to what they should be
private void FixAllUIRanges()
{
FixWrongUIRange("pitchaxis", 100, -100);
FixWrongUIRange("yawaxis", 100, -100);
FixWrongUIRange("rollaxis", 100, -100);
FixWrongUIRange("brakeRudder", 100, -100);
FixWrongUIRange("maxdeflect", 40, -40);
FixWrongUIRange("maxdeflectFlap", 85, -85);
}
private void FixWrongUIRange(string field, float upperRange, float lowerRange)
{
UI_FloatRange tmpUI = (UI_FloatRange)Fields[field].uiControlEditor;
tmpUI.maxValue = upperRange;
tmpUI.minValue = lowerRange;
}
public Vector3 GetPotentialTorque()
{
Vector3 maxLiftVec = LiftSlope * GetLiftDirection() * maxdeflect * Math.PI / 180; //get max lift coeff
maxLiftVec *= (float)(vessel.dynamicPressurekPa * S); //get an actual lift vector out of it
Vector3 relPosVector = AerodynamicCenter - vessel.CoM;
Vector3 maxMomentVector = Vector3.Cross(relPosVector, maxLiftVec);
Vector3 vesselRelMaxMoment = vessel.ReferenceTransform.worldToLocalMatrix.MultiplyVector(maxMomentVector);
Vector3 resultVector = Vector3.zero;
resultVector.x = (float)(vesselRelMaxMoment.x * pitchaxis * PitchLocation * 0.01);
resultVector.z = (float)(vesselRelMaxMoment.z * yawaxis * YawLocation * 0.01);
resultVector.y = (float)(vesselRelMaxMoment.y * rollaxis * RollLocation * 0.01);
return resultVector;
}
}
}
|
gpl-3.0
|
sinxor/marock
|
app/assets/javascripts/initializations/overlay.js
|
516
|
var Overlay = {
init: function() {
// Set up event handler
$('[data-behavior="trigger-overlay"]').click(Overlay.open);
$('[data-behavior="close-overlay"]').click(Overlay.close);
},
open: function(event) {
event.preventDefault();
$('[data-behavior="overlay"]').addClass('open');
},
close: function(event) {
event.preventDefault();
$('[data-behavior="overlay"]').removeClass('open');
}
};
$(document).ready( Overlay.init );
$(document).on( 'turbolinks:load', Overlay.init );
|
gpl-3.0
|
Betterverse/Craftbukkit
|
src/main/java/net/minecraft/server/EntityEnderman.java
|
12979
|
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.Location;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.entity.EntityTeleportEvent;
// CraftBukkit end
public class EntityEnderman extends EntityMonster {
private static boolean[] d = new boolean[256];
private int e = 0;
private int f = 0;
public EntityEnderman(World world) {
super(world);
this.texture = "/mob/enderman.png";
this.bG = 0.2F;
this.a(0.6F, 2.9F);
this.X = 1.0F;
}
public int getMaxHealth() {
return 40;
}
protected void a() {
super.a();
this.datawatcher.a(16, new Byte((byte) 0));
this.datawatcher.a(17, new Byte((byte) 0));
this.datawatcher.a(18, new Byte((byte) 0));
}
public void b(NBTTagCompound nbttagcompound) {
super.b(nbttagcompound);
nbttagcompound.setShort("carried", (short) this.getCarriedId());
nbttagcompound.setShort("carriedData", (short) this.getCarriedData());
}
public void a(NBTTagCompound nbttagcompound) {
super.a(nbttagcompound);
this.setCarriedId(nbttagcompound.getShort("carried"));
this.setCarriedData(nbttagcompound.getShort("carriedData"));
}
protected Entity findTarget() {
EntityHuman entityhuman = this.world.findNearbyVulnerablePlayer(this, 64.0D);
if (entityhuman != null) {
if (this.d(entityhuman)) {
if (this.f == 0) {
this.world.makeSound(entityhuman, "mob.endermen.stare", 1.0F, 1.0F);
}
if (this.f++ == 5) {
this.f = 0;
this.f(true);
return entityhuman;
}
} else {
this.f = 0;
}
}
return null;
}
private boolean d(EntityHuman entityhuman) {
ItemStack itemstack = entityhuman.inventory.armor[3];
if (itemstack != null && itemstack.id == Block.PUMPKIN.id) {
return false;
} else {
Vec3D vec3d = entityhuman.i(1.0F).a();
Vec3D vec3d1 = this.world.getVec3DPool().create(this.locX - entityhuman.locX, this.boundingBox.b + (double) (this.length / 2.0F) - (entityhuman.locY + (double) entityhuman.getHeadHeight()), this.locZ - entityhuman.locZ);
double d0 = vec3d1.b();
vec3d1 = vec3d1.a();
double d1 = vec3d.b(vec3d1);
return d1 > 1.0D - 0.025D / d0 ? entityhuman.n(this) : false;
}
}
public void c() {
if (this.G()) {
this.damageEntity(DamageSource.DROWN, 1);
}
this.bG = this.target != null ? 6.5F : 0.3F;
int i;
if (!this.world.isStatic && this.world.getGameRules().getBoolean("mobGriefing")) {
int j;
int k;
int l;
if (this.getCarriedId() == 0) {
if (this.random.nextInt(20) == 0) {
i = MathHelper.floor(this.locX - 2.0D + this.random.nextDouble() * 4.0D);
j = MathHelper.floor(this.locY + this.random.nextDouble() * 3.0D);
k = MathHelper.floor(this.locZ - 2.0D + this.random.nextDouble() * 4.0D);
l = this.world.getTypeId(i, j, k);
if (d[l]) {
// CraftBukkit start - pickup event
if (!CraftEventFactory.callEntityChangeBlockEvent(this, this.world.getWorld().getBlockAt(i, j, k), org.bukkit.Material.AIR).isCancelled()) {
this.setCarriedId(this.world.getTypeId(i, j, k));
this.setCarriedData(this.world.getData(i, j, k));
this.world.setTypeId(i, j, k, 0);
}
// CraftBukkit end
}
}
} else if (this.random.nextInt(2000) == 0) {
i = MathHelper.floor(this.locX - 1.0D + this.random.nextDouble() * 2.0D);
j = MathHelper.floor(this.locY + this.random.nextDouble() * 2.0D);
k = MathHelper.floor(this.locZ - 1.0D + this.random.nextDouble() * 2.0D);
l = this.world.getTypeId(i, j, k);
int i1 = this.world.getTypeId(i, j - 1, k);
if (l == 0 && i1 > 0 && Block.byId[i1].b()) {
// CraftBukkit start - place event
org.bukkit.block.Block bblock = this.world.getWorld().getBlockAt(i, j, k);
if (!CraftEventFactory.callEntityChangeBlockEvent(this, bblock, bblock.getType()).isCancelled()) {
this.world.setTypeIdAndData(i, j, k, this.getCarriedId(), this.getCarriedData());
this.setCarriedId(0);
}
// CraftBukkit end
}
}
}
for (i = 0; i < 2; ++i) {
this.world.addParticle("portal", this.locX + (this.random.nextDouble() - 0.5D) * (double) this.width, this.locY + this.random.nextDouble() * (double) this.length - 0.25D, this.locZ + (this.random.nextDouble() - 0.5D) * (double) this.width, (this.random.nextDouble() - 0.5D) * 2.0D, -this.random.nextDouble(), (this.random.nextDouble() - 0.5D) * 2.0D);
}
if (this.world.u() && !this.world.isStatic) {
float f = this.c(1.0F);
if (f > 0.5F && this.world.k(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
this.target = null;
this.f(false);
this.m();
}
}
if (this.G()) {
this.target = null;
this.f(false);
this.m();
}
this.bE = false;
if (this.target != null) {
this.a(this.target, 100.0F, 100.0F);
}
if (!this.world.isStatic && this.isAlive()) {
if (this.target != null) {
if (this.target instanceof EntityHuman && this.d((EntityHuman) this.target)) {
this.bB = this.bC = 0.0F;
this.bG = 0.0F;
if (this.target.e((Entity) this) < 16.0D) {
this.m();
}
this.e = 0;
} else if (this.target.e((Entity) this) > 256.0D && this.e++ >= 30 && this.p(this.target)) {
this.e = 0;
}
} else {
this.f(false);
this.e = 0;
}
}
super.c();
}
protected boolean m() {
double d0 = this.locX + (this.random.nextDouble() - 0.5D) * 64.0D;
double d1 = this.locY + (double) (this.random.nextInt(64) - 32);
double d2 = this.locZ + (this.random.nextDouble() - 0.5D) * 64.0D;
return this.j(d0, d1, d2);
}
protected boolean p(Entity entity) {
Vec3D vec3d = this.world.getVec3DPool().create(this.locX - entity.locX, this.boundingBox.b + (double) (this.length / 2.0F) - entity.locY + (double) entity.getHeadHeight(), this.locZ - entity.locZ);
vec3d = vec3d.a();
double d0 = 16.0D;
double d1 = this.locX + (this.random.nextDouble() - 0.5D) * 8.0D - vec3d.c * d0;
double d2 = this.locY + (double) (this.random.nextInt(16) - 8) - vec3d.d * d0;
double d3 = this.locZ + (this.random.nextDouble() - 0.5D) * 8.0D - vec3d.e * d0;
return this.j(d1, d2, d3);
}
protected boolean j(double d0, double d1, double d2) {
double d3 = this.locX;
double d4 = this.locY;
double d5 = this.locZ;
this.locX = d0;
this.locY = d1;
this.locZ = d2;
boolean flag = false;
int i = MathHelper.floor(this.locX);
int j = MathHelper.floor(this.locY);
int k = MathHelper.floor(this.locZ);
int l;
if (this.world.isLoaded(i, j, k)) {
boolean flag1 = false;
while (!flag1 && j > 0) {
l = this.world.getTypeId(i, j - 1, k);
if (l != 0 && Block.byId[l].material.isSolid()) {
flag1 = true;
} else {
--this.locY;
--j;
}
}
if (flag1) {
// CraftBukkit start - teleport event
EntityTeleportEvent teleport = new EntityTeleportEvent(this.getBukkitEntity(), new Location(this.world.getWorld(), d3, d4, d5), new Location(this.world.getWorld(), this.locX, this.locY, this.locZ));
this.world.getServer().getPluginManager().callEvent(teleport);
if (teleport.isCancelled()) {
return false;
}
Location to = teleport.getTo();
this.setPosition(to.getX(), to.getY(), to.getZ());
// CraftBukkit end
if (this.world.getCubes(this, this.boundingBox).isEmpty() && !this.world.containsLiquid(this.boundingBox)) {
flag = true;
}
}
}
if (!flag) {
this.setPosition(d3, d4, d5);
return false;
} else {
short short1 = 128;
for (l = 0; l < short1; ++l) {
double d6 = (double) l / ((double) short1 - 1.0D);
float f = (this.random.nextFloat() - 0.5F) * 0.2F;
float f1 = (this.random.nextFloat() - 0.5F) * 0.2F;
float f2 = (this.random.nextFloat() - 0.5F) * 0.2F;
double d7 = d3 + (this.locX - d3) * d6 + (this.random.nextDouble() - 0.5D) * (double) this.width * 2.0D;
double d8 = d4 + (this.locY - d4) * d6 + this.random.nextDouble() * (double) this.length;
double d9 = d5 + (this.locZ - d5) * d6 + (this.random.nextDouble() - 0.5D) * (double) this.width * 2.0D;
this.world.addParticle("portal", d7, d8, d9, (double) f, (double) f1, (double) f2);
}
this.world.makeSound(d3, d4, d5, "mob.endermen.portal", 1.0F, 1.0F);
this.makeSound("mob.endermen.portal", 1.0F, 1.0F);
return true;
}
}
protected String aY() {
return this.q() ? "mob.endermen.scream" : "mob.endermen.idle";
}
protected String aZ() {
return "mob.endermen.hit";
}
protected String ba() {
return "mob.endermen.death";
}
protected int getLootId() {
return Item.ENDER_PEARL.id;
}
protected void dropDeathLoot(boolean flag, int i) {
int j = this.getLootId();
if (j > 0) {
// CraftBukkit start - whole method
java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
int count = this.random.nextInt(2 + i);
if ((j > 0) && (count > 0)) {
loot.add(new org.bukkit.inventory.ItemStack(j, count));
}
CraftEventFactory.callEntityDeathEvent(this, loot);
// CraftBukkit end
}
}
public void setCarriedId(int i) {
this.datawatcher.watch(16, Byte.valueOf((byte) (i & 255)));
}
public int getCarriedId() {
return this.datawatcher.getByte(16);
}
public void setCarriedData(int i) {
this.datawatcher.watch(17, Byte.valueOf((byte) (i & 255)));
}
public int getCarriedData() {
return this.datawatcher.getByte(17);
}
public boolean damageEntity(DamageSource damagesource, int i) {
if (this.isInvulnerable()) {
return false;
} else if (damagesource instanceof EntityDamageSourceIndirect) {
for (int j = 0; j < 64; ++j) {
if (this.m()) {
return true;
}
}
return false;
} else {
if (damagesource.getEntity() instanceof EntityHuman) {
this.f(true);
}
return super.damageEntity(damagesource, i);
}
}
public boolean q() {
return this.datawatcher.getByte(18) > 0;
}
public void f(boolean flag) {
this.datawatcher.watch(18, Byte.valueOf((byte) (flag ? 1 : 0)));
}
public int c(Entity entity) {
return 7;
}
static {
d[Block.GRASS.id] = true;
d[Block.DIRT.id] = true;
d[Block.SAND.id] = true;
d[Block.GRAVEL.id] = true;
d[Block.YELLOW_FLOWER.id] = true;
d[Block.RED_ROSE.id] = true;
d[Block.BROWN_MUSHROOM.id] = true;
d[Block.RED_MUSHROOM.id] = true;
d[Block.TNT.id] = true;
d[Block.CACTUS.id] = true;
d[Block.CLAY.id] = true;
d[Block.PUMPKIN.id] = true;
d[Block.MELON.id] = true;
d[Block.MYCEL.id] = true;
}
}
|
gpl-3.0
|
neutmute/emgucv
|
Emgu.CV/CameraCalibration/RotationMatrix2D.cs
|
8270
|
//----------------------------------------------------------------------------
// Copyright (C) 2004-2017 by EMGU Corporation. All rights reserved.
//----------------------------------------------------------------------------
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Diagnostics;
using Emgu.CV.Structure;
namespace Emgu.CV
{
/// <summary>
/// A (2x3) 2D rotation matrix. This Matrix defines an Affine Transform
/// </summary>
#if !(NETFX_CORE || NETSTANDARD1_4)
[Serializable]
#endif
public class RotationMatrix2D : Mat
{
/*
#if !(NETFX_CORE || NETSTANDARD1_4)
/// <summary>
/// Constructor used to deserialize 2D rotation matrix
/// </summary>
/// <param name="info">The serialization info</param>
/// <param name="context">The streaming context</param>
public RotationMatrix2D(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
#endif*/
/// <summary>
/// Create an empty (2x3) 2D rotation matrix
/// </summary>
public RotationMatrix2D()
: base()
{ }
/// <summary>
/// Create a (2x3) 2D rotation matrix
/// </summary>
/// <param name="center">Center of the rotation in the source image</param>
/// <param name="angle">The rotation angle in degrees. Positive values mean couter-clockwise rotation (the coordiate origin is assumed at top-left corner). </param>
/// <param name="scale">Isotropic scale factor.</param>
public RotationMatrix2D(PointF center, double angle, double scale)
: this()
{
SetRotation(center, angle, scale);
}
/// <summary>
/// Set the values of the rotation matrix
/// </summary>
/// <param name="center">Center of the rotation in the source image</param>
/// <param name="angle">The rotation angle in degrees. Positive values mean couter-clockwise rotation (the coordiate origin is assumed at top-left corner). </param>
/// <param name="scale">Isotropic scale factor.</param>
public void SetRotation(PointF center, double angle, double scale)
{
CvInvoke.GetRotationMatrix2D(center, angle, scale, this);
}
/// <summary>
/// Rotate the <paramref name="points"/>, the value of the input <paramref name="points"/> will be changed.
/// </summary>
/// <param name="points">The points to be rotated, its value will be modified</param>
public void RotatePoints(MCvPoint2D64f[] points)
{
GCHandle handle = GCHandle.Alloc(points, GCHandleType.Pinned);
using (Matrix<double> mat = new Matrix<double>(points.Length, 2, handle.AddrOfPinnedObject()))
RotatePoints(mat);
handle.Free();
}
/// <summary>
/// Rotate the <paramref name="points"/>, the value of the input <paramref name="points"/> will be changed.
/// </summary>
/// <param name="points">The points to be rotated, its value will be modified</param>
public void RotatePoints(PointF[] points)
{
GCHandle handle = GCHandle.Alloc(points, GCHandleType.Pinned);
using (Matrix<float> mat = new Matrix<float>(points.Length, 2, handle.AddrOfPinnedObject()))
RotatePoints(mat);
handle.Free();
}
/// <summary>
/// Rotate the <paramref name="lineSegments"/>, the value of the input <paramref name="lineSegments"/> will be changed.
/// </summary>
/// <param name="lineSegments">The line segments to be rotated</param>
public void RotateLines(LineSegment2DF[] lineSegments)
{
GCHandle handle = GCHandle.Alloc(lineSegments, GCHandleType.Pinned);
using (Matrix<float> mat = new Matrix<float>(lineSegments.Length * 2, 2, handle.AddrOfPinnedObject()))
RotatePoints(mat);
handle.Free();
}
/// <summary>
/// Rotate the single channel Nx2 matrix where N is the number of 2D points. The value of the matrix is changed after rotation.
/// </summary>
/// <typeparam name="TDepth">The depth of the points, must be double or float</typeparam>
/// <param name="points">The N 2D-points to be rotated</param>
public void RotatePoints<TDepth>(Matrix<TDepth> points) where TDepth : new()
{
Debug.Assert(typeof(TDepth) == typeof(float) || typeof(TDepth) == typeof(Double), "Only type of double or float is supported");
Debug.Assert(points.NumberOfChannels == 1 && points.Cols == 2, "The matrix must be a single channel Nx2 matrix where N is the number of points");
CvEnum.DepthType dt = CvInvoke.GetDepthType(typeof(TDepth));
using (Mat tmp = new Mat(points.Rows, 3, CvInvoke.GetDepthType(typeof(TDepth)), 1))
using (Mat rotationMatrix = new Mat(Rows, Cols, CvInvoke.GetDepthType(typeof(TDepth)), 1))
{
CvInvoke.CopyMakeBorder(points, tmp, 0, 0, 0, 1, Emgu.CV.CvEnum.BorderType.Constant, new MCvScalar(1.0));
if (typeof(double).Equals(typeof(TDepth)))
CopyTo(rotationMatrix);
else
ConvertTo(rotationMatrix, CvInvoke.GetDepthType(typeof(TDepth)));
CvInvoke.Gemm(
tmp,
rotationMatrix,
1.0,
null,
0.0,
points,
Emgu.CV.CvEnum.GemmType.Src2Transpose);
}
}
/// <summary>
/// Return a clone of the Matrix
/// </summary>
/// <returns>A clone of the Matrix</returns>
public new RotationMatrix2D Clone()
{
RotationMatrix2D clone = new RotationMatrix2D();
CopyTo(clone);
//CvInvoke.cvCopy(_ptr, clone, IntPtr.Zero);
return clone;
}
/// <summary>
/// Create a rotation matrix for rotating an image
/// </summary>
/// <param name="angle">The rotation angle in degrees. Positive values mean couter-clockwise rotation (the coordiate origin is assumed at image centre). </param>
/// <param name="center">The rotation center</param>
/// <param name="srcImageSize">The source image size</param>
/// <param name="dstImageSize">The minimun size of the destination image</param>
/// <returns>The rotation matrix that rotate the source image to the destination image.</returns>
public static RotationMatrix2D CreateRotationMatrix(PointF center, double angle, Size srcImageSize, out Size dstImageSize)
{
RotationMatrix2D rotationMatrix = new RotationMatrix2D(center, angle, 1);
PointF[] corners = new PointF[] {
new PointF(0, 0),
new PointF(srcImageSize.Width - 1 , 0),
new PointF(srcImageSize.Width - 1, srcImageSize.Height -1),
new PointF(0, srcImageSize.Height -1)};
rotationMatrix.RotatePoints(corners);
int minX = (int)Math.Round(Math.Min(Math.Min(corners[0].X, corners[1].X), Math.Min(corners[2].X, corners[3].X)));
int maxX = (int)Math.Round(Math.Max(Math.Max(corners[0].X, corners[1].X), Math.Max(corners[2].X, corners[3].X)));
int minY = (int)Math.Round(Math.Min(Math.Min(corners[0].Y, corners[1].Y), Math.Min(corners[2].Y, corners[3].Y)));
int maxY = (int)Math.Round(Math.Max(Math.Max(corners[0].Y, corners[1].Y), Math.Max(corners[2].Y, corners[3].Y)));
using (Matrix<double> offset = new Matrix<double>(2, 3))
{
offset[0, 2] = minX;
offset[1, 2] = minY;
CvInvoke.Subtract(rotationMatrix, offset, rotationMatrix);
//rotationMatrix[0, 2] -= minX;
//rotationMatrix[1, 2] -= minY;
}
dstImageSize = new Size(maxX - minX + 1, maxY - minY + 1);
return rotationMatrix;
}
}
}
|
gpl-3.0
|
wandora-team/wandora
|
src/org/wandora/application/gui/topicpanels/treemap/TopicInfo.java
|
1971
|
/*
* WANDORA
* Knowledge Extraction, Management, and Publishing Application
* http://wandora.org
*
* Copyright (C) 2004-2016 Wandora Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* Created on Oct 19, 2011, 8:12:21 PM
*/
package org.wandora.application.gui.topicpanels.treemap;
import org.wandora.application.gui.topicstringify.TopicToString;
import org.wandora.topicmap.Topic;
/**
*
* @author elias, akivela
*/
public class TopicInfo extends MapItem {
public String name;
public String type;
public int instances;
public Topic t;
public Rect rectArea;
public TopicInfo(Topic t, int instances, int order, int depth) {
//this(t, instances, order, depth, TYPE_INSTANCE);
this(t, instances, order, depth, "");
}
public TopicInfo(Topic t, int instances, int order, int depth, String type) {
this.rectArea = null;
this.type = type;
this.t = t;
this.name = getTopicInfoString(t);
this.instances = instances;
this.order = order;
this.size = instances+1;
this.bounds = new Rect();
this.depth = depth;
}
private String getTopicInfoString(Topic t) {
try {
return TopicToString.toString(t);
}
catch(Exception e) {
return "[error]";
}
}
}
|
gpl-3.0
|
Wopple/Mage
|
portraitbox.py
|
1925
|
# Copyright 2009 Christopher Czyzewski
# This file is part of Project Mage.
#
# Project Mage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Project Mage is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Project Mage. If not, see <http://www.gnu.org/licenses/>.
import os
import sys
import pygame
import math
import box
import portrait
from constants import *
class PortraitBox(object):
def __init__(self):
sizeX = PORTRAIT_SIZE_PLANNING[0] + (PORTRAIT_BOX_BORDER_SIZE * 2) + (PORTRAIT_BOX_PADDING * 2)
sizeY = PORTRAIT_SIZE_PLANNING[1] + (PORTRAIT_BOX_BORDER_SIZE * 2) + (PORTRAIT_BOX_PADDING * 2)
tempRect = pygame.Rect( (0, 0), (sizeX, sizeY) )
self.box = box.Box(tempRect, PORTRAIT_BOX_PATTERN, PORTRAIT_BOX_PATTERN_SIZE,
PORTRAIT_BOX_BORDER, PORTRAIT_BOX_BORDER_SIZE)
self.portrait = None
tempLoc = PORTRAIT_BOX_BORDER_SIZE + PORTRAIT_BOX_PADDING
self.portLoc = (tempLoc, tempLoc)
def draw(self, screen):
self.box.draw(screen)
if not(self.portrait is None):
loc = (self.portLoc[0] + self.box.rect.left, self.portLoc[1] + self.box.rect.top)
self.portrait.update(loc)
self.portrait.draw(screen)
def update(self, in_image):
if in_image is None:
self.portrait = None
else:
self.portrait = portrait.Portrait(in_image, PORTRAIT_SIZE_PLANNING, (0,0))
|
gpl-3.0
|
dlfivefifty/dlfivefifty-butterfly
|
include/bfio/structures/source.hpp
|
1111
|
/*
ButterflyFIO: a distributed-memory fast algorithm for applying FIOs.
Copyright (C) 2010-2011 Jack Poulson <jack.poulson@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BFIO_STRUCTURES_SOURCE_HPP
#define BFIO_STRUCTURES_SOURCE_HPP 1
#include <cstddef>
#include <complex>
#include "bfio/structures/array.hpp"
namespace bfio {
template<typename R,std::size_t d>
struct Source
{
Array<R,d> p;
std::complex<R> magnitude;
};
} // bfio
#endif // BFIO_STRUCTURES_SOURCE_HPP
|
gpl-3.0
|
ahaqxjl/ccf
|
2013121/src/Main.java
|
938
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int count = Integer.parseInt(scanner.nextLine());
int[] numbers = new int[count];
String numbersStr = scanner.nextLine();
String[] numbersArray = numbersStr.split(" ");
for(int i = 0; i < numbersArray.length; i++) {
numbers[i] = Integer.parseInt(numbersArray[i]);
}
int result = numbers[0];
int maxOccurenceFreq = 1;
for(int i = 0; i < count; i++){
int tmpResult = numbers[i];
int tmpMaxFreq = 1;
for(int j=i + 1; j < count; j++){
if (numbers[i] == numbers[j]) {
tmpMaxFreq ++;
}
}
if (tmpMaxFreq > maxOccurenceFreq) {
maxOccurenceFreq = tmpMaxFreq;
result = tmpResult;
} else if (tmpMaxFreq == maxOccurenceFreq && tmpResult < result) {
result = tmpResult;
}
}
System.out.println(result);
scanner.close();
}
}
|
gpl-3.0
|
jishnu7/timestep
|
build/native/native.js
|
9023
|
var fs = require('fs');
var ff = require('ff');
var path = require('path');
var wrench = require('wrench');
var hashFile = require("../../../../src/hashFile");
/**
* Packaging for Native.
* Native on any platform requires a compiled JavaScript file, so we make this
* generic and include it here.
*/
var _build;
var _logger;
var _paths;
var INITIAL_IMPORT = 'gc.native.launchClient';
var installAddons = function(builder, project, next) {
var paths = builder.common.paths;
var addons = project && project.manifest && project.manifest.addons;
var f = ff(this, function() {
// For each addon,
if (addons) {
for (var ii = 0; ii < addons.length; ++ii) {
var addon = addons[ii];
// Prefer paths in this order:
var addon_js_ios = paths.addons(addon, 'js', 'ios');
var addon_js_android = paths.addons(addon, 'js', 'android');
var addon_js_native = paths.addons(addon, 'js', 'native');
var addon_js = paths.addons(addon, 'js');
if (fs.existsSync(addon_js_ios)) {
logger.log("Installing addon:", addon, "-- Adding ./js/ios to jsio path");
require(paths.root('src', 'AddonManager')).registerPath(addon_js_ios);
} else if (fs.existsSync(addon_js_android)) {
logger.log("Installing addon:", addon, "-- Adding ./js/android to jsio path");
require(paths.root('src', 'AddonManager')).registerPath(addon_js_android);
} else if (fs.existsSync(addon_js_native)) {
logger.log("Installing addon:", addon, "-- Adding ./js/native to jsio path");
require(paths.root('src', 'AddonManager')).registerPath(addon_js_native);
} else if (fs.existsSync(addon_js)) {
logger.log("Installing addon:", addon, "-- Adding ./js to jsio path");
require(paths.root('src', 'AddonManager')).registerPath(addon_js);
} else {
logger.warn("Installing addon:", addon, "-- No js directory so no JavaScript will be installed");
}
}
}
}).error(function(err) {
logger.error("Failure installing addon javascript:", err);
}).cb(next);
}
// takes a project, subtarget(android/ios), additional opts.
exports.build = function (build, project, subtarget, moreOpts, next) {
var target = 'native-' + subtarget;
_build = build;
_paths = _build.common.paths;
logger = new build.common.Formatter('build-native');
// Get domain from manifest under studio.domain
var studio = project.manifest.studio;
var domain = studio ? studio.domain : null;
domain = domain || "gameclosure.com";
//define a bunch of build options
var opts = _build.packager.getBuildOptions({
appID: project.manifest.appID,
output: moreOpts.buildPath, // path is overriden by native if not the test app or simulate
fullPath: project.paths.root, // path
localBuildPath: path.relative(project.paths.root, moreOpts.buildPath),
debug: moreOpts.debug,
servicesURL: moreOpts.servicesURL,
isSimulated: !!moreOpts.isSimulated,
isTestApp: !!moreOpts.isTestApp,
noRedirect: false,
compress: moreOpts.compress,
noPrompt: true,
// Build process.
packageName: '',
studio: domain,
version: project.manifest.version,
metadata: null,
template: moreOpts.template,
target: target,
subtarget: subtarget,
});
// doesn't build ios - builds the js that it would use, then you shim out NATIVE
if (opts.isTestApp) {
installAddons(build, project, function() {
exports.writeNativeResources(project, opts, next);
});
} else if (opts.isSimulated) {
// Build simulated version
//
// When simulating, we build a native version which targets the native target
// but uses the browser HTML to host. A native shim is supplied to mimick native
// features, so that the code can be tested in the browser without modification.
require('../browser/browser').runBuild(_build, project, opts, next);
} else {
// Use native target (android/ios)
require('./' + target).package(_build, project, opts, next);
}
};
// Write out native javascript, generating a cache and config object.
var NATIVE_ENV_JS = fs.readFileSync(path.join(__dirname, "env.js"), 'utf8');
function wrapNativeJS (project, opts, target, resources, code) {
var inlineCache = {};
resources.forEach(function (info) {
if (!fs.existsSync(info.fullPath)) {
return;
}
var ext = path.extname(info.fullPath).substr(1);
if (ext == "js") {
var contents = fs.readFileSync(info.fullPath, 'utf-8');
inlineCache[info.relative] = contents;
} else if (ext == "json") {
// TODO Minify JSON
var jsonData = fs.readFileSync(info.fullPath, 'utf-8');
try {
inlineCache[info.relative] = JSON.stringify(JSON.parse(jsonData));
} catch (e) {
var exStr = 'Invalid JSON resource: ' + info.relative;
logger.error(exStr);
throw new Error(exStr);
}
}
});
return [
_build.packager.getJSConfig(project, opts, target),
"window.CACHE = " + JSON.stringify(inlineCache) + ";",
code,
NATIVE_ENV_JS
].join('');
}
function filterCopyFile(ios, file) {
var exemptFiles = ["spritesheets/map.json", "spritesheets/spritesheetSizeMap.json", "resources/fonts/fontsheetSizeMap.json"];
if (!file.endsWith(".js") && (exemptFiles.indexOf(file) >= 0 || !file.endsWith(".json"))) {
// If iOS,
if (ios) {
if (file.endsWith(".ogg")) {
return "ignore";
}
} else { // Else on Android or other platform that supports .ogg:
// If it is MP3,
if (file.endsWith(".mp3") && fs.existsSync(file.substr(0, file.length - 4) + ".ogg")) {
return "ignore";
} else if (file.endsWith(".ogg")) {
return "renameMP3";
}
}
return null;
}
return "ignore";
}
// Write out build resources to disk.
//creates the js code which is the same on each native platform
exports.writeNativeResources = function (project, opts, next) {
logger.log("Writing resources for " + opts.appID + " with target " + opts.target);
var ios = opts.target.indexOf("ios") >= 0;
opts.mapMutator = function(keys) {
var deleteList = [], renameList = [];
for (var key in keys) {
switch (filterCopyFile(ios, key)) {
case "ignore":
deleteList.push(key);
break;
case "renameMP3":
renameList.push(key);
break;
}
}
for (var ii = 0; ii < deleteList.length; ++ii) {
var key = deleteList[ii];
delete keys[key];
}
for (var ii = 0; ii < renameList.length; ++ii) {
var key = renameList[ii];
var mutatedKey = key.substr(0, key.length - 4) + ".mp3";
keys[mutatedKey] = keys[key];
keys[key] = undefined;
}
};
var f = ff(function () {
_build.packager.compileResources(project, opts, opts.target, INITIAL_IMPORT, f());
}, function (pkg) {
var files = pkg.files;
/*
icons = manifest.get("icons", {}).values()
if len(icons) > 0:
files.push('icon.png', open(icons[-1]).read())
*/
var cache = {};
function embedFile (info) {
switch (filterCopyFile(ios, info.relative)) {
case "ignore":
break;
case "renameMP3":
info.relative = info.relative.substr(0, info.relative.length - 4) + ".mp3";
// fall-thru
default:
logger.log("Writing resource:", info.relative);
cache[info.relative] = {
src: info.fullPath
};
break;
}
}
files.sprites.forEach(embedFile);
files.resources.forEach(embedFile);
cache["manifest.json"] = {
contents: JSON.stringify(project.manifest)
};
// If native.js is > 1mb, it won't be read properly by android because it must
// be uncompressed. To avoid this, we suffix it with .mp3, a filetype that the
// Android system won't compress.
cache["native.js.mp3"] = {
contents: wrapNativeJS(project, opts, opts.target, files.resources, pkg.jsSrc)
};
logger.log('writing files to', opts.output);
var list = {};
var keys = Object.keys(cache);
var i = 0;
var onCopy = f.wait();
function writeNext() {
var key = keys[i++];
if (!key) {
onCopy();
return;
}
list[key] = "-";
var out = path.join(opts.output, key);
wrench.mkdirSyncRecursive(path.dirname(out));
var f2 = ff(function () {
// Use generated data or read in file
if (cache[key] == null) {
logger.error("No file contents for", key);
} else if (cache[key].contents) {
fs.writeFile(out, cache[key].contents, f2());
} else if (cache[key].src) {
_build.common.child('cp', ['-p', cache[key].src, out], {cwd: opts.fullPath}, f2());
}
}, function () {
// build a list of etags so the test app doesn't have to make a
// lot of HTTP requests
hashFile(path.resolve(opts.fullPath, out), f2());
}, function (hash) {
// don't really care about errors here since the hash is used
// as a download optimization anyway
if (hash) {
list[key] = hash;
}
}).cb(writeNext);
}
f(list);
writeNext();
}, function (list) {
logger.log("Writing file list to " + path.join(opts.output, 'resource_list.json'));
fs.writeFile(path.join(opts.output, 'resource_list.json'), JSON.stringify(list), f());
}).cb(function (err) {
if (err) {
logger.error(err);
console.log(err.stack);
} else {
next();
}
});
}
|
gpl-3.0
|
Charence/stk-code
|
lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp
|
82873
|
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// Copyright (C) 2014-2015 Dawid Gan
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
extern bool GLContextDebugBit;
#include "CIrrDeviceLinux.h"
#ifdef _IRR_COMPILE_WITH_X11_DEVICE_
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/utsname.h>
#include <time.h>
#include "IEventReceiver.h"
#include "ISceneManager.h"
#include "IGUIEnvironment.h"
#include "os.h"
#include "CTimer.h"
#include "irrString.h"
#include "Keycodes.h"
#include "COSOperator.h"
#include "CColorConverter.h"
#include "SIrrCreationParameters.h"
#include "IGUISpriteBank.h"
#include <X11/XKBlib.h>
#include <X11/Xatom.h>
#ifdef _IRR_LINUX_XCURSOR_
#include <X11/Xcursor/Xcursor.h>
#endif
#if defined _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
#include <fcntl.h>
#include <unistd.h>
#ifdef __FreeBSD__
#include <sys/joystick.h>
#else
// linux/joystick.h includes linux/input.h, which #defines values for various KEY_FOO keys.
// These override the irr::KEY_FOO equivalents, which stops key handling from working.
// As a workaround, defining _INPUT_H stops linux/input.h from being included; it
// doesn't actually seem to be necessary except to pull in sys/ioctl.h.
#define _INPUT_H
#include <sys/ioctl.h> // Would normally be included in linux/input.h
#include <linux/joystick.h>
#undef _INPUT_H
#endif
#endif // _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
#define XRANDR_ROTATION_LEFT (1 << 1)
#define XRANDR_ROTATION_RIGHT (1 << 3)
namespace irr
{
namespace video
{
extern bool useCoreContext;
IVideoDriver* createOpenGLDriver(const SIrrlichtCreationParameters& params,
io::IFileSystem* io, CIrrDeviceLinux* device);
}
} // end namespace irr
namespace
{
Atom X_ATOM_CLIPBOARD;
Atom X_ATOM_TARGETS;
Atom X_ATOM_UTF8_STRING;
Atom X_ATOM_TEXT;
};
namespace irr
{
const char* wmDeleteWindow = "WM_DELETE_WINDOW";
//! constructor
CIrrDeviceLinux::CIrrDeviceLinux(const SIrrlichtCreationParameters& param)
: CIrrDeviceStub(param),
#ifdef _IRR_COMPILE_WITH_X11_
display(0), visual(0), screennr(0), window(0), StdHints(0), SoftwareImage(0),
#ifdef _IRR_COMPILE_WITH_OPENGL_
glxWin(0),
Context(0),
#endif
#endif
Width(param.WindowSize.Width), Height(param.WindowSize.Height),
WindowHasFocus(false), WindowMinimized(false),
UseXVidMode(false), UseXRandR(false), UseGLXWindow(false),
ExternalWindow(false), AutorepeatSupport(0)
{
#ifdef _DEBUG
setDebugName("CIrrDeviceLinux");
#endif
// print version, distribution etc.
// thx to LynxLuna for pointing me to the uname function
core::stringc linuxversion;
struct utsname LinuxInfo;
uname(&LinuxInfo);
linuxversion += LinuxInfo.sysname;
linuxversion += " ";
linuxversion += LinuxInfo.release;
linuxversion += " ";
linuxversion += LinuxInfo.version;
linuxversion += " ";
linuxversion += LinuxInfo.machine;
Operator = new COSOperator(linuxversion, this);
os::Printer::log(linuxversion.c_str(), ELL_INFORMATION);
// create keymap
createKeyMap();
// create window
if (CreationParams.DriverType != video::EDT_NULL)
{
// create the window, only if we do not use the null device
if (!createWindow())
return;
}
// create cursor control
CursorControl = new CCursorControl(this, CreationParams.DriverType == video::EDT_NULL);
// create driver
createDriver();
if (!VideoDriver)
return;
createGUIAndScene();
}
//! destructor
CIrrDeviceLinux::~CIrrDeviceLinux()
{
#ifdef _IRR_COMPILE_WITH_X11_
if (StdHints)
XFree(StdHints);
// Disable cursor (it is drop'ed in stub)
if (CursorControl)
{
CursorControl->setVisible(false);
static_cast<CCursorControl*>(CursorControl)->clearCursors();
}
// Must free OpenGL textures etc before destroying context, so can't wait for stub destructor
if ( GUIEnvironment )
{
GUIEnvironment->drop();
GUIEnvironment = NULL;
}
if ( SceneManager )
{
SceneManager->drop();
SceneManager = NULL;
}
if ( VideoDriver )
{
VideoDriver->drop();
VideoDriver = NULL;
}
if (display)
{
#ifdef _IRR_COMPILE_WITH_OPENGL_
if (Context)
{
if (glxWin)
{
if (!glXMakeContextCurrent(display, None, None, NULL))
os::Printer::log("Could not release glx context.", ELL_WARNING);
}
else
{
if (!glXMakeCurrent(display, None, NULL))
os::Printer::log("Could not release glx context.", ELL_WARNING);
}
glXDestroyContext(display, Context);
if (glxWin)
glXDestroyWindow(display, glxWin);
}
#endif // #ifdef _IRR_COMPILE_WITH_OPENGL_
if (SoftwareImage)
XDestroyImage(SoftwareImage);
if (!ExternalWindow)
{
XDestroyWindow(display,window);
}
// Reset fullscreen resolution change
restoreResolution();
if (!ExternalWindow)
{
XCloseDisplay(display);
}
}
if (visual)
XFree(visual);
#endif // #ifdef _IRR_COMPILE_WITH_X11_
#if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_)
for (u32 joystick = 0; joystick < ActiveJoysticks.size(); ++joystick)
{
if (ActiveJoysticks[joystick].fd >= 0)
{
close(ActiveJoysticks[joystick].fd);
}
}
#endif
}
#if defined(_IRR_COMPILE_WITH_X11_)
static bool XErrorSignaled = false;
int IrrPrintXError(Display *display, XErrorEvent *event)
{
char msg[256];
char msg2[256];
XErrorSignaled = true;
snprintf(msg, 256, "%d", event->request_code);
XGetErrorDatabaseText(display, "XRequest", msg, "unknown", msg2, 256);
XGetErrorText(display, event->error_code, msg, 256);
os::Printer::log("X Error", msg, ELL_WARNING);
os::Printer::log("From call ", msg2, ELL_WARNING);
return 0;
}
#endif
bool CIrrDeviceLinux::restoreResolution()
{
if (!CreationParams.Fullscreen)
return true;
#ifdef _IRR_LINUX_X11_VIDMODE_
if (UseXVidMode && CreationParams.Fullscreen)
{
XF86VidModeSwitchToMode(display, screennr, &oldVideoMode);
XF86VidModeSetViewPort(display, screennr, 0, 0);
}
#endif
#ifdef _IRR_LINUX_X11_RANDR_
if (UseXRandR && CreationParams.Fullscreen && old_mode != BadRRMode)
{
XRRScreenResources* res = XRRGetScreenResources(display, DefaultRootWindow(display));
if (!res)
return false;
XRROutputInfo* output = XRRGetOutputInfo(display, res, output_id);
if (!output || !output->crtc || output->connection == RR_Disconnected)
{
XRRFreeOutputInfo(output);
return false;
}
XRRCrtcInfo* crtc = XRRGetCrtcInfo(display, res, output->crtc);
if (!crtc)
{
XRRFreeOutputInfo(output);
return false;
}
Status s = XRRSetCrtcConfig(display, res, output->crtc, CurrentTime,
crtc->x, crtc->y, old_mode,
crtc->rotation, &output_id, 1);
XRRFreeOutputInfo(output);
XRRFreeCrtcInfo(crtc);
XRRFreeScreenResources(res);
if (s != Success)
return false;
}
#endif
return true;
}
bool CIrrDeviceLinux::changeResolution()
{
if (!CreationParams.Fullscreen)
return true;
getVideoModeList();
#if defined(_IRR_LINUX_X11_VIDMODE_) || defined(_IRR_LINUX_X11_RANDR_)
s32 eventbase, errorbase;
s32 bestMode = -1;
#endif
#ifdef _IRR_LINUX_X11_VIDMODE_
if (XF86VidModeQueryExtension(display, &eventbase, &errorbase))
{
// enumerate video modes
s32 modeCount;
XF86VidModeModeInfo** modes;
float refresh_rate, refresh_rate_old;
XF86VidModeGetAllModeLines(display, screennr, &modeCount, &modes);
// find fitting mode
for (s32 i = 0; i<modeCount; ++i)
{
if (bestMode==-1 && modes[i]->hdisplay >= Width && modes[i]->vdisplay >= Height)
{
bestMode = i;
}
else if (bestMode!=-1 &&
modes[i]->hdisplay == modes[bestMode]->hdisplay &&
modes[i]->vdisplay == modes[bestMode]->vdisplay)
{
refresh_rate_old = (modes[bestMode]->dotclock * 1000.0) / (modes[bestMode]->htotal * modes[bestMode]->vtotal);
refresh_rate = (modes[i]->dotclock * 1000.0) / (modes[i]->htotal * modes[i]->vtotal);
if (refresh_rate > refresh_rate_old)
{
bestMode = i;
}
}
else if (bestMode!=-1 &&
modes[i]->hdisplay >= Width &&
modes[i]->vdisplay >= Height &&
modes[i]->hdisplay <= modes[bestMode]->hdisplay &&
modes[i]->vdisplay <= modes[bestMode]->vdisplay)
{
bestMode = i;
}
}
if (bestMode != -1)
{
os::Printer::log("Starting vidmode fullscreen mode...", ELL_INFORMATION);
os::Printer::log("hdisplay: ", core::stringc(modes[bestMode]->hdisplay).c_str(), ELL_INFORMATION);
os::Printer::log("vdisplay: ", core::stringc(modes[bestMode]->vdisplay).c_str(), ELL_INFORMATION);
XF86VidModeSwitchToMode(display, screennr, modes[bestMode]);
XF86VidModeSetViewPort(display, screennr, 0, 0);
UseXVidMode=true;
}
else
{
os::Printer::log("Could not find specified video mode, running windowed.", ELL_WARNING);
CreationParams.Fullscreen = false;
}
XFree(modes);
}
#endif
#ifdef _IRR_LINUX_X11_RANDR_
while (XRRQueryExtension(display, &eventbase, &errorbase))
{
if (output_id == BadRROutput)
break;
XRRScreenResources* res = XRRGetScreenResources(display, DefaultRootWindow(display));
if (!res)
break;
XRROutputInfo* output = XRRGetOutputInfo(display, res, output_id);
if (!output || !output->crtc || output->connection == RR_Disconnected)
{
XRRFreeOutputInfo(output);
XRRFreeScreenResources(res);
break;
}
XRRCrtcInfo* crtc = XRRGetCrtcInfo(display, res, output->crtc);
if (!crtc)
{
XRRFreeOutputInfo(output);
XRRFreeScreenResources(res);
break;
}
float refresh_rate, refresh_rate_new;
core::dimension2d<u32> mode0_size = core::dimension2d<u32>(0, 0);
for (int i = 0; i < res->nmode; i++)
{
const XRRModeInfo* mode = &res->modes[i];
core::dimension2d<u32> size;
if (crtc->rotation & (XRANDR_ROTATION_LEFT|XRANDR_ROTATION_RIGHT))
{
size = core::dimension2d<u32>(mode->height, mode->width);
}
else
{
size = core::dimension2d<u32>(mode->width, mode->height);
}
if (bestMode == -1 && mode->id == output->modes[0])
{
mode0_size = size;
}
if (bestMode == -1 && size.Width == Width && size.Height == Height)
{
for (int j = 0; j < output->nmode; j++)
{
if (mode->id == output->modes[j])
{
bestMode = j;
refresh_rate = (mode->dotClock * 1000.0) / (mode->hTotal * mode->vTotal);
break;
}
}
}
else if (bestMode != -1 && size.Width == Width && size.Height == Height)
{
refresh_rate_new = (mode->dotClock * 1000.0) / (mode->hTotal * mode->vTotal);
if (refresh_rate_new <= refresh_rate)
break;
for (int j = 0; j < output->nmode; j++)
{
if (mode->id == output->modes[j])
{
bestMode = j;
refresh_rate = refresh_rate_new;
break;
}
}
}
}
// If video mode not found, try to use first available
if (bestMode == -1)
{
bestMode = 0;
Width = mode0_size.Width;
Height = mode0_size.Height;
}
Status s = XRRSetCrtcConfig(display, res, output->crtc, CurrentTime,
crtc->x, crtc->y, output->modes[bestMode],
crtc->rotation, &output_id, 1);
if (s == Success)
UseXRandR = true;
XRRFreeCrtcInfo(crtc);
XRRFreeOutputInfo(output);
XRRFreeScreenResources(res);
break;
}
if (UseXRandR == false)
{
os::Printer::log("Could not get video output. Try to run in windowed mode.", ELL_WARNING);
CreationParams.Fullscreen = false;
}
#endif
return CreationParams.Fullscreen;
}
#if defined(_IRR_COMPILE_WITH_X11_)
void IrrPrintXGrabError(int grabResult, const c8 * grabCommand )
{
if ( grabResult == GrabSuccess )
{
// os::Printer::log(grabCommand, ": GrabSuccess", ELL_INFORMATION);
return;
}
switch ( grabResult )
{
case AlreadyGrabbed:
os::Printer::log(grabCommand, ": AlreadyGrabbed", ELL_WARNING);
break;
case GrabNotViewable:
os::Printer::log(grabCommand, ": GrabNotViewable", ELL_WARNING);
break;
case GrabFrozen:
os::Printer::log(grabCommand, ": GrabFrozen", ELL_WARNING);
break;
case GrabInvalidTime:
os::Printer::log(grabCommand, ": GrabInvalidTime", ELL_WARNING);
break;
default:
os::Printer::log(grabCommand, ": grab failed with unknown problem", ELL_WARNING);
break;
}
}
#endif
static GLXContext getMeAGLContext(Display *display, GLXFBConfig glxFBConfig, bool force_legacy_context)
{
GLXContext Context;
irr::video::useCoreContext = true;
int core43ctxdebug[] =
{
GLX_CONTEXT_MAJOR_VERSION_ARB, 4,
GLX_CONTEXT_MINOR_VERSION_ARB, 3,
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB,
None
};
int core43ctx[] =
{
GLX_CONTEXT_MAJOR_VERSION_ARB, 4,
GLX_CONTEXT_MINOR_VERSION_ARB, 3,
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
None
};
int core33ctxdebug[] =
{
GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
GLX_CONTEXT_MINOR_VERSION_ARB, 3,
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB,
None
};
int core33ctx[] =
{
GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
GLX_CONTEXT_MINOR_VERSION_ARB, 3,
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
None
};
int core31ctxdebug[] =
{
GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
GLX_CONTEXT_MINOR_VERSION_ARB, 1,
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB,
None
};
int core31ctx[] =
{
GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
GLX_CONTEXT_MINOR_VERSION_ARB, 1,
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
None
};
int legacyctx[] =
{
GLX_CONTEXT_MAJOR_VERSION_ARB, 2,
GLX_CONTEXT_MINOR_VERSION_ARB, 1,
None
};
PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB = 0;
glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)
glXGetProcAddressARB( (const GLubyte *) "glXCreateContextAttribsARB" );
if(!force_legacy_context)
{
// create core 4.3 context
os::Printer::log("Creating OpenGL 4.3 context...", ELL_INFORMATION);
Context = glXCreateContextAttribsARB(display, glxFBConfig, 0, True, GLContextDebugBit ? core43ctxdebug : core43ctx);
if (!XErrorSignaled)
return Context;
XErrorSignaled = false;
// create core 3.3 context
os::Printer::log("Creating OpenGL 3.3 context...", ELL_INFORMATION);
Context = glXCreateContextAttribsARB(display, glxFBConfig, 0, True, GLContextDebugBit ? core33ctxdebug : core33ctx);
if (!XErrorSignaled)
return Context;
XErrorSignaled = false;
// create core 3.1 context (for older mesa)
os::Printer::log("Creating OpenGL 3.1 context...", ELL_INFORMATION);
Context = glXCreateContextAttribsARB(display, glxFBConfig, 0, True, GLContextDebugBit ? core31ctxdebug : core31ctx);
if (!XErrorSignaled)
return Context;
} // if(force_legacy_context)
XErrorSignaled = false;
irr::video::useCoreContext = false;
// fall back to legacy context
os::Printer::log("Creating legacy OpenGL 2.1 context...", ELL_INFORMATION);
Context = glXCreateNewContext(display, glxFBConfig, GLX_RGBA_TYPE, NULL, True);
return Context;
}
bool CIrrDeviceLinux::createWindow()
{
#ifdef _IRR_COMPILE_WITH_X11_
os::Printer::log("Creating X window...", ELL_INFORMATION);
XSetErrorHandler(IrrPrintXError);
display = XOpenDisplay(0);
if (!display)
{
os::Printer::log("Error: Need running XServer to start Irrlicht Engine.", ELL_ERROR);
if (XDisplayName(0)[0])
os::Printer::log("Could not open display", XDisplayName(0), ELL_ERROR);
else
os::Printer::log("Could not open display, set DISPLAY variable", ELL_ERROR);
return false;
}
screennr = DefaultScreen(display);
changeResolution();
#ifdef _IRR_COMPILE_WITH_OPENGL_
GLXFBConfig glxFBConfig;
int major, minor;
bool isAvailableGLX=false;
if (CreationParams.DriverType==video::EDT_OPENGL)
{
isAvailableGLX=glXQueryExtension(display,&major,&minor);
if (isAvailableGLX && glXQueryVersion(display, &major, &minor))
{
#ifdef GLX_VERSION_1_3
typedef GLXFBConfig * ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
PFNGLXCHOOSEFBCONFIGPROC glxChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC)glXGetProcAddress(reinterpret_cast<const GLubyte*>("glXChooseFBConfig"));
#else
PFNGLXCHOOSEFBCONFIGPROC glxChooseFBConfig=glXChooseFBConfig;
#endif
if (major==1 && minor>2 && glxChooseFBConfig)
{
// attribute array for the draw buffer
int visualAttrBuffer[] =
{
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_RED_SIZE, 4,
GLX_GREEN_SIZE, 4,
GLX_BLUE_SIZE, 4,
GLX_ALPHA_SIZE, CreationParams.WithAlphaChannel?1:0,
GLX_DEPTH_SIZE, CreationParams.ZBufferBits, //10,11
GLX_DOUBLEBUFFER, CreationParams.Doublebuffer?True:False,
GLX_STENCIL_SIZE, CreationParams.Stencilbuffer?1:0,
#if defined(GLX_VERSION_1_4) && defined(GLX_SAMPLE_BUFFERS) // we need to check the extension string!
GLX_SAMPLE_BUFFERS, 1,
GLX_SAMPLES, CreationParams.AntiAlias, // 18,19
#elif defined(GLX_ARB_multisample)
GLX_SAMPLE_BUFFERS_ARB, 1,
GLX_SAMPLES_ARB, CreationParams.AntiAlias, // 18,19
#elif defined(GLX_SGIS_multisample)
GLX_SAMPLE_BUFFERS_SGIS, 1,
GLX_SAMPLES_SGIS, CreationParams.AntiAlias, // 18,19
#endif
//#ifdef GL_ARB_framebuffer_sRGB
// GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB, CreationParams.HandleSRGB,
//#elif defined(GL_EXT_framebuffer_sRGB)
// GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT, CreationParams.HandleSRGB,
//#endif
GLX_STEREO, CreationParams.Stereobuffer?True:False,
None
};
GLXFBConfig *configList=0;
int nitems=0;
if (CreationParams.AntiAlias<2)
{
visualAttrBuffer[17] = 0;
visualAttrBuffer[19] = 0;
}
// first round with unchanged values
{
configList=glxChooseFBConfig(display, screennr, visualAttrBuffer,&nitems);
if (!configList && CreationParams.AntiAlias)
{
while (!configList && (visualAttrBuffer[19]>1))
{
visualAttrBuffer[19] -= 1;
configList=glxChooseFBConfig(display, screennr, visualAttrBuffer,&nitems);
}
if (!configList)
{
visualAttrBuffer[17] = 0;
visualAttrBuffer[19] = 0;
configList=glxChooseFBConfig(display, screennr, visualAttrBuffer,&nitems);
if (configList)
{
os::Printer::log("No FSAA available.", ELL_WARNING);
CreationParams.AntiAlias=0;
}
else
{
//reenable multisampling
visualAttrBuffer[17] = 1;
visualAttrBuffer[19] = CreationParams.AntiAlias;
}
}
}
}
// Next try with flipped stencil buffer value
// If the first round was with stencil flag it's now without
// Other way round also makes sense because some configs
// only have depth buffer combined with stencil buffer
if (!configList)
{
if (CreationParams.Stencilbuffer)
os::Printer::log("No stencilbuffer available, disabling stencil shadows.", ELL_WARNING);
CreationParams.Stencilbuffer = !CreationParams.Stencilbuffer;
visualAttrBuffer[15]=CreationParams.Stencilbuffer?1:0;
configList=glxChooseFBConfig(display, screennr, visualAttrBuffer,&nitems);
if (!configList && CreationParams.AntiAlias)
{
while (!configList && (visualAttrBuffer[19]>1))
{
visualAttrBuffer[19] -= 1;
configList=glxChooseFBConfig(display, screennr, visualAttrBuffer,&nitems);
}
if (!configList)
{
visualAttrBuffer[17] = 0;
visualAttrBuffer[19] = 0;
configList=glxChooseFBConfig(display, screennr, visualAttrBuffer,&nitems);
if (configList)
{
os::Printer::log("No FSAA available.", ELL_WARNING);
CreationParams.AntiAlias=0;
}
else
{
//reenable multisampling
visualAttrBuffer[17] = 1;
visualAttrBuffer[19] = CreationParams.AntiAlias;
}
}
}
}
// Next try without double buffer
if (!configList && CreationParams.Doublebuffer)
{
os::Printer::log("No doublebuffering available.", ELL_WARNING);
CreationParams.Doublebuffer=false;
visualAttrBuffer[13] = GLX_DONT_CARE;
CreationParams.Stencilbuffer = false;
visualAttrBuffer[15]=0;
configList=glxChooseFBConfig(display, screennr, visualAttrBuffer,&nitems);
if (!configList && CreationParams.AntiAlias)
{
while (!configList && (visualAttrBuffer[19]>1))
{
visualAttrBuffer[19] -= 1;
configList=glxChooseFBConfig(display, screennr, visualAttrBuffer,&nitems);
}
if (!configList)
{
visualAttrBuffer[17] = 0;
visualAttrBuffer[19] = 0;
configList=glxChooseFBConfig(display, screennr, visualAttrBuffer,&nitems);
if (configList)
{
os::Printer::log("No FSAA available.", ELL_WARNING);
CreationParams.AntiAlias=0;
}
else
{
//reenable multisampling
visualAttrBuffer[17] = 1;
visualAttrBuffer[19] = CreationParams.AntiAlias;
}
}
}
}
if (configList)
{
glxFBConfig=configList[0];
XFree(configList);
UseGLXWindow=true;
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
PFNGLXGETVISUALFROMFBCONFIGPROC glxGetVisualFromFBConfig= (PFNGLXGETVISUALFROMFBCONFIGPROC)glXGetProcAddress(reinterpret_cast<const GLubyte*>("glXGetVisualFromFBConfig"));
if (glxGetVisualFromFBConfig)
visual = glxGetVisualFromFBConfig(display,glxFBConfig);
#else
visual = glXGetVisualFromFBConfig(display,glxFBConfig);
#endif
}
}
else
#endif
{
// attribute array for the draw buffer
int visualAttrBuffer[] =
{
GLX_RGBA, GLX_USE_GL,
GLX_RED_SIZE, 4,
GLX_GREEN_SIZE, 4,
GLX_BLUE_SIZE, 4,
GLX_ALPHA_SIZE, CreationParams.WithAlphaChannel?1:0,
GLX_DEPTH_SIZE, CreationParams.ZBufferBits,
GLX_STENCIL_SIZE, CreationParams.Stencilbuffer?1:0, // 12,13
// The following attributes have no flags, but are
// either present or not. As a no-op we use
// GLX_USE_GL, which is silently ignored by glXChooseVisual
CreationParams.Doublebuffer?GLX_DOUBLEBUFFER:GLX_USE_GL, // 14
CreationParams.Stereobuffer?GLX_STEREO:GLX_USE_GL, // 15
//#ifdef GL_ARB_framebuffer_sRGB
// CreationParams.HandleSRGB?GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB:GLX_USE_GL,
//#elif defined(GL_EXT_framebuffer_sRGB)
// CreationParams.HandleSRGB?GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT:GLX_USE_GL,
//#endif
None
};
visual=glXChooseVisual(display, screennr, visualAttrBuffer);
if (!visual)
{
if (CreationParams.Stencilbuffer)
os::Printer::log("No stencilbuffer available, disabling.", ELL_WARNING);
CreationParams.Stencilbuffer = !CreationParams.Stencilbuffer;
visualAttrBuffer[13]=CreationParams.Stencilbuffer?1:0;
visual=glXChooseVisual(display, screennr, visualAttrBuffer);
if (!visual && CreationParams.Doublebuffer)
{
os::Printer::log("No doublebuffering available.", ELL_WARNING);
CreationParams.Doublebuffer=false;
visualAttrBuffer[14] = GLX_USE_GL;
visual=glXChooseVisual(display, screennr, visualAttrBuffer);
}
}
}
}
else
os::Printer::log("No GLX support available. OpenGL driver will not work.", ELL_WARNING);
}
// don't use the XVisual with OpenGL, because it ignores all requested
// properties of the CreationParams
else if (!visual)
#endif // _IRR_COMPILE_WITH_OPENGL_
// create visual with standard X methods
{
os::Printer::log("Using plain X visual");
XVisualInfo visTempl; //Template to hold requested values
int visNumber; // Return value of available visuals
visTempl.screen = screennr;
// ARGB visuals should be avoided for usual applications
visTempl.depth = CreationParams.WithAlphaChannel?32:24;
while ((!visual) && (visTempl.depth>=16))
{
visual = XGetVisualInfo(display, VisualScreenMask|VisualDepthMask,
&visTempl, &visNumber);
visTempl.depth -= 8;
}
}
if (!visual)
{
os::Printer::log("Fatal error, could not get visual.", ELL_ERROR);
XCloseDisplay(display);
display=0;
return false;
}
#ifdef _DEBUG
else
os::Printer::log("Visual chosen: ", core::stringc(static_cast<u32>(visual->visualid)).c_str(), ELL_DEBUG);
#endif
// create color map
Colormap colormap;
colormap = XCreateColormap(display,
RootWindow(display, visual->screen),
visual->visual, AllocNone);
attributes.colormap = colormap;
attributes.border_pixel = 0;
attributes.event_mask = StructureNotifyMask | FocusChangeMask | ExposureMask;
if (!CreationParams.IgnoreInput)
attributes.event_mask |= PointerMotionMask |
ButtonPressMask | KeyPressMask |
ButtonReleaseMask | KeyReleaseMask;
if (!CreationParams.WindowId)
{
Atom *list;
Atom type;
int form;
unsigned long remain, len;
Atom WMCheck = XInternAtom(display, "_NET_SUPPORTING_WM_CHECK", false);
Status s = XGetWindowProperty(display, DefaultRootWindow(display),
WMCheck, 0L, 1L, False, XA_WINDOW,
&type, &form, &len, &remain,
(unsigned char **)&list);
bool netWM = (s == Success) && len;
attributes.override_redirect = !netWM && CreationParams.Fullscreen;
// create new Window
window = XCreateWindow(display,
RootWindow(display, visual->screen),
0, 0, Width, Height, 0, visual->depth,
InputOutput, visual->visual,
CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect,
&attributes);
XMapRaised(display, window);
CreationParams.WindowId = (void*)window;
Atom wmDelete;
wmDelete = XInternAtom(display, wmDeleteWindow, True);
XSetWMProtocols(display, window, &wmDelete, 1);
if (CreationParams.Fullscreen)
{
if (netWM)
{
// Some window managers don't respect values from XCreateWindow and
// place window in random position. This may cause that fullscreen
// window is showed in wrong screen. It doesn't matter for vidmode
// which displays cloned image in all devices.
#ifdef _IRR_LINUX_X11_RANDR_
XResizeWindow(display, window, Width, Height);
XMoveWindow(display, window, crtc_x, crtc_y);
XRaiseWindow(display, window);
XFlush(display);
#endif
// Workaround for Gnome which sometimes creates window smaller than display
XSizeHints *hints = XAllocSizeHints();
hints->flags=PMinSize;
hints->min_width=Width;
hints->min_height=Height;
XSetWMNormalHints(display, window, hints);
XFree(hints);
// Set the fullscreen mode via the window manager. This allows alt-tabing, volume hot keys & others.
// Get the needed atom from there freedesktop names
Atom WMStateAtom = XInternAtom(display, "_NET_WM_STATE", true);
Atom WMFullscreenAtom = XInternAtom(display, "_NET_WM_STATE_FULLSCREEN", true);
// Set the fullscreen property
XChangeProperty(display, window, WMStateAtom, XA_ATOM, 32, PropModeReplace,
reinterpret_cast<unsigned char*>(&WMFullscreenAtom), 1);
// Notify the root window
XEvent xev = {0}; // The event should be filled with zeros before setting its attributes
xev.type = ClientMessage;
xev.xclient.window = window;
xev.xclient.message_type = WMStateAtom;
xev.xclient.format = 32;
xev.xclient.data.l[0] = 1;
xev.xclient.data.l[1] = WMFullscreenAtom;
XSendEvent(display, RootWindow(display, visual->screen), false,
SubstructureRedirectMask | SubstructureNotifyMask, &xev);
XFlush(display);
}
else
{
XSetInputFocus(display, window, RevertToParent, CurrentTime);
int grabKb = XGrabKeyboard(display, window, True, GrabModeAsync,
GrabModeAsync, CurrentTime);
IrrPrintXGrabError(grabKb, "XGrabKeyboard");
int grabPointer = XGrabPointer(display, window, True, ButtonPressMask,
GrabModeAsync, GrabModeAsync, window, None, CurrentTime);
IrrPrintXGrabError(grabPointer, "XGrabPointer");
XWarpPointer(display, None, window, 0, 0, 0, 0, 0, 0);
}
}
}
else
{
// attach external window
window = (Window)CreationParams.WindowId;
if (!CreationParams.IgnoreInput)
{
XCreateWindow(display,
window,
0, 0, Width, Height, 0, visual->depth,
InputOutput, visual->visual,
CWBorderPixel | CWColormap | CWEventMask,
&attributes);
}
XWindowAttributes wa;
XGetWindowAttributes(display, window, &wa);
CreationParams.WindowSize.Width = wa.width;
CreationParams.WindowSize.Height = wa.height;
CreationParams.Fullscreen = false;
ExternalWindow = true;
}
WindowMinimized=false;
// Currently broken in X, see Bug ID 2795321
// XkbSetDetectableAutoRepeat(display, True, &AutorepeatSupport);
#ifdef _IRR_COMPILE_WITH_OPENGL_
// connect glx context to window
Context=0;
if (isAvailableGLX && CreationParams.DriverType==video::EDT_OPENGL)
{
if (UseGLXWindow)
{
glxWin=glXCreateWindow(display,glxFBConfig,window,NULL);
if (glxWin)
{
Context = getMeAGLContext(display, glxFBConfig, CreationParams.ForceLegacyDevice);
if (Context)
{
if (!glXMakeContextCurrent(display, glxWin, glxWin, Context))
{
os::Printer::log("Could not make context current.", ELL_WARNING);
glXDestroyContext(display, Context);
}
}
else
{
os::Printer::log("Could not create GLX rendering context.", ELL_WARNING);
}
}
else
{
os::Printer::log("Could not create GLX window.", ELL_WARNING);
}
}
else
{
Context = glXCreateContext(display, visual, NULL, True);
if (Context)
{
if (!glXMakeCurrent(display, window, Context))
{
os::Printer::log("Could not make context current.", ELL_WARNING);
glXDestroyContext(display, Context);
}
}
else
{
os::Printer::log("Could not create GLX rendering context.", ELL_WARNING);
}
}
}
#endif // _IRR_COMPILE_WITH_OPENGL_
Window tmp;
u32 borderWidth;
int x,y;
unsigned int bits;
XGetGeometry(display, window, &tmp, &x, &y, &Width, &Height, &borderWidth, &bits);
CreationParams.Bits = bits;
CreationParams.WindowSize.Width = Width;
CreationParams.WindowSize.Height = Height;
StdHints = XAllocSizeHints();
long num;
XGetWMNormalHints(display, window, StdHints, &num);
// create an XImage for the software renderer
//(thx to Nadav for some clues on how to do that!)
if (CreationParams.DriverType == video::EDT_SOFTWARE || CreationParams.DriverType == video::EDT_BURNINGSVIDEO)
{
SoftwareImage = XCreateImage(display,
visual->visual, visual->depth,
ZPixmap, 0, 0, Width, Height,
BitmapPad(display), 0);
// use malloc because X will free it later on
if (SoftwareImage)
SoftwareImage->data = (char*) malloc(SoftwareImage->bytes_per_line * SoftwareImage->height * sizeof(char));
}
initXAtoms();
#endif // #ifdef _IRR_COMPILE_WITH_X11_
return true;
}
//! create the driver
void CIrrDeviceLinux::createDriver()
{
switch(CreationParams.DriverType)
{
#ifdef _IRR_COMPILE_WITH_X11_
case video::EDT_SOFTWARE:
#ifdef _IRR_COMPILE_WITH_SOFTWARE_
VideoDriver = video::createSoftwareDriver(CreationParams.WindowSize, CreationParams.Fullscreen, FileSystem, this);
#else
os::Printer::log("No Software driver support compiled in.", ELL_ERROR);
#endif
break;
case video::EDT_BURNINGSVIDEO:
#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_
VideoDriver = video::createBurningVideoDriver(CreationParams, FileSystem, this);
#else
os::Printer::log("Burning's video driver was not compiled in.", ELL_ERROR);
#endif
break;
case video::EDT_OPENGL:
#ifdef _IRR_COMPILE_WITH_OPENGL_
if (Context)
VideoDriver = video::createOpenGLDriver(CreationParams, FileSystem, this);
#else
os::Printer::log("No OpenGL support compiled in.", ELL_ERROR);
#endif
break;
case video::EDT_DIRECT3D8:
case video::EDT_DIRECT3D9:
os::Printer::log("This driver is not available in Linux. Try OpenGL or Software renderer.",
ELL_ERROR);
break;
case video::EDT_NULL:
VideoDriver = video::createNullDriver(FileSystem, CreationParams.WindowSize);
break;
default:
os::Printer::log("Unable to create video driver of unknown type.", ELL_ERROR);
break;
#else
case video::EDT_NULL:
VideoDriver = video::createNullDriver(FileSystem, CreationParams.WindowSize);
break;
default:
os::Printer::log("No X11 support compiled in. Only Null driver available.", ELL_ERROR);
break;
#endif
}
}
//! runs the device. Returns false if device wants to be deleted
bool CIrrDeviceLinux::run()
{
os::Timer::tick();
#ifdef _IRR_COMPILE_WITH_X11_
if ( CursorControl )
static_cast<CCursorControl*>(CursorControl)->update();
if ((CreationParams.DriverType != video::EDT_NULL) && display)
{
SEvent irrevent;
irrevent.MouseInput.ButtonStates = 0xffffffff;
while (XPending(display) > 0 && !Close)
{
XEvent event;
XNextEvent(display, &event);
switch (event.type)
{
case ConfigureNotify:
// check for changed window size
if ((event.xconfigure.width != (int) Width) ||
(event.xconfigure.height != (int) Height))
{
Width = event.xconfigure.width;
Height = event.xconfigure.height;
// resize image data
if (SoftwareImage)
{
XDestroyImage(SoftwareImage);
SoftwareImage = XCreateImage(display,
visual->visual, visual->depth,
ZPixmap, 0, 0, Width, Height,
BitmapPad(display), 0);
// use malloc because X will free it later on
if (SoftwareImage)
SoftwareImage->data = (char*) malloc(SoftwareImage->bytes_per_line * SoftwareImage->height * sizeof(char));
}
if (VideoDriver)
VideoDriver->OnResize(core::dimension2d<u32>(Width, Height));
}
break;
case MapNotify:
WindowMinimized=false;
break;
case UnmapNotify:
WindowMinimized=true;
break;
case FocusIn:
WindowHasFocus=true;
break;
case FocusOut:
WindowHasFocus=false;
break;
case MotionNotify:
irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT;
irrevent.MouseInput.Event = irr::EMIE_MOUSE_MOVED;
irrevent.MouseInput.X = event.xbutton.x;
irrevent.MouseInput.Y = event.xbutton.y;
irrevent.MouseInput.Control = (event.xkey.state & ControlMask) != 0;
irrevent.MouseInput.Shift = (event.xkey.state & ShiftMask) != 0;
// mouse button states
irrevent.MouseInput.ButtonStates = (event.xbutton.state & Button1Mask) ? irr::EMBSM_LEFT : 0;
irrevent.MouseInput.ButtonStates |= (event.xbutton.state & Button3Mask) ? irr::EMBSM_RIGHT : 0;
irrevent.MouseInput.ButtonStates |= (event.xbutton.state & Button2Mask) ? irr::EMBSM_MIDDLE : 0;
postEventFromUser(irrevent);
break;
case ButtonPress:
case ButtonRelease:
irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT;
irrevent.MouseInput.X = event.xbutton.x;
irrevent.MouseInput.Y = event.xbutton.y;
irrevent.MouseInput.Control = (event.xkey.state & ControlMask) != 0;
irrevent.MouseInput.Shift = (event.xkey.state & ShiftMask) != 0;
// mouse button states
// This sets the state which the buttons had _prior_ to the event.
// So unlike on Windows the button which just got changed has still the old state here.
// We handle that below by flipping the corresponding bit later.
irrevent.MouseInput.ButtonStates = (event.xbutton.state & Button1Mask) ? irr::EMBSM_LEFT : 0;
irrevent.MouseInput.ButtonStates |= (event.xbutton.state & Button3Mask) ? irr::EMBSM_RIGHT : 0;
irrevent.MouseInput.ButtonStates |= (event.xbutton.state & Button2Mask) ? irr::EMBSM_MIDDLE : 0;
irrevent.MouseInput.Event = irr::EMIE_COUNT;
switch(event.xbutton.button)
{
case Button1:
irrevent.MouseInput.Event =
(event.type == ButtonPress) ? irr::EMIE_LMOUSE_PRESSED_DOWN : irr::EMIE_LMOUSE_LEFT_UP;
irrevent.MouseInput.ButtonStates ^= irr::EMBSM_LEFT;
break;
case Button3:
irrevent.MouseInput.Event =
(event.type == ButtonPress) ? irr::EMIE_RMOUSE_PRESSED_DOWN : irr::EMIE_RMOUSE_LEFT_UP;
irrevent.MouseInput.ButtonStates ^= irr::EMBSM_RIGHT;
break;
case Button2:
irrevent.MouseInput.Event =
(event.type == ButtonPress) ? irr::EMIE_MMOUSE_PRESSED_DOWN : irr::EMIE_MMOUSE_LEFT_UP;
irrevent.MouseInput.ButtonStates ^= irr::EMBSM_MIDDLE;
break;
case Button4:
if (event.type == ButtonPress)
{
irrevent.MouseInput.Event = EMIE_MOUSE_WHEEL;
irrevent.MouseInput.Wheel = 1.0f;
}
break;
case Button5:
if (event.type == ButtonPress)
{
irrevent.MouseInput.Event = EMIE_MOUSE_WHEEL;
irrevent.MouseInput.Wheel = -1.0f;
}
break;
}
if (irrevent.MouseInput.Event != irr::EMIE_COUNT)
{
postEventFromUser(irrevent);
if ( irrevent.MouseInput.Event >= EMIE_LMOUSE_PRESSED_DOWN && irrevent.MouseInput.Event <= EMIE_MMOUSE_PRESSED_DOWN )
{
u32 clicks = checkSuccessiveClicks(irrevent.MouseInput.X, irrevent.MouseInput.Y, irrevent.MouseInput.Event);
if ( clicks == 2 )
{
irrevent.MouseInput.Event = (EMOUSE_INPUT_EVENT)(EMIE_LMOUSE_DOUBLE_CLICK + irrevent.MouseInput.Event-EMIE_LMOUSE_PRESSED_DOWN);
postEventFromUser(irrevent);
}
else if ( clicks == 3 )
{
irrevent.MouseInput.Event = (EMOUSE_INPUT_EVENT)(EMIE_LMOUSE_TRIPLE_CLICK + irrevent.MouseInput.Event-EMIE_LMOUSE_PRESSED_DOWN);
postEventFromUser(irrevent);
}
}
}
break;
case MappingNotify:
XRefreshKeyboardMapping (&event.xmapping) ;
break;
case KeyRelease:
if (0 == AutorepeatSupport && (XPending( display ) > 0) )
{
// check for Autorepeat manually
// We'll do the same as Windows does: Only send KeyPressed
// So every KeyRelease is a real release
XEvent next_event;
XPeekEvent (event.xkey.display, &next_event);
if ((next_event.type == KeyPress) &&
(next_event.xkey.keycode == event.xkey.keycode) &&
(next_event.xkey.time - event.xkey.time) < 2) // usually same time, but on some systems a difference of 1 is possible
{
/* Ignore the key release event */
break;
}
}
// fall-through in case the release should be handled
case KeyPress:
{
SKeyMap mp;
char buf[8]={0};
XLookupString(&event.xkey, buf, sizeof(buf), &mp.X11Key, NULL);
irrevent.EventType = irr::EET_KEY_INPUT_EVENT;
irrevent.KeyInput.PressedDown = (event.type == KeyPress);
// mbtowc(&irrevent.KeyInput.Char, buf, sizeof(buf));
irrevent.KeyInput.Char = ((wchar_t*)(buf))[0];
irrevent.KeyInput.Control = (event.xkey.state & ControlMask) != 0;
irrevent.KeyInput.Shift = (event.xkey.state & ShiftMask) != 0;
event.xkey.state &= ~(ControlMask|ShiftMask); // ignore shift-ctrl states for figuring out the key
XLookupString(&event.xkey, buf, sizeof(buf), &mp.X11Key, NULL);
const s32 idx = KeyMap.binary_search(mp);
if (idx != -1)
{
irrevent.KeyInput.Key = (EKEY_CODE)KeyMap[idx].Win32Key;
}
else
{
irrevent.KeyInput.Key = (EKEY_CODE)0;
}
if (irrevent.KeyInput.Key == 0)
{
// 1:1 mapping to windows-keys would require testing for keyboard type (us, ger, ...)
// So unless we do that we will have some unknown keys here.
if (idx == -1)
{
os::Printer::log("Could not find EKEY_CODE, using orig. X11 keycode instead", core::stringc(event.xkey.keycode).c_str(), ELL_INFORMATION);
}
else
{
os::Printer::log("EKEY_CODE is 0, using orig. X11 keycode instead", core::stringc(event.xkey.keycode).c_str(), ELL_INFORMATION);
}
// Any value is better than none, that allows at least using the keys.
// Worst case is that some keys will be identical, still better than _all_
// unknown keys being identical.
irrevent.KeyInput.Key = (EKEY_CODE)event.xkey.keycode;
}
postEventFromUser(irrevent);
}
break;
case ClientMessage:
{
char *atom = XGetAtomName(display, event.xclient.message_type);
if (*atom == *wmDeleteWindow)
{
os::Printer::log("Quit message received.", ELL_INFORMATION);
Close = true;
}
else
{
// we assume it's a user message
irrevent.EventType = irr::EET_USER_EVENT;
irrevent.UserEvent.UserData1 = (s32)event.xclient.data.l[0];
irrevent.UserEvent.UserData2 = (s32)event.xclient.data.l[1];
postEventFromUser(irrevent);
}
XFree(atom);
}
break;
case SelectionRequest:
{
XEvent respond;
XSelectionRequestEvent *req = &(event.xselectionrequest);
if ( req->target == XA_STRING)
{
XChangeProperty (display,
req->requestor,
req->property, req->target,
8, // format
PropModeReplace,
(unsigned char*) Clipboard.c_str(),
Clipboard.size());
respond.xselection.property = req->property;
}
else if ( req->target == X_ATOM_TARGETS )
{
long data[2];
data[0] = X_ATOM_TEXT;
data[1] = XA_STRING;
XChangeProperty (display, req->requestor,
req->property, req->target,
8, PropModeReplace,
(unsigned char *) &data,
sizeof (data));
respond.xselection.property = req->property;
}
else
{
respond.xselection.property= None;
}
respond.xselection.type= SelectionNotify;
respond.xselection.display= req->display;
respond.xselection.requestor= req->requestor;
respond.xselection.selection=req->selection;
respond.xselection.target= req->target;
respond.xselection.time = req->time;
XSendEvent (display, req->requestor,0,0,&respond);
XFlush (display);
}
break;
default:
break;
} // end switch
} // end while
}
#endif //_IRR_COMPILE_WITH_X11_
if (!Close)
pollJoysticks();
return !Close;
}
//! Pause the current process for the minimum time allowed only to allow other processes to execute
void CIrrDeviceLinux::yield()
{
struct timespec ts = {0,1};
nanosleep(&ts, NULL);
}
//! Pause execution and let other processes to run for a specified amount of time.
void CIrrDeviceLinux::sleep(u32 timeMs, bool pauseTimer=false)
{
const bool wasStopped = Timer ? Timer->isStopped() : true;
struct timespec ts;
ts.tv_sec = (time_t) (timeMs / 1000);
ts.tv_nsec = (long) (timeMs % 1000) * 1000000;
if (pauseTimer && !wasStopped)
Timer->stop();
nanosleep(&ts, NULL);
if (pauseTimer && !wasStopped)
Timer->start();
}
//! sets the caption of the window
void CIrrDeviceLinux::setWindowCaption(const wchar_t* text)
{
#ifdef _IRR_COMPILE_WITH_X11_
if (CreationParams.DriverType == video::EDT_NULL)
return;
XTextProperty txt;
if (Success==XwcTextListToTextProperty(display, const_cast<wchar_t**>(&text),
1, XStdICCTextStyle, &txt))
{
XSetWMName(display, window, &txt);
XSetWMIconName(display, window, &txt);
XFree(txt.value);
}
#endif
}
//! presents a surface in the client area
bool CIrrDeviceLinux::present(video::IImage* image, void* windowId, core::rect<s32>* srcRect)
{
#ifdef _IRR_COMPILE_WITH_X11_
// this is only necessary for software drivers.
if (!SoftwareImage)
return true;
// thx to Nadav, who send me some clues of how to display the image
// to the X Server.
const u32 destwidth = SoftwareImage->width;
const u32 minWidth = core::min_(image->getDimension().Width, destwidth);
const u32 destPitch = SoftwareImage->bytes_per_line;
video::ECOLOR_FORMAT destColor;
switch (SoftwareImage->bits_per_pixel)
{
case 16:
if (SoftwareImage->depth==16)
destColor = video::ECF_R5G6B5;
else
destColor = video::ECF_A1R5G5B5;
break;
case 24: destColor = video::ECF_R8G8B8; break;
case 32: destColor = video::ECF_A8R8G8B8; break;
default:
os::Printer::log("Unsupported screen depth.");
return false;
}
u8* srcdata = reinterpret_cast<u8*>(image->lock());
u8* destData = reinterpret_cast<u8*>(SoftwareImage->data);
const u32 destheight = SoftwareImage->height;
const u32 srcheight = core::min_(image->getDimension().Height, destheight);
const u32 srcPitch = image->getPitch();
for (u32 y=0; y!=srcheight; ++y)
{
video::CColorConverter::convert_viaFormat(srcdata,image->getColorFormat(), minWidth, destData, destColor);
srcdata+=srcPitch;
destData+=destPitch;
}
image->unlock();
GC gc = DefaultGC(display, DefaultScreen(display));
Window myWindow=window;
if (windowId)
myWindow = reinterpret_cast<Window>(windowId);
XPutImage(display, myWindow, gc, SoftwareImage, 0, 0, 0, 0, destwidth, destheight);
#endif
return true;
}
//! notifies the device that it should close itself
void CIrrDeviceLinux::closeDevice()
{
Close = true;
}
//! returns if window is active. if not, nothing need to be drawn
bool CIrrDeviceLinux::isWindowActive() const
{
return (WindowHasFocus && !WindowMinimized);
}
//! returns if window has focus.
bool CIrrDeviceLinux::isWindowFocused() const
{
return WindowHasFocus;
}
//! returns if window is minimized.
bool CIrrDeviceLinux::isWindowMinimized() const
{
return WindowMinimized;
}
//! returns color format of the window.
video::ECOLOR_FORMAT CIrrDeviceLinux::getColorFormat() const
{
#ifdef _IRR_COMPILE_WITH_X11_
if (visual && (visual->depth != 16))
return video::ECF_R8G8B8;
else
#endif
return video::ECF_R5G6B5;
}
//! Sets if the window should be resizable in windowed mode.
void CIrrDeviceLinux::setResizable(bool resize)
{
#ifdef _IRR_COMPILE_WITH_X11_
if (CreationParams.DriverType == video::EDT_NULL || CreationParams.Fullscreen )
return;
XUnmapWindow(display, window);
if ( !resize )
{
// Must be heap memory because data size depends on X Server
XSizeHints *hints = XAllocSizeHints();
hints->flags=PSize|PMinSize|PMaxSize;
hints->min_width=hints->max_width=hints->base_width=Width;
hints->min_height=hints->max_height=hints->base_height=Height;
XSetWMNormalHints(display, window, hints);
XFree(hints);
}
else
{
XSetWMNormalHints(display, window, StdHints);
}
XMapWindow(display, window);
XFlush(display);
#endif // #ifdef _IRR_COMPILE_WITH_X11_
}
//! Return pointer to a list with all video modes supported by the gfx adapter.
video::IVideoModeList* CIrrDeviceLinux::getVideoModeList()
{
#ifdef _IRR_COMPILE_WITH_X11_
if (!VideoModeList.getVideoModeCount())
{
bool temporaryDisplay = false;
if (!display)
{
display = XOpenDisplay(0);
temporaryDisplay=true;
}
if (display)
{
#if defined(_IRR_LINUX_X11_VIDMODE_) || defined(_IRR_LINUX_X11_RANDR_)
s32 eventbase, errorbase;
s32 defaultDepth=DefaultDepth(display,screennr);
#endif
#ifdef _IRR_LINUX_X11_VIDMODE_
if (XF86VidModeQueryExtension(display, &eventbase, &errorbase))
{
// enumerate video modes
int modeCount;
XF86VidModeModeInfo** modes;
XF86VidModeGetAllModeLines(display, screennr, &modeCount, &modes);
// save current video mode
oldVideoMode = *modes[0];
// find fitting mode
VideoModeList.setDesktop(defaultDepth, core::dimension2d<u32>(
modes[0]->hdisplay, modes[0]->vdisplay));
for (int i = 0; i<modeCount; ++i)
{
VideoModeList.addMode(core::dimension2d<u32>(
modes[i]->hdisplay, modes[i]->vdisplay), defaultDepth);
}
XFree(modes);
}
#endif
#ifdef _IRR_LINUX_X11_RANDR_
output_id = BadRROutput;
old_mode = BadRRMode;
while (XRRQueryExtension(display, &eventbase, &errorbase))
{
XRROutputInfo* output = NULL;
XRRCrtcInfo* crtc = NULL;
crtc_x = crtc_y = -1;
XRRScreenResources* res = XRRGetScreenResources(display, DefaultRootWindow(display));
if (!res)
break;
RROutput primary_id = XRRGetOutputPrimary(display, DefaultRootWindow(display));
for (int i = 0; i < res->noutput; i++)
{
XRROutputInfo* output_tmp = XRRGetOutputInfo(display, res, res->outputs[i]);
if (!output_tmp || !output_tmp->crtc || output_tmp->connection == RR_Disconnected)
{
XRRFreeOutputInfo(output_tmp);
continue;
}
XRRCrtcInfo* crtc_tmp = XRRGetCrtcInfo(display, res, output_tmp->crtc);
if (!crtc_tmp)
{
XRRFreeOutputInfo(output_tmp);
continue;
}
if (res->outputs[i] == primary_id ||
output_id == BadRROutput || crtc_tmp->x < crtc->x ||
(crtc_tmp->x == crtc->x && crtc_tmp->y < crtc->y))
{
XRRFreeCrtcInfo(crtc);
XRRFreeOutputInfo(output);
output = output_tmp;
crtc = crtc_tmp;
output_id = res->outputs[i];
}
else
{
XRRFreeCrtcInfo(crtc_tmp);
XRRFreeOutputInfo(output_tmp);
}
if (res->outputs[i] == primary_id)
break;
}
if (output_id == BadRROutput)
{
os::Printer::log("Could not get video output.", ELL_WARNING);
break;
}
crtc_x = crtc->x;
crtc_y = crtc->y;
for (int i = 0; i < res->nmode; i++)
{
const XRRModeInfo* mode = &res->modes[i];
core::dimension2d<u32> size;
if (crtc->rotation & (XRANDR_ROTATION_LEFT|XRANDR_ROTATION_RIGHT))
{
size = core::dimension2d<u32>(mode->height, mode->width);
}
else
{
size = core::dimension2d<u32>(mode->width, mode->height);
}
for (int j = 0; j < output->nmode; j++)
{
if (mode->id == output->modes[j])
{
VideoModeList.addMode(size, defaultDepth);
break;
}
}
if (mode->id == crtc->mode)
{
old_mode = crtc->mode;
VideoModeList.setDesktop(defaultDepth, size);
}
}
XRRFreeCrtcInfo(crtc);
XRRFreeOutputInfo(output);
XRRFreeScreenResources(res);
break;
}
#endif
}
if (display && temporaryDisplay)
{
XCloseDisplay(display);
display=0;
}
}
#endif
return &VideoModeList;
}
//! Minimize window
void CIrrDeviceLinux::minimizeWindow()
{
#ifdef _IRR_COMPILE_WITH_X11_
XIconifyWindow(display, window, screennr);
#endif
}
//! Maximize window
void CIrrDeviceLinux::maximizeWindow()
{
#ifdef _IRR_COMPILE_WITH_X11_
XMapWindow(display, window);
#endif
}
//! Restore original window size
void CIrrDeviceLinux::restoreWindow()
{
#ifdef _IRR_COMPILE_WITH_X11_
XMapWindow(display, window);
#endif
}
void CIrrDeviceLinux::createKeyMap()
{
// I don't know if this is the best method to create
// the lookuptable, but I'll leave it like that until
// I find a better version.
#ifdef _IRR_COMPILE_WITH_X11_
KeyMap.reallocate(190);
KeyMap.push_back(SKeyMap(XK_BackSpace, KEY_BACK));
KeyMap.push_back(SKeyMap(XK_Tab, KEY_TAB));
KeyMap.push_back(SKeyMap(XK_ISO_Left_Tab, KEY_TAB));
KeyMap.push_back(SKeyMap(XK_Linefeed, 0)); // ???
KeyMap.push_back(SKeyMap(XK_Clear, KEY_CLEAR));
KeyMap.push_back(SKeyMap(XK_Return, KEY_RETURN));
KeyMap.push_back(SKeyMap(XK_Pause, KEY_PAUSE));
KeyMap.push_back(SKeyMap(XK_Scroll_Lock, KEY_SCROLL));
KeyMap.push_back(SKeyMap(XK_Sys_Req, 0)); // ???
KeyMap.push_back(SKeyMap(XK_Escape, KEY_ESCAPE));
KeyMap.push_back(SKeyMap(XK_Insert, KEY_INSERT));
KeyMap.push_back(SKeyMap(XK_Delete, KEY_DELETE));
KeyMap.push_back(SKeyMap(XK_Home, KEY_HOME));
KeyMap.push_back(SKeyMap(XK_Left, KEY_LEFT));
KeyMap.push_back(SKeyMap(XK_Up, KEY_UP));
KeyMap.push_back(SKeyMap(XK_Right, KEY_RIGHT));
KeyMap.push_back(SKeyMap(XK_Down, KEY_DOWN));
KeyMap.push_back(SKeyMap(XK_Prior, KEY_PRIOR));
KeyMap.push_back(SKeyMap(XK_Page_Up, KEY_PRIOR));
KeyMap.push_back(SKeyMap(XK_Next, KEY_NEXT));
KeyMap.push_back(SKeyMap(XK_Page_Down, KEY_NEXT));
KeyMap.push_back(SKeyMap(XK_End, KEY_END));
KeyMap.push_back(SKeyMap(XK_Begin, KEY_HOME));
KeyMap.push_back(SKeyMap(XK_Num_Lock, KEY_NUMLOCK));
KeyMap.push_back(SKeyMap(XK_KP_Space, KEY_SPACE));
KeyMap.push_back(SKeyMap(XK_KP_Tab, KEY_TAB));
KeyMap.push_back(SKeyMap(XK_KP_Enter, KEY_RETURN));
KeyMap.push_back(SKeyMap(XK_KP_F1, KEY_F1));
KeyMap.push_back(SKeyMap(XK_KP_F2, KEY_F2));
KeyMap.push_back(SKeyMap(XK_KP_F3, KEY_F3));
KeyMap.push_back(SKeyMap(XK_KP_F4, KEY_F4));
KeyMap.push_back(SKeyMap(XK_KP_Home, KEY_HOME));
KeyMap.push_back(SKeyMap(XK_KP_Left, KEY_LEFT));
KeyMap.push_back(SKeyMap(XK_KP_Up, KEY_UP));
KeyMap.push_back(SKeyMap(XK_KP_Right, KEY_RIGHT));
KeyMap.push_back(SKeyMap(XK_KP_Down, KEY_DOWN));
KeyMap.push_back(SKeyMap(XK_Print, KEY_PRINT));
KeyMap.push_back(SKeyMap(XK_KP_Prior, KEY_PRIOR));
KeyMap.push_back(SKeyMap(XK_KP_Page_Up, KEY_PRIOR));
KeyMap.push_back(SKeyMap(XK_KP_Next, KEY_NEXT));
KeyMap.push_back(SKeyMap(XK_KP_Page_Down, KEY_NEXT));
KeyMap.push_back(SKeyMap(XK_KP_End, KEY_END));
KeyMap.push_back(SKeyMap(XK_KP_Begin, KEY_HOME));
KeyMap.push_back(SKeyMap(XK_KP_Insert, KEY_INSERT));
KeyMap.push_back(SKeyMap(XK_KP_Delete, KEY_DELETE));
KeyMap.push_back(SKeyMap(XK_KP_Equal, 0)); // ???
KeyMap.push_back(SKeyMap(XK_KP_Multiply, KEY_MULTIPLY));
KeyMap.push_back(SKeyMap(XK_KP_Add, KEY_ADD));
KeyMap.push_back(SKeyMap(XK_KP_Separator, KEY_SEPARATOR));
KeyMap.push_back(SKeyMap(XK_KP_Subtract, KEY_SUBTRACT));
KeyMap.push_back(SKeyMap(XK_KP_Decimal, KEY_DECIMAL));
KeyMap.push_back(SKeyMap(XK_KP_Divide, KEY_DIVIDE));
KeyMap.push_back(SKeyMap(XK_KP_0, KEY_NUMPAD0));
KeyMap.push_back(SKeyMap(XK_KP_1, KEY_NUMPAD1));
KeyMap.push_back(SKeyMap(XK_KP_2, KEY_NUMPAD2));
KeyMap.push_back(SKeyMap(XK_KP_3, KEY_NUMPAD3));
KeyMap.push_back(SKeyMap(XK_KP_4, KEY_NUMPAD4));
KeyMap.push_back(SKeyMap(XK_KP_5, KEY_NUMPAD5));
KeyMap.push_back(SKeyMap(XK_KP_6, KEY_NUMPAD6));
KeyMap.push_back(SKeyMap(XK_KP_7, KEY_NUMPAD7));
KeyMap.push_back(SKeyMap(XK_KP_8, KEY_NUMPAD8));
KeyMap.push_back(SKeyMap(XK_KP_9, KEY_NUMPAD9));
KeyMap.push_back(SKeyMap(XK_F1, KEY_F1));
KeyMap.push_back(SKeyMap(XK_F2, KEY_F2));
KeyMap.push_back(SKeyMap(XK_F3, KEY_F3));
KeyMap.push_back(SKeyMap(XK_F4, KEY_F4));
KeyMap.push_back(SKeyMap(XK_F5, KEY_F5));
KeyMap.push_back(SKeyMap(XK_F6, KEY_F6));
KeyMap.push_back(SKeyMap(XK_F7, KEY_F7));
KeyMap.push_back(SKeyMap(XK_F8, KEY_F8));
KeyMap.push_back(SKeyMap(XK_F9, KEY_F9));
KeyMap.push_back(SKeyMap(XK_F10, KEY_F10));
KeyMap.push_back(SKeyMap(XK_F11, KEY_F11));
KeyMap.push_back(SKeyMap(XK_F12, KEY_F12));
KeyMap.push_back(SKeyMap(XK_Shift_L, KEY_LSHIFT));
KeyMap.push_back(SKeyMap(XK_Shift_R, KEY_RSHIFT));
KeyMap.push_back(SKeyMap(XK_Control_L, KEY_LCONTROL));
KeyMap.push_back(SKeyMap(XK_Control_R, KEY_RCONTROL));
KeyMap.push_back(SKeyMap(XK_Caps_Lock, KEY_CAPITAL));
KeyMap.push_back(SKeyMap(XK_Shift_Lock, KEY_CAPITAL));
KeyMap.push_back(SKeyMap(XK_Meta_L, KEY_LWIN));
KeyMap.push_back(SKeyMap(XK_Meta_R, KEY_RWIN));
KeyMap.push_back(SKeyMap(XK_Alt_L, KEY_LMENU));
KeyMap.push_back(SKeyMap(XK_Alt_R, KEY_RMENU));
KeyMap.push_back(SKeyMap(XK_ISO_Level3_Shift, KEY_RMENU));
KeyMap.push_back(SKeyMap(XK_Menu, KEY_MENU));
KeyMap.push_back(SKeyMap(XK_space, KEY_SPACE));
KeyMap.push_back(SKeyMap(XK_exclam, 0)); //?
KeyMap.push_back(SKeyMap(XK_quotedbl, 0)); //?
KeyMap.push_back(SKeyMap(XK_section, 0)); //?
KeyMap.push_back(SKeyMap(XK_numbersign, KEY_OEM_2));
KeyMap.push_back(SKeyMap(XK_dollar, 0)); //?
KeyMap.push_back(SKeyMap(XK_percent, 0)); //?
KeyMap.push_back(SKeyMap(XK_ampersand, 0)); //?
KeyMap.push_back(SKeyMap(XK_apostrophe, KEY_OEM_7));
KeyMap.push_back(SKeyMap(XK_parenleft, 0)); //?
KeyMap.push_back(SKeyMap(XK_parenright, 0)); //?
KeyMap.push_back(SKeyMap(XK_asterisk, 0)); //?
KeyMap.push_back(SKeyMap(XK_plus, KEY_PLUS)); //?
KeyMap.push_back(SKeyMap(XK_comma, KEY_COMMA)); //?
KeyMap.push_back(SKeyMap(XK_minus, KEY_MINUS)); //?
KeyMap.push_back(SKeyMap(XK_period, KEY_PERIOD)); //?
KeyMap.push_back(SKeyMap(XK_slash, KEY_OEM_2)); //?
KeyMap.push_back(SKeyMap(XK_0, KEY_KEY_0));
KeyMap.push_back(SKeyMap(XK_1, KEY_KEY_1));
KeyMap.push_back(SKeyMap(XK_2, KEY_KEY_2));
KeyMap.push_back(SKeyMap(XK_3, KEY_KEY_3));
KeyMap.push_back(SKeyMap(XK_4, KEY_KEY_4));
KeyMap.push_back(SKeyMap(XK_5, KEY_KEY_5));
KeyMap.push_back(SKeyMap(XK_6, KEY_KEY_6));
KeyMap.push_back(SKeyMap(XK_7, KEY_KEY_7));
KeyMap.push_back(SKeyMap(XK_8, KEY_KEY_8));
KeyMap.push_back(SKeyMap(XK_9, KEY_KEY_9));
KeyMap.push_back(SKeyMap(XK_colon, 0)); //?
KeyMap.push_back(SKeyMap(XK_semicolon, KEY_OEM_1));
KeyMap.push_back(SKeyMap(XK_less, KEY_OEM_102));
KeyMap.push_back(SKeyMap(XK_equal, KEY_PLUS));
KeyMap.push_back(SKeyMap(XK_greater, 0)); //?
KeyMap.push_back(SKeyMap(XK_question, 0)); //?
KeyMap.push_back(SKeyMap(XK_at, KEY_KEY_2)); //?
KeyMap.push_back(SKeyMap(XK_mu, 0)); //?
KeyMap.push_back(SKeyMap(XK_EuroSign, 0)); //?
KeyMap.push_back(SKeyMap(XK_A, KEY_KEY_A));
KeyMap.push_back(SKeyMap(XK_B, KEY_KEY_B));
KeyMap.push_back(SKeyMap(XK_C, KEY_KEY_C));
KeyMap.push_back(SKeyMap(XK_D, KEY_KEY_D));
KeyMap.push_back(SKeyMap(XK_E, KEY_KEY_E));
KeyMap.push_back(SKeyMap(XK_F, KEY_KEY_F));
KeyMap.push_back(SKeyMap(XK_G, KEY_KEY_G));
KeyMap.push_back(SKeyMap(XK_H, KEY_KEY_H));
KeyMap.push_back(SKeyMap(XK_I, KEY_KEY_I));
KeyMap.push_back(SKeyMap(XK_J, KEY_KEY_J));
KeyMap.push_back(SKeyMap(XK_K, KEY_KEY_K));
KeyMap.push_back(SKeyMap(XK_L, KEY_KEY_L));
KeyMap.push_back(SKeyMap(XK_M, KEY_KEY_M));
KeyMap.push_back(SKeyMap(XK_N, KEY_KEY_N));
KeyMap.push_back(SKeyMap(XK_O, KEY_KEY_O));
KeyMap.push_back(SKeyMap(XK_P, KEY_KEY_P));
KeyMap.push_back(SKeyMap(XK_Q, KEY_KEY_Q));
KeyMap.push_back(SKeyMap(XK_R, KEY_KEY_R));
KeyMap.push_back(SKeyMap(XK_S, KEY_KEY_S));
KeyMap.push_back(SKeyMap(XK_T, KEY_KEY_T));
KeyMap.push_back(SKeyMap(XK_U, KEY_KEY_U));
KeyMap.push_back(SKeyMap(XK_V, KEY_KEY_V));
KeyMap.push_back(SKeyMap(XK_W, KEY_KEY_W));
KeyMap.push_back(SKeyMap(XK_X, KEY_KEY_X));
KeyMap.push_back(SKeyMap(XK_Y, KEY_KEY_Y));
KeyMap.push_back(SKeyMap(XK_Z, KEY_KEY_Z));
KeyMap.push_back(SKeyMap(XK_bracketleft, KEY_OEM_4));
KeyMap.push_back(SKeyMap(XK_backslash, KEY_OEM_5));
KeyMap.push_back(SKeyMap(XK_bracketright, KEY_OEM_6));
KeyMap.push_back(SKeyMap(XK_asciicircum, KEY_OEM_5));
KeyMap.push_back(SKeyMap(XK_degree, 0)); //?
KeyMap.push_back(SKeyMap(XK_underscore, KEY_MINUS)); //?
KeyMap.push_back(SKeyMap(XK_grave, KEY_OEM_3));
KeyMap.push_back(SKeyMap(XK_acute, KEY_OEM_6));
KeyMap.push_back(SKeyMap(XK_a, KEY_KEY_A));
KeyMap.push_back(SKeyMap(XK_b, KEY_KEY_B));
KeyMap.push_back(SKeyMap(XK_c, KEY_KEY_C));
KeyMap.push_back(SKeyMap(XK_d, KEY_KEY_D));
KeyMap.push_back(SKeyMap(XK_e, KEY_KEY_E));
KeyMap.push_back(SKeyMap(XK_f, KEY_KEY_F));
KeyMap.push_back(SKeyMap(XK_g, KEY_KEY_G));
KeyMap.push_back(SKeyMap(XK_h, KEY_KEY_H));
KeyMap.push_back(SKeyMap(XK_i, KEY_KEY_I));
KeyMap.push_back(SKeyMap(XK_j, KEY_KEY_J));
KeyMap.push_back(SKeyMap(XK_k, KEY_KEY_K));
KeyMap.push_back(SKeyMap(XK_l, KEY_KEY_L));
KeyMap.push_back(SKeyMap(XK_m, KEY_KEY_M));
KeyMap.push_back(SKeyMap(XK_n, KEY_KEY_N));
KeyMap.push_back(SKeyMap(XK_o, KEY_KEY_O));
KeyMap.push_back(SKeyMap(XK_p, KEY_KEY_P));
KeyMap.push_back(SKeyMap(XK_q, KEY_KEY_Q));
KeyMap.push_back(SKeyMap(XK_r, KEY_KEY_R));
KeyMap.push_back(SKeyMap(XK_s, KEY_KEY_S));
KeyMap.push_back(SKeyMap(XK_t, KEY_KEY_T));
KeyMap.push_back(SKeyMap(XK_u, KEY_KEY_U));
KeyMap.push_back(SKeyMap(XK_v, KEY_KEY_V));
KeyMap.push_back(SKeyMap(XK_w, KEY_KEY_W));
KeyMap.push_back(SKeyMap(XK_x, KEY_KEY_X));
KeyMap.push_back(SKeyMap(XK_y, KEY_KEY_Y));
KeyMap.push_back(SKeyMap(XK_z, KEY_KEY_Z));
KeyMap.push_back(SKeyMap(XK_ssharp, KEY_OEM_4));
KeyMap.push_back(SKeyMap(XK_adiaeresis, KEY_OEM_7));
KeyMap.push_back(SKeyMap(XK_odiaeresis, KEY_OEM_3));
KeyMap.push_back(SKeyMap(XK_udiaeresis, KEY_OEM_1));
KeyMap.push_back(SKeyMap(XK_Super_L, KEY_LWIN));
KeyMap.push_back(SKeyMap(XK_Super_R, KEY_RWIN));
KeyMap.sort();
#endif
}
bool CIrrDeviceLinux::activateJoysticks(core::array<SJoystickInfo> & joystickInfo)
{
#if defined (_IRR_COMPILE_WITH_JOYSTICK_EVENTS_)
joystickInfo.clear();
u32 joystick;
for (joystick = 0; joystick < 32; ++joystick)
{
// The joystick device could be here...
core::stringc devName = "/dev/js";
devName += joystick;
SJoystickInfo returnInfo;
JoystickInfo info;
info.fd = open(devName.c_str(), O_RDONLY);
if (-1 == info.fd)
{
// ...but Ubuntu and possibly other distros
// create the devices in /dev/input
devName = "/dev/input/js";
devName += joystick;
info.fd = open(devName.c_str(), O_RDONLY);
if (-1 == info.fd)
{
// and BSD here
devName = "/dev/joy";
devName += joystick;
info.fd = open(devName.c_str(), O_RDONLY);
}
}
if (-1 == info.fd)
continue;
#ifdef __FreeBSD__
info.axes=2;
info.buttons=2;
#else
ioctl( info.fd, JSIOCGAXES, &(info.axes) );
ioctl( info.fd, JSIOCGBUTTONS, &(info.buttons) );
fcntl( info.fd, F_SETFL, O_NONBLOCK );
#endif
(void)memset(&info.persistentData, 0, sizeof(info.persistentData));
info.persistentData.EventType = irr::EET_JOYSTICK_INPUT_EVENT;
info.persistentData.JoystickEvent.Joystick = ActiveJoysticks.size();
// There's no obvious way to determine which (if any) axes represent a POV
// hat, so we'll just set it to "not used" and forget about it.
info.persistentData.JoystickEvent.POV = 65535;
ActiveJoysticks.push_back(info);
returnInfo.HasGenericName = false;
returnInfo.Joystick = joystick;
returnInfo.PovHat = SJoystickInfo::POV_HAT_UNKNOWN;
returnInfo.Axes = info.axes;
returnInfo.Buttons = info.buttons;
#ifndef __FreeBSD__
char name[80];
ioctl( info.fd, JSIOCGNAME(80), name);
returnInfo.Name = name;
#endif
joystickInfo.push_back(returnInfo);
}
for (joystick = 0; joystick < joystickInfo.size(); ++joystick)
{
char logString[256];
(void)sprintf(logString, "Found joystick %u, %u axes, %u buttons '%s'",
joystick, joystickInfo[joystick].Axes,
joystickInfo[joystick].Buttons, joystickInfo[joystick].Name.c_str());
os::Printer::log(logString, ELL_INFORMATION);
}
return true;
#else
return false;
#endif // _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
}
void CIrrDeviceLinux::pollJoysticks()
{
#if defined (_IRR_COMPILE_WITH_JOYSTICK_EVENTS_)
if (0 == ActiveJoysticks.size())
return;
for (u32 j= 0; j< ActiveJoysticks.size(); ++j)
{
JoystickInfo & info = ActiveJoysticks[j];
#ifdef __FreeBSD__
struct joystick js;
if (read(info.fd, &js, sizeof(js)) == sizeof(js))
{
info.persistentData.JoystickEvent.ButtonStates = js.b1 | (js.b2 << 1); /* should be a two-bit field */
info.persistentData.JoystickEvent.Axis[0] = js.x; /* X axis */
info.persistentData.JoystickEvent.Axis[1] = js.y; /* Y axis */
}
#else
struct js_event event;
while (sizeof(event) == read(info.fd, &event, sizeof(event)))
{
switch(event.type & ~JS_EVENT_INIT)
{
case JS_EVENT_BUTTON:
if (event.value)
info.persistentData.JoystickEvent.ButtonStates |= (1 << event.number);
else
info.persistentData.JoystickEvent.ButtonStates &= ~(1 << event.number);
break;
case JS_EVENT_AXIS:
if (event.number < SEvent::SJoystickEvent::NUMBER_OF_AXES)
info.persistentData.JoystickEvent.Axis[event.number] = event.value;
break;
default:
break;
}
}
#endif
// Send an irrlicht joystick event once per ::run() even if no new data were received.
(void)postEventFromUser(info.persistentData);
}
#endif // _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
}
//! Set the current Gamma Value for the Display
bool CIrrDeviceLinux::setGammaRamp( f32 red, f32 green, f32 blue, f32 brightness, f32 contrast )
{
#if defined(_IRR_LINUX_X11_VIDMODE_) || defined(_IRR_LINUX_X11_RANDR_)
s32 eventbase, errorbase;
#ifdef _IRR_LINUX_X11_VIDMODE_
if (XF86VidModeQueryExtension(display, &eventbase, &errorbase))
{
XF86VidModeGamma gamma;
gamma.red=red;
gamma.green=green;
gamma.blue=blue;
XF86VidModeSetGamma(display, screennr, &gamma);
return true;
}
#endif
#if defined(_IRR_LINUX_X11_VIDMODE_) && defined(_IRR_LINUX_X11_RANDR_)
else
#endif
#ifdef _IRR_LINUX_X11_RANDR_
if (XRRQueryExtension(display, &eventbase, &errorbase))
{
XRRQueryVersion(display, &eventbase, &errorbase); // major, minor
if (eventbase>=1 && errorbase>1)
{
#if (RANDR_MAJOR>1 || RANDR_MINOR>1)
XRRCrtcGamma *gamma = XRRGetCrtcGamma(display, screennr);
if (gamma)
{
*gamma->red=(u16)red;
*gamma->green=(u16)green;
*gamma->blue=(u16)blue;
XRRSetCrtcGamma(display, screennr, gamma);
XRRFreeGamma(gamma);
return true;
}
#endif
}
}
#endif
#endif
return false;
}
//! Get the current Gamma Value for the Display
bool CIrrDeviceLinux::getGammaRamp( f32 &red, f32 &green, f32 &blue, f32 &brightness, f32 &contrast )
{
brightness = 0.f;
contrast = 0.f;
#if defined(_IRR_LINUX_X11_VIDMODE_) || defined(_IRR_LINUX_X11_RANDR_)
s32 eventbase, errorbase;
#ifdef _IRR_LINUX_X11_VIDMODE_
if (XF86VidModeQueryExtension(display, &eventbase, &errorbase))
{
XF86VidModeGamma gamma;
XF86VidModeGetGamma(display, screennr, &gamma);
red = gamma.red;
green = gamma.green;
blue = gamma.blue;
return true;
}
#endif
#if defined(_IRR_LINUX_X11_VIDMODE_) && defined(_IRR_LINUX_X11_RANDR_)
else
#endif
#ifdef _IRR_LINUX_X11_RANDR_
if (XRRQueryExtension(display, &eventbase, &errorbase))
{
XRRQueryVersion(display, &eventbase, &errorbase); // major, minor
if (eventbase>=1 && errorbase>1)
{
#if (RANDR_MAJOR>1 || RANDR_MINOR>1)
XRRCrtcGamma *gamma = XRRGetCrtcGamma(display, screennr);
if (gamma)
{
red = *gamma->red;
green = *gamma->green;
blue= *gamma->blue;
XRRFreeGamma(gamma);
return true;
}
#endif
}
}
#endif
#endif
return false;
}
//! gets text from the clipboard
//! \return Returns 0 if no string is in there.
const c8* CIrrDeviceLinux::getTextFromClipboard() const
{
#if defined(_IRR_COMPILE_WITH_X11_)
if (X_ATOM_CLIPBOARD == None)
{
os::Printer::log("Couldn't access X clipboard", ELL_WARNING);
return 0;
}
Window ownerWindow = XGetSelectionOwner(display, X_ATOM_CLIPBOARD);
if (ownerWindow == window)
{
return Clipboard.c_str();
}
Clipboard = "";
if (ownerWindow == None)
return 0;
Atom selection = XInternAtom(display, "IRR_SELECTION", False);
XConvertSelection(display, X_ATOM_CLIPBOARD, XA_STRING, selection, window, CurrentTime);
const int SELECTION_RETRIES = 500;
int i = 0;
for (i = 0; i < SELECTION_RETRIES; i++)
{
XEvent xevent;
bool res = XCheckTypedWindowEvent(display, window, SelectionNotify, &xevent);
if (res && xevent.xselection.selection == X_ATOM_CLIPBOARD)
break;
usleep(1000);
}
if (i == SELECTION_RETRIES)
{
os::Printer::log("Timed out waiting for SelectionNotify event", ELL_WARNING);
return 0;
}
Atom type;
int format;
unsigned long numItems, dummy;
unsigned char *data;
int result = XGetWindowProperty(display, window, selection, 0, INT_MAX/4,
False, AnyPropertyType, &type, &format,
&numItems, &dummy, &data);
if (result == Success)
Clipboard = (irr::c8*)data;
XFree (data);
return Clipboard.c_str();
#else
return 0;
#endif
}
//! copies text to the clipboard
void CIrrDeviceLinux::copyToClipboard(const c8* text) const
{
#if defined(_IRR_COMPILE_WITH_X11_)
// Actually there is no clipboard on X but applications just say they own the clipboard and return text when asked.
// Which btw. also means that on X you lose clipboard content when closing applications.
Clipboard = text;
XSetSelectionOwner (display, X_ATOM_CLIPBOARD, window, CurrentTime);
XFlush (display);
#endif
}
#ifdef _IRR_COMPILE_WITH_X11_
// return true if the passed event has the type passed in parameter arg
Bool PredicateIsEventType(Display *display, XEvent *event, XPointer arg)
{
if ( event && event->type == *(int*)arg )
{
// os::Printer::log("remove event:", core::stringc((int)arg).c_str(), ELL_INFORMATION);
return True;
}
return False;
}
#endif //_IRR_COMPILE_WITH_X11_
//! Remove all messages pending in the system message loop
void CIrrDeviceLinux::clearSystemMessages()
{
#ifdef _IRR_COMPILE_WITH_X11_
if (CreationParams.DriverType != video::EDT_NULL)
{
XEvent event;
int usrArg = ButtonPress;
while ( XCheckIfEvent(display, &event, PredicateIsEventType, XPointer(&usrArg)) == True ) {}
usrArg = ButtonRelease;
while ( XCheckIfEvent(display, &event, PredicateIsEventType, XPointer(&usrArg)) == True ) {}
usrArg = MotionNotify;
while ( XCheckIfEvent(display, &event, PredicateIsEventType, XPointer(&usrArg)) == True ) {}
usrArg = KeyRelease;
while ( XCheckIfEvent(display, &event, PredicateIsEventType, XPointer(&usrArg)) == True ) {}
usrArg = KeyPress;
while ( XCheckIfEvent(display, &event, PredicateIsEventType, XPointer(&usrArg)) == True ) {}
}
#endif //_IRR_COMPILE_WITH_X11_
}
void CIrrDeviceLinux::initXAtoms()
{
#ifdef _IRR_COMPILE_WITH_X11_
X_ATOM_CLIPBOARD = XInternAtom(display, "CLIPBOARD", False);
X_ATOM_TARGETS = XInternAtom(display, "TARGETS", False);
X_ATOM_UTF8_STRING = XInternAtom (display, "UTF8_STRING", False);
X_ATOM_TEXT = XInternAtom (display, "TEXT", False);
#endif
}
#ifdef _IRR_COMPILE_WITH_X11_
Cursor CIrrDeviceLinux::TextureToMonochromeCursor(irr::video::ITexture * tex, const core::rect<s32>& sourceRect, const core::position2d<s32> &hotspot)
{
XImage * sourceImage = XCreateImage(display, visual->visual,
1, // depth,
ZPixmap, // XYBitmap (depth=1), ZPixmap(depth=x)
0, 0, sourceRect.getWidth(), sourceRect.getHeight(),
32, // bitmap_pad,
0// bytes_per_line (0 means continuos in memory)
);
sourceImage->data = new char[sourceImage->height * sourceImage->bytes_per_line];
XImage * maskImage = XCreateImage(display, visual->visual,
1, // depth,
ZPixmap,
0, 0, sourceRect.getWidth(), sourceRect.getHeight(),
32, // bitmap_pad,
0 // bytes_per_line
);
maskImage->data = new char[maskImage->height * maskImage->bytes_per_line];
// write texture into XImage
video::ECOLOR_FORMAT format = tex->getColorFormat();
u32 bytesPerPixel = video::IImage::getBitsPerPixelFromFormat(format) / 8;
u32 bytesLeftGap = sourceRect.UpperLeftCorner.X * bytesPerPixel;
u32 bytesRightGap = tex->getPitch() - sourceRect.LowerRightCorner.X * bytesPerPixel;
const u8* data = (const u8*)tex->lock(video::ETLM_READ_ONLY, 0);
data += sourceRect.UpperLeftCorner.Y*tex->getPitch();
for ( s32 y = 0; y < sourceRect.getHeight(); ++y )
{
data += bytesLeftGap;
for ( s32 x = 0; x < sourceRect.getWidth(); ++x )
{
video::SColor pixelCol;
pixelCol.setData((const void*)data, format);
data += bytesPerPixel;
if ( pixelCol.getAlpha() == 0 ) // transparent
{
XPutPixel(maskImage, x, y, 0);
XPutPixel(sourceImage, x, y, 0);
}
else // color
{
if ( pixelCol.getAverage() >= 127 )
XPutPixel(sourceImage, x, y, 1);
else
XPutPixel(sourceImage, x, y, 0);
XPutPixel(maskImage, x, y, 1);
}
}
data += bytesRightGap;
}
tex->unlock();
Pixmap sourcePixmap = XCreatePixmap(display, window, sourceImage->width, sourceImage->height, sourceImage->depth);
Pixmap maskPixmap = XCreatePixmap(display, window, maskImage->width, maskImage->height, maskImage->depth);
XGCValues values;
values.foreground = 1;
values.background = 1;
GC gc = XCreateGC( display, sourcePixmap, GCForeground | GCBackground, &values );
XPutImage(display, sourcePixmap, gc, sourceImage, 0, 0, 0, 0, sourceImage->width, sourceImage->height);
XPutImage(display, maskPixmap, gc, maskImage, 0, 0, 0, 0, maskImage->width, maskImage->height);
XFreeGC(display, gc);
XDestroyImage(sourceImage);
XDestroyImage(maskImage);
Cursor cursorResult = 0;
XColor foreground, background;
foreground.red = 65535;
foreground.green = 65535;
foreground.blue = 65535;
foreground.flags = DoRed | DoGreen | DoBlue;
background.red = 0;
background.green = 0;
background.blue = 0;
background.flags = DoRed | DoGreen | DoBlue;
cursorResult = XCreatePixmapCursor(display, sourcePixmap, maskPixmap, &foreground, &background, hotspot.X, hotspot.Y);
XFreePixmap(display, sourcePixmap);
XFreePixmap(display, maskPixmap);
return cursorResult;
}
#ifdef _IRR_LINUX_XCURSOR_
Cursor CIrrDeviceLinux::TextureToARGBCursor(irr::video::ITexture * tex, const core::rect<s32>& sourceRect, const core::position2d<s32> &hotspot)
{
XcursorImage * image = XcursorImageCreate (sourceRect.getWidth(), sourceRect.getHeight());
image->xhot = hotspot.X;
image->yhot = hotspot.Y;
// write texture into XcursorImage
video::ECOLOR_FORMAT format = tex->getColorFormat();
u32 bytesPerPixel = video::IImage::getBitsPerPixelFromFormat(format) / 8;
u32 bytesLeftGap = sourceRect.UpperLeftCorner.X * bytesPerPixel;
u32 bytesRightGap = tex->getPitch() - sourceRect.LowerRightCorner.X * bytesPerPixel;
XcursorPixel* target = image->pixels;
const u8* data = (const u8*)tex->lock(ETLM_READ_ONLY, 0);
data += sourceRect.UpperLeftCorner.Y*tex->getPitch();
for ( s32 y = 0; y < sourceRect.getHeight(); ++y )
{
data += bytesLeftGap;
for ( s32 x = 0; x < sourceRect.getWidth(); ++x )
{
video::SColor pixelCol;
pixelCol.setData((const void*)data, format);
data += bytesPerPixel;
*target = (XcursorPixel)pixelCol.color;
++target;
}
data += bytesRightGap;
}
tex->unlock();
Cursor cursorResult=XcursorImageLoadCursor(display, image);
XcursorImageDestroy(image);
return cursorResult;
}
#endif // #ifdef _IRR_LINUX_XCURSOR_
Cursor CIrrDeviceLinux::TextureToCursor(irr::video::ITexture * tex, const core::rect<s32>& sourceRect, const core::position2d<s32> &hotspot)
{
#ifdef _IRR_LINUX_XCURSOR_
return TextureToARGBCursor( tex, sourceRect, hotspot );
#else
return TextureToMonochromeCursor( tex, sourceRect, hotspot );
#endif
}
#endif // _IRR_COMPILE_WITH_X11_
CIrrDeviceLinux::CCursorControl::CCursorControl(CIrrDeviceLinux* dev, bool null)
: Device(dev)
#ifdef _IRR_COMPILE_WITH_X11_
, PlatformBehavior(gui::ECPB_NONE), lastQuery(0)
#endif
, IsVisible(true), Null(null), UseReferenceRect(false)
, ActiveIcon(gui::ECI_NORMAL), ActiveIconStartTime(0)
{
#ifdef _IRR_COMPILE_WITH_X11_
if (!Null)
{
XGCValues values;
unsigned long valuemask = 0;
XColor fg, bg;
// this code, for making the cursor invisible was sent in by
// Sirshane, thank your very much!
Pixmap invisBitmap = XCreatePixmap(Device->display, Device->window, 32, 32, 1);
Pixmap maskBitmap = XCreatePixmap(Device->display, Device->window, 32, 32, 1);
Colormap screen_colormap = DefaultColormap( Device->display, DefaultScreen( Device->display ) );
XAllocNamedColor( Device->display, screen_colormap, "black", &fg, &fg );
XAllocNamedColor( Device->display, screen_colormap, "white", &bg, &bg );
GC gc = XCreateGC( Device->display, invisBitmap, valuemask, &values );
XSetForeground( Device->display, gc, BlackPixel( Device->display, DefaultScreen( Device->display ) ) );
XFillRectangle( Device->display, invisBitmap, gc, 0, 0, 32, 32 );
XFillRectangle( Device->display, maskBitmap, gc, 0, 0, 32, 32 );
invisCursor = XCreatePixmapCursor( Device->display, invisBitmap, maskBitmap, &fg, &bg, 1, 1 );
XFreeGC(Device->display, gc);
XFreePixmap(Device->display, invisBitmap);
XFreePixmap(Device->display, maskBitmap);
initCursors();
}
#endif
}
CIrrDeviceLinux::CCursorControl::~CCursorControl()
{
// Do not clearCursors here as the display is already closed
// TODO (cutealien): droping cursorcontrol earlier might work, not sure about reason why that's done in stub currently.
}
#ifdef _IRR_COMPILE_WITH_X11_
void CIrrDeviceLinux::CCursorControl::clearCursors()
{
if (!Null)
XFreeCursor(Device->display, invisCursor);
for ( u32 i=0; i < Cursors.size(); ++i )
{
for ( u32 f=0; f < Cursors[i].Frames.size(); ++f )
{
XFreeCursor(Device->display, Cursors[i].Frames[f].IconHW);
}
}
}
void CIrrDeviceLinux::CCursorControl::initCursors()
{
Cursors.push_back( CursorX11(XCreateFontCursor(Device->display, XC_top_left_arrow)) ); // (or XC_arrow?)
Cursors.push_back( CursorX11(XCreateFontCursor(Device->display, XC_crosshair)) );
Cursors.push_back( CursorX11(XCreateFontCursor(Device->display, XC_hand2)) ); // (or XC_hand1? )
Cursors.push_back( CursorX11(XCreateFontCursor(Device->display, XC_question_arrow)) );
Cursors.push_back( CursorX11(XCreateFontCursor(Device->display, XC_xterm)) );
Cursors.push_back( CursorX11(XCreateFontCursor(Device->display, XC_X_cursor)) ); // (or XC_pirate?)
Cursors.push_back( CursorX11(XCreateFontCursor(Device->display, XC_watch)) ); // (or XC_clock?)
Cursors.push_back( CursorX11(XCreateFontCursor(Device->display, XC_fleur)) );
Cursors.push_back( CursorX11(XCreateFontCursor(Device->display, XC_top_right_corner)) ); // NESW not available in X11
Cursors.push_back( CursorX11(XCreateFontCursor(Device->display, XC_top_left_corner)) ); // NWSE not available in X11
Cursors.push_back( CursorX11(XCreateFontCursor(Device->display, XC_sb_v_double_arrow)) );
Cursors.push_back( CursorX11(XCreateFontCursor(Device->display, XC_sb_h_double_arrow)) );
Cursors.push_back( CursorX11(XCreateFontCursor(Device->display, XC_sb_up_arrow)) ); // (or XC_center_ptr?)
}
void CIrrDeviceLinux::CCursorControl::update()
{
if ( (u32)ActiveIcon < Cursors.size() && !Cursors[ActiveIcon].Frames.empty() && Cursors[ActiveIcon].FrameTime )
{
// update animated cursors. This could also be done by X11 in case someone wants to figure that out (this way was just easier to implement)
u32 now = Device->getTimer()->getRealTime();
u32 frame = ((now - ActiveIconStartTime) / Cursors[ActiveIcon].FrameTime) % Cursors[ActiveIcon].Frames.size();
XDefineCursor(Device->display, Device->window, Cursors[ActiveIcon].Frames[frame].IconHW);
}
}
#endif
//! Sets the active cursor icon
void CIrrDeviceLinux::CCursorControl::setActiveIcon(gui::ECURSOR_ICON iconId)
{
#ifdef _IRR_COMPILE_WITH_X11_
if ( iconId >= (s32)Cursors.size() )
return;
if ( Cursors[iconId].Frames.size() )
XDefineCursor(Device->display, Device->window, Cursors[iconId].Frames[0].IconHW);
ActiveIconStartTime = Device->getTimer()->getRealTime();
ActiveIcon = iconId;
#endif
}
//! Add a custom sprite as cursor icon.
gui::ECURSOR_ICON CIrrDeviceLinux::CCursorControl::addIcon(const gui::SCursorSprite& icon)
{
#ifdef _IRR_COMPILE_WITH_X11_
if ( icon.SpriteId >= 0 )
{
CursorX11 cX11;
cX11.FrameTime = icon.SpriteBank->getSprites()[icon.SpriteId].frameTime;
for ( u32 i=0; i < icon.SpriteBank->getSprites()[icon.SpriteId].Frames.size(); ++i )
{
irr::u32 texId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].textureNumber;
irr::u32 rectId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].rectNumber;
irr::core::rect<s32> rectIcon = icon.SpriteBank->getPositions()[rectId];
Cursor cursor = Device->TextureToCursor(icon.SpriteBank->getTexture(texId), rectIcon, icon.HotSpot);
cX11.Frames.push_back( CursorFrameX11(cursor) );
}
Cursors.push_back( cX11 );
return (gui::ECURSOR_ICON)(Cursors.size() - 1);
}
#endif
return gui::ECI_NORMAL;
}
//! replace the given cursor icon.
void CIrrDeviceLinux::CCursorControl::changeIcon(gui::ECURSOR_ICON iconId, const gui::SCursorSprite& icon)
{
#ifdef _IRR_COMPILE_WITH_X11_
if ( iconId >= (s32)Cursors.size() )
return;
for ( u32 i=0; i < Cursors[iconId].Frames.size(); ++i )
XFreeCursor(Device->display, Cursors[iconId].Frames[i].IconHW);
if ( icon.SpriteId >= 0 )
{
CursorX11 cX11;
cX11.FrameTime = icon.SpriteBank->getSprites()[icon.SpriteId].frameTime;
for ( u32 i=0; i < icon.SpriteBank->getSprites()[icon.SpriteId].Frames.size(); ++i )
{
irr::u32 texId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].textureNumber;
irr::u32 rectId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].rectNumber;
irr::core::rect<s32> rectIcon = icon.SpriteBank->getPositions()[rectId];
Cursor cursor = Device->TextureToCursor(icon.SpriteBank->getTexture(texId), rectIcon, icon.HotSpot);
cX11.Frames.push_back( CursorFrameX11(cursor) );
}
Cursors[iconId] = cX11;
}
#endif
}
irr::core::dimension2di CIrrDeviceLinux::CCursorControl::getSupportedIconSize() const
{
// this returns the closest match that is smaller or same size, so we just pass a value which should be large enough for cursors
unsigned int width=0, height=0;
#ifdef _IRR_COMPILE_WITH_X11_
XQueryBestCursor(Device->display, Device->window, 64, 64, &width, &height);
#endif
return core::dimension2di(width, height);
}
} // end namespace
#endif // _IRR_COMPILE_WITH_X11_DEVICE_
|
gpl-3.0
|
CubicVoxel/openspacebox
|
core/src/li/yuri/openspacebox/ingame/object/SectorBeacon.java
|
1828
|
/*
* This file is part of OpenSpaceBox.
* Copyright (C) 2019 by Yuri Becker <hi@yuri.li>
*
* OpenSpaceBox is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenSpaceBox is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenSpaceBox. If not, see <http://www.gnu.org/licenses/>.
*/
package li.yuri.openspacebox.ingame.object;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.math.Circle;
import com.badlogic.gdx.math.MathUtils;
import li.yuri.openspacebox.OpenSpaceBox;
import li.yuri.openspacebox.assetmanagement.asset.SpriteAtlas;
import li.yuri.openspacebox.ingame.controller.GameEventBus;
import lombok.val;
public class SectorBeacon extends AbstractIngameObject<Circle> {
private static final float DIAMETER = 580;
public SectorBeacon(GameEventBus gameEventBus) {
super(gameEventBus, createSprite(), createShape());
}
@Override
public li.yuri.openspacebox.ingame.object.Layer getLayer() {
return Layer.STATIONS;
}
private static Circle createShape() {
val radius = MathUtils.round(DIAMETER / 2);
return new Circle(0, 0, radius);
}
private static Sprite createSprite() {
Sprite sprite = OpenSpaceBox.createSprite(SpriteAtlas.STATION_SECTORBEACON);
sprite.setSize(DIAMETER, DIAMETER);
sprite.setOriginCenter();
return sprite;
}
}
|
gpl-3.0
|
TheOnePharaoh/YGOPro-Custom-Cards
|
script/c99199048.lua
|
2292
|
--Airin, Magical Girl of the Future Gears
function c99199048.initial_effect(c)
c:SetSPSummonOnce(99199048)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(99199048,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_DAMAGE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(c99199048.descon)
e1:SetTarget(c99199048.destg)
e1:SetOperation(c99199048.desop)
c:RegisterEffect(e1)
--atk/lv up
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(99199048,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetOperation(c99199048.operation)
c:RegisterEffect(e2)
--add setcode
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_ADD_SETCODE)
e3:SetValue(0xff16)
c:RegisterEffect(e3)
end
function c99199048.descon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp
end
function c99199048.desfilter(c)
return c:IsDestructable()
end
function c99199048.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c99199048.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c99199048.desfilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c99199048.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c99199048.desop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) and Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)~=0 then
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
function c99199048.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
e1:SetValue(2)
c:RegisterEffect(e1)
end
end
|
gpl-3.0
|
SirFrancisBillard/assorted-gamemodes
|
arena/gamemode/modules/damage/sv_hurtsounds.lua
|
675
|
local function GetGender(ply)
return ply.model_table and ply.model_table.gender or GENDER_MALE
end
hook.Add("EntityTakeDamage", "Arena.HurtSounds", function(ply, dmg)
-- hurt sounds
ply.hurtsound_cooldown = ply.hurtsound_cooldown or 0
if IsValid(ply) and ply:IsPlayer() and ply.hurtsound_cooldown < CurTime() then
ply.hurtsound_cooldown = CurTime() + 1
local hg = ply:LastHitGroup()
local gen = GetGender(ply)
-- this is the order of priority for where something is in the table
local snd_table = GAMEMODE.HurtSounds[hg] or GAMEMODE.HurtSounds[gen][hg] or GAMEMODE.HurtSounds[gen]["generic"]
ply:EmitSound(snd_table[math.random(1, #snd_table)])
end
end)
|
gpl-3.0
|
enabrintain/PandPArcadeGame
|
PintsAndPixelsArcadeGame/Assets/LevelManager.cs
|
308
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class LevelManager : MonoBehaviour {
public void loadLevel(string name){
SceneManager.LoadScene (name);
}
public void quitRequest(){
Application.Quit ();
}
}// LevelManager
|
gpl-3.0
|
colinsheppard/beam
|
src/test/scala/beam/tags/Tags.scala
|
319
|
package beam.tags
import org.scalatest.Tag
object Periodic extends Tag("beam.tags.Periodic")
object Performance extends Tag("beam.tags.Performance")
object Integration extends Tag("beam.tags.Integration")
object Mocked extends Tag("beam.tags.Mocked")
object ExcludeRegular extends Tag("beam.tags.ExcludeRegular")
|
gpl-3.0
|
Metalith/Astrum
|
src/components/mesh.hpp
|
289
|
#ifndef COMPONENT_MESH
#define COMPONENT_MESH
#include <vector>
#include <glfw3.h>
class Mesh : public Component {
public:
int getID() { return 0; }
std::vector<GLfloat> vertices;
std::vector<GLfloat> bounds;
std::vector<GLfloat> normals;
std::vector<int> indices;
};
#endif
|
gpl-3.0
|
darakcheeff/fast
|
fonbet.0.2.js
|
556
|
range = prompt("Укажите пороговое значение:");
a=document.getElementsByTagName("table")[0].children;
for (i = 0; i < a.length; i++) {
for (ii = 1; ii < a[i].children.length; ii++){
for (iii = 2; iii < a[i].children[ii].children.length; iii++) {
if(parseInt(range)<parseInt(a[i].children[ii].children[iii].innerText.split(".")[0])){
a[i].children[ii].children[iii].outerHTML=a[i].children[ii].children[iii].outerHTML.replace('<td', '<td style="background: #f0f000"');
}
}
}}
|
gpl-3.0
|
benjaminfisher/tucker-maxon
|
plugins/i18n_gallery/lang/da.php
|
3509
|
<?php
$i18n = array(
'ADD_IMAGES' => "Tilføj billeder"
, 'ADMIN_SETTINGS_HEADER' => "Administrationspanel"
, 'ADMIN_THUMB_DIMENSIONS' => "Format på miniature"
, 'AUTOSTART' => "Start automatisk billedfremvisning"
, 'BACK' => "Tilbage til oversigt"
, 'BOTTOM' => "Nederst"
, 'CREATE_GALLERY' => "Opret nyt galleri"
, 'CREATE_HEADER' => "Opret nyt galleri"
, 'DEFAULT_THUMB_DIMENSIONS' => "Standardformat på miniature"
, 'DELETE' => "Slet"
, 'DELETEGALLERY_TITLE' => "Slet galleri"
, 'DELETE_CACHE' => "Slet miniature og billedcache"
, 'DELETE_CACHE_FAILURE' => "Miniature og billedcache blev ikke slettet."
, 'DELETE_CACHE_SUCCESS' => "Miniature og billedcache blev slettet. Miniature og billedcache kan gendannes, hvis det ønskes."
, 'DELETE_FAILURE' => "Galleriet blev ikke slettet."
, 'DELETE_ITEM' => "Slet element"
, 'DELETE_SUCCESS' => "Galleriet blev slettet."
, 'DESCRIPTION' => "Beskrivelse"
, 'DIMENSIONS' => "Format"
, 'DONT_INCLUDE_CSS' => "Inkluder ikke CSS"
, 'DONT_INCLUDE_JQUERY' => "Inkluder ikke jQuery"
, 'EDITGALLERY_TITLE' => "Rediger galleri"
, 'EDIT_GALLERY' => "Rediger galleri"
, 'EDIT_HEADER' => "Rediger galleri"
, 'EFFECT' => "Effekter"
, 'ERR_DUPLICATE_NAME' => "Der eksisterer allerede et galleri med samme navn."
, 'ERR_EMPTY_TITLE' => "Indtast en titel."
, 'ERR_INVALID_NAME' => "Indtast venligst et talværdi uden mellemrum."
, 'ERR_NO_IMAGES' => "Tilføj mindst et billede."
, 'FILENAME' => "Filnavn"
, 'GALLERIES' => "Gennemse alle gallerier"
, 'GALLERY_CODE' => "Inkluder kode på side"
, 'GALLERY_OPTIONS' => "Galleriindstillinger"
, 'GALLERY_TITLE' => "Titel"
, 'IMAGE' => "Billede"
, 'INTERVAL' => "Tid mellem fremvisninger (ms)"
, 'LANGUAGE' => "Sprog"
, 'LEFT' => "Venstre"
, 'MAX_DIMENSIONS' => "Største billedformat"
, 'MAX_THUMB_DIMENSIONS' => "Største format på miniaturer"
, 'MISSING_DIR' => "Den nødvendige mappe blev ikke oprettet. Opret venligst mappenstrukturen: data/i18n_gallery and data/backups/i18n_gallery."
, 'NAME' => "Navn"
, 'NEXT' => "Næste billede"
, 'NO_TEXT' => "--- ingen tekst ---"
, 'OVERVIEW_DESCR' => "Du har defineret følgende gallerier."
, 'OVERVIEW_HEADER' => "Galleristyring"
, 'PREV' => "Foregående billede"
, 'RIGHT' => "Højre"
, 'SAVE_FAILURE' => "Galleriet blev ikke gemt."
, 'SAVE_GALLERY' => "Gem galleri"
, 'SAVE_SETTINGS' => "Gem indstillinger"
, 'SAVE_SETTINGS_FAILURE' => "Indstillinger blev ikke gemt."
, 'SAVE_SETTINGS_SUCCESS' => "Indstillinger blev gemt."
, 'SAVE_SUCCESS' => "Galleriet blev gemt."
, 'SETTINGS' => "Indstillinger"
, 'SETTINGS_DESCR' => "Her kan du justere fremvisningsindstillinger for I18N Gallery."
, 'SETTINGS_HEADER' => "Fremvisningstilstand"
, 'SIZE' => "Omfang"
, 'TAB' => "Gallerier"
, 'TAGS' => "Etiket"
, 'TEXT_POSITION' => "Tekstplacering"
, 'TEXT_WIDTH' => "Tekstbredde eller -højde"
, 'THEME' => "Udseende"
, 'TITLE' => "Titel"
, 'TOP' => "Øverst"
, 'TYPE' => "Galleri"
, 'UNDO_FAILURE' => "Galleriet blev ikke gendannet."
, 'UNDO_SETTINGS_FAILURE' => "Indstillinger blev ikke gendannet."
, 'UNDO_SETTINGS_SUCCESS' => "Instillinger blev gendannet."
, 'UNDO_SUCCESS' => "Galleriet blev gendannet."
, 'NAVIGATION_DOTS' => "Punkttegn"
, 'NAVIGATION_NUMBERS' => "Tal"
, 'NAVIGATION_TYPE' => "Navigationstype"
, 'SHOW_THUMB_TITLES' => "Vis titel under miniaturer"
, 'VIEWGALLERY_TITLE' => "Gennemse galleri"
, 'CROP' => "Beskær"
);
|
gpl-3.0
|
Spaner/TrackIt
|
src/main/java/com/trackit/presentation/event/EventManager.java
|
3001
|
/*
* This file is part of Track It!.
* Copyright (C) 2013 Henrique Malheiro
* Copyright (C) 2015 Pedro Gomes
*
* TrackIt! is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Track It! is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Track It!. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.trackit.presentation.event;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.log4j.Logger;
import com.trackit.business.domain.DocumentItem;
public class EventManager {
private static EventManager eventManager;
private List<EventListener> eventListeners;
private Logger logger = Logger.getLogger(EventManager.class.getName());
private EventManager() {
eventListeners = new ArrayList<EventListener>();
}
public synchronized static EventManager getInstance() {
if (eventManager == null) {
eventManager = new EventManager();
}
return eventManager;
}
public void register(EventListener listener) {
eventListeners.add(listener);
}
public synchronized void publish(final EventPublisher publisher, final Event event, final DocumentItem item) {
logger.trace( String.format( "Event to dispatch: %s, received from %s", event, publisher));
for (EventListener listener : eventListeners) {
if (!listener.equals(publisher)) {
listener.process(event, item);
logEvent(event, listener, publisher);
}
}
}
private void logEvent(Event event, EventListener listener, EventPublisher publisher) {
if (event.equals(Event.TRACKPOINT_HIGHLIGHTED)) {
//58406 - comment logger to simplify debug
// logger.trace(String.format("Dispatching event %s to %s from %s.", event, listener, publisher));
} else {
//58406 - comment logger to simplify debug
// logger.debug(String.format("Dispatching event %s to %s from %s.", event, listener, publisher));
}
}
public synchronized void publish(final EventPublisher publisher, final Event event,
final DocumentItem parent, final List<? extends DocumentItem> items) {
for (EventListener listener : eventListeners) {
if (!listener.equals(publisher)) {
listener.process(event, parent, items);
//58406 - comment logger to simplify debug
//12335: 2017-07-15: substituted "parent" by "parent.getDocumentItemName"
// logger.debug(String.format("Dispatching list event %s with parent %s to %s.", event, parent, listener));
// logger.debug(String.format("Dispatching list event %s with parent %s to %s.",
// event, parent.getDocumentItemName(), listener));
}
}
}
}
|
gpl-3.0
|
sachin36987/google_drive_remote-upload_php
|
driveScriptt/vendor/google/apiclient-services/src/Google/Service/ManufacturerCenter.php
|
3994
|
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* Service definition for ManufacturerCenter (v1).
*
* <p>
* Public API for managing Manufacturer Center related data.</p>
*
* <p>
* For more information about this service, see the API
* <a href="https://developers.google.com/manufacturers/" target="_blank">Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_Service_ManufacturerCenter extends Google_Service
{
/** Manage your product listings for Google Manufacturer Center. */
const MANUFACTURERCENTER =
"https://www.googleapis.com/auth/manufacturercenter";
public $accounts_products;
/**
* Constructs the internal representation of the ManufacturerCenter service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client)
{
parent::__construct($client);
$this->rootUrl = 'https://content-manufacturers.googleapis.com/';
$this->servicePath = '';
$this->version = 'v1';
$this->serviceName = 'manufacturers';
$this->accounts_products = new Google_Service_ManufacturerCenter_Resource_AccountsProducts(
$this,
$this->serviceName,
'products',
array(
'methods' => array(
'delete' => array(
'path' => 'v1/{+parent}/products/{+name}',
'httpMethod' => 'DELETE',
'parameters' => array(
'parent' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'name' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
),
),'get' => array(
'path' => 'v1/{+parent}/products/{+name}',
'httpMethod' => 'GET',
'parameters' => array(
'parent' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'name' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
),
),'list' => array(
'path' => 'v1/{+parent}/products',
'httpMethod' => 'GET',
'parameters' => array(
'parent' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'pageToken' => array(
'location' => 'query',
'type' => 'string',
),
'pageSize' => array(
'location' => 'query',
'type' => 'integer',
),
),
),'update' => array(
'path' => 'v1/{+parent}/products/{+name}',
'httpMethod' => 'PUT',
'parameters' => array(
'parent' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
'name' => array(
'location' => 'path',
'type' => 'string',
'required' => true,
),
),
),
)
)
);
}
}
|
gpl-3.0
|
hornetmj/CUBRID-MySQL-adapter-testcase
|
unit/cubrid_cci/cci_bind_param_array.cc
|
2023
|
#include <cas_cci.h>
#include "gtest/gtest.h"
class CCI_Bind_Param_Array : public ::testing::Test {
protected:
int conn_handle;
int req_handle;
int exec_retval;
T_CCI_ERROR err_buf;
static char *create_tbl;
static char *drop_tbl;
static char *insert_tbl;
virtual void SetUp () {
conn_handle = cci_connect ((char *)"127.0.0.1",
33700,
(char *)"demodb",
(char *)"dba",
(char *)"");
cci_prepare_and_execute (conn_handle, drop_tbl, 0, &exec_retval, &err_buf);
cci_prepare_and_execute (conn_handle, create_tbl, 0, &exec_retval, &err_buf);
req_handle = cci_prepare (conn_handle, insert_tbl, 0, &err_buf);
}
virtual void TearDown () {
cci_prepare_and_execute (conn_handle, drop_tbl, 0, &exec_retval, &err_buf);
cci_disconnect (conn_handle, &err_buf);
}
};
char *CCI_Bind_Param_Array::create_tbl= "create table cci_bind_param_array (c1 int)";
char *CCI_Bind_Param_Array::insert_tbl = "insert into cci_bind_param_array values (?)";
char *CCI_Bind_Param_Array::drop_tbl = "drop table cci_bind_param_array if exist";
TEST_F(CCI_Bind_Param_Array, Basic) {
int ret;
int data[10];
int null_ind[10]; /* 0: not NULL, 1: NULL */
ASSERT_LE(0, req_handle);
ret = cci_bind_param_array_size (req_handle, 10);
ASSERT_EQ(0, ret);
ret = cci_bind_param_array (req_handle,
1,
CCI_A_TYPE_INT, data, null_ind,
CCI_U_TYPE_INT);
EXPECT_EQ(0, ret);
}
TEST_F(CCI_Bind_Param_Array, Function_Sequence) {
int ret;
int data[10];
int null_ind[10]; /* 0: not NULL, 1: NULL */
ASSERT_LE(0, req_handle);
ret = cci_bind_param_array (req_handle,
1,
CCI_A_TYPE_INT, data, null_ind,
CCI_U_TYPE_INT);
EXPECT_EQ(-20024, ret);
}
|
gpl-3.0
|
MarcosFernandez/heatmapUCSC
|
bedGraphToBed9/bedGraphToBed9.cpp
|
5349
|
/*
* main.cpp
*
* Created on: 25 Out, 2013
* Author: marcos
*/
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <sstream>
#include <algorithm>
#include <math.h>
using namespace std;
struct heatMapSettings
{
std::vector <std::string> vHeatMapColors;
float fMinThresshold;
float fMaxThresshold;
};
static std::vector<std::string> split(std::string s, char delim, std::vector<std::string> elems)
{
std::stringstream ss(s);
std::string item;
while(std::getline(ss, item, delim)) {
elems.push_back(item);
}
return elems;
}
static std::vector<std::string> split(const std::string &s, char delim)
{
std::vector<std::string> elems;
return split(s, delim, elems);
}
/**
* \brief Test if a file exitst
*/
bool fexists(const char *filename)
{
ifstream ifile(filename);
return ifile;
}
/**
* \brief Test File Names
*/
bool testFile(string file)
{
if(!fexists(file.c_str()))
{
cout << "Sorry!! Bed file was not defined or the file: " << file.c_str() <<" does not exists !!" << endl;
return false;
}
return true;
}
/**
* \brief Print Help File
*/
void printHelp()
{
cout << "bedGraphToBed9 Translates from BedGraph to BED9 heatMap format" << endl;
cout << "USAGE: bedGraphToBed9 bedGraphFile bedOutputFile listColorsFile minThershhold maxThershhold" << endl;
cout << "Example: bedGraphToBed9 example.graph.bed example.heatmap.bed example.colors 1 10 "<< endl;
}
/**
* \brief Initialization heatMap structure
* \param heatMapConf heatMapSettings reference structure
* \param string name reference for list colors file,
* \param float min threshhold value
* \param float max threshhold value
* \return false if some values was not correct
*/
bool setHeatMapConf(heatMapSettings & heatMapConf,string & listColorsFile,float min, float max)
{
//1.CLEAR vector string values
heatMapConf.vHeatMapColors.clear();
//2.SET THRESHHOLDS
heatMapConf.fMaxThresshold = max;
heatMapConf.fMinThresshold = min;
//3.ADD STRING r,g,b coordinates
int nRGBCoordinates = 0;
ifstream inColorsFile;
inColorsFile.open(listColorsFile.c_str());
string lineRead = "";
if (inColorsFile.is_open())
{
if (inColorsFile.good())
{
getline (inColorsFile,lineRead);
}
while ( ! lineRead.empty())
{
heatMapConf.vHeatMapColors.push_back(lineRead);
nRGBCoordinates ++;
getline (inColorsFile,lineRead);
}
}
inColorsFile.close();
//4.TEST NUMBER OF rgb coordinates
if(nRGBCoordinates == 10)
{
return true;
}
return false;
}
/**
* \brief Returns a Heat Map RGB Color coordinate from a score value and a range of value
* \param $score Given score values
* \param $maxValue Maximum possible value
* \param $minValue Minimum possible value
* \return string rgb color coordinate
*/
string getHeatMapColor(float fScore, heatMapSettings & heatMapConf)
{
//1.Boundaries correction
if(fScore > heatMapConf.fMaxThresshold)
{
fScore = heatMapConf.fMaxThresshold;
}
else if(fScore < heatMapConf.fMinThresshold)
{
fScore = heatMapConf.fMinThresshold;
}
//2.Index Color
float fTotal = heatMapConf.fMaxThresshold - heatMapConf.fMinThresshold;
float fNumericPoint = fScore - heatMapConf.fMinThresshold;
unsigned int nColorNumber = (unsigned int) round((fNumericPoint/fTotal)*10);
//3 Extreme limits correction
if(nColorNumber > 9)
{
nColorNumber = 9;
}
else if(nColorNumber < 0)
{
nColorNumber = 0;
}
return heatMapConf.vHeatMapColors[nColorNumber];
}
/**
* \brief From bedGraph line and it assignedl color builds a Bed9 file
* \param fields bedGraphLine read bed graph input line
* \param color rgb color coordinate for the given bed graph line
* \return BED9 line
*/
string buildNewBed9Line(vector<string> & fields, string & color)
{
return fields[0]+string("\t")+fields[1]+string("\t")+fields[2]+string("\theatMap\t0\t.\t")+fields[1]+string("\t")+fields[2]+string("\t")+color;
}
/**
* \brief main function
*/
int main(int argc, char *argv[])
{
//1.TEST ARGUMENTS
if(argc != 6)
{
printHelp();
return 0;
}
//2.ARGUMENTS
string sBedGraphFile = argv[1];
string sBedOutputFile = argv[2];
string sListColorsFile = argv[3];
float fMinThershhold = atof(argv[4]);
float fMaxThershhold = atof(argv[5]);
//3.TEST BEDGRAPH INPUT FILE
if(!testFile(sBedGraphFile))
{
return 0;
}
//3.REMOVE PREVIOUSLY CRETED GOAL FILES
if(fexists(sBedOutputFile.c_str()))
{
remove(sBedOutputFile.c_str());
}
//5.HEAT MAP CONFIGURATION SET UP
heatMapSettings setHeatMap;
if(!setHeatMapConf(setHeatMap,sListColorsFile,fMinThershhold, fMaxThershhold))
{
cout << "Sorry!! List of Colors files must have 10 rgb coordinates!!" << endl;
return 0;
}
//6. READ BED GRAPH INPUT FILE
ifstream inBedGraph;
inBedGraph.open(sBedGraphFile.c_str());
string lineRead = "";
std::ofstream outFile(sBedOutputFile.c_str(), std::ios_base::app | std::ios_base::out);
if (inBedGraph.is_open())
{
if (inBedGraph.good())
{
getline (inBedGraph,lineRead);
}
while ( ! lineRead.empty())
{
vector<string> fields = split(lineRead, '\t');
string sColor = getHeatMapColor(atof(fields[3].c_str()),setHeatMap);
outFile << buildNewBed9Line(fields, sColor) << endl;
getline (inBedGraph,lineRead);
}
}
//7. CLOSE INPUT AND OUTPUT FILES
inBedGraph.close();
outFile.close();
return 1;
}
|
gpl-3.0
|
Platonymous/Stardew-Valley-Mods
|
NoSoilDecayRedux/Config.cs
|
122
|
namespace NoSoilDecayRedux
{
public class Config
{
public bool farmonly { get; set; } = false;
}
}
|
gpl-3.0
|
oksigenasu/antrian
|
Admin/panggilnomer - Copy.php
|
1225
|
<?php
//session_start();
include "../koneksi.php";
$id=$_POST['id'];
$nobaru = 0;
?>
<?php
//ambil daftar antrian
$q3=mysql_query("select * from alamat order by nomor desc");
//jika tidak ada antrian
if(mysql_num_rows($q3)<=0)
{
//tidak ada yang antri
echo "<h1>Tidak ada Nomor Antrian</h1>";
}
else //jika ada antrian
{
$d3=mysql_fetch_array($q3);
$nobatas=$d3['nomor'];
//ambil nmr antrian di tabel nokini
$q2=mysql_query("select * from nokini order by no_kini desc");
// jika ada antrian
if(mysql_num_rows($q2)>0)
{
$d2=mysql_fetch_array($q2);
$nolama=$d2['no_kini'];
if($nolama>=$nobatas)
{
$nokini=$nobatas;
echo "<h1>Nomor Antrian Selesai</h1>";
//$adaantrian = 0;
}
else
{
global $nobaru, $adaantrian;
$nobaru=$nolama+1;
$loket=$id;
mysql_query("insert into nokini (no_kini,loket) values ('$nobaru','$loket')");
echo "<h1>Nomor Antrian $nobaru di loket $loket</h1>";
}
}
else
{
global $nobaru, $adaantrian;
$nobaru=1;
$loket=$id;
mysql_query("insert into nokini (no_kini,loket) values ('$nobaru','$loket')");
echo "<h1>Nomor Antrian $nobaru di loket $loket</h1>";
}
}
?>
|
gpl-3.0
|
momentarylapse/tsunami
|
src/View/Dialog/TuningDialog.cpp
|
2286
|
/*
* TuningDialog.cpp
*
* Created on: 11.02.2016
* Author: michi
*/
#include "TuningDialog.h"
#include "../../Data/Track.h"
TuningDialog::TuningDialog(hui::Window *_parent, Track *t) :
hui::Window("tuning_dialog", _parent)
{
track = t;
tuning = track->instrument.string_pitch;
gui_num_strings = 0;
update();
event("ok", [=]{ on_ok(); });
event("cancel", [=]{ request_destroy(); });
event("hui:close", [=]{ request_destroy(); });
event("add_first", [=]{ on_add_first(); });
}
void TuningDialog::update() {
for (int i=tuning.num; i<gui_num_strings; i++) {
string id = format("string%d", i);
remove_control(id);
remove_control(id + "_label");
remove_control("delete_" + id);
remove_control("add_" + id);
}
remove_control("add_first");
set_target("td_g_tuning");
foreachi(int t, tuning, i) {
string id = format("string%d", i);
if (i >= gui_num_strings) {
add_label(i2s(i+1), 0, 100 - i, id + "_label");
add_combo_box("", 1, 100 - i, id);
add_button("", 2, 100 - i, "delete_" + id);
set_image("delete_" + id, "hui:delete");
add_button("", 3, 100 - i, "add_" + id);
set_image("add_" + id, "hui:add");
event(id, [=]{ on_edit(); });
event("delete_" + id, [=]{ on_delete(); });
event("add_" + id, [=]{ on_add(); });
// reverse order list... nicer gui
for (int p=MAX_PITCH-1; p>=0; p--)
set_string(id, pitch_name(p));
}
set_int(id, MAX_PITCH - 1 - t);
}
if (tuning.num == 0) {
add_button("", 0, 0, "add_first");
set_image("add_first", "hui:add");
}
gui_num_strings = tuning.num;
}
void TuningDialog::on_ok() {
Instrument i = track->instrument;
i.string_pitch = tuning;
track->set_instrument(i);
request_destroy();
}
void TuningDialog::on_edit() {
string id = hui::GetEvent()->id;
int n = id.sub(6)._int();
int p = MAX_PITCH - 1 - get_int(id);
tuning[n] = p;
}
void TuningDialog::on_delete() {
string id = hui::GetEvent()->id;
int n = id.sub(7+6)._int();
tuning.erase(n);
hui::RunLater(0.001f, [=]{ update(); });
}
void TuningDialog::on_add() {
string id = hui::GetEvent()->id;
int n = id.sub(4+6)._int();
tuning.insert(tuning[n], n);
hui::RunLater(0.001f, [=]{ update(); });
}
void TuningDialog::on_add_first() {
tuning.add(69);
hui::RunLater(0.001f, [=]{ update(); });
}
|
gpl-3.0
|
warlof/slackbot
|
src/resources/views/access/includes/subs/corporation-mapping-tab.blade.php
|
1304
|
<table class="table table-condensed table-hover table-responsive">
<thead>
<tr>
<th>{{ trans('slackbot::seat.corporation') }}</th>
<th>{{ trans('slackbot::seat.channel') }}</th>
<th>{{ trans('slackbot::seat.created') }}</th>
<th>{{ trans('slackbot::seat.updated') }}</th>
<th>{{ trans('slackbot::seat.status') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($channelCorporations as $channel)
<tr>
<td>{{ $channel->corporation->name }}</td>
<td>{{ $channel->channel->name }}</td>
<td>{{ $channel->created_at }}</td>
<td>{{ $channel->updated_at }}</td>
<td>{{ $channel->enable }}</td>
<td>
<div class="btn-group">
<form method="post" action="{{ route('slackbot.corporation.remove', ['corporation_id' => $channel->corporation_id, 'channel_id' => $channel->channel_id]) }}">
{{ csrf_field() }}
{{ method_field('DELETE') }}
<button type="submit" class="btn btn-danger btn-xs col-xs-12">{{ trans('web::seat.remove') }}</button>
</form>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
|
gpl-3.0
|
SPCoffey/OpenSourceParty
|
OpenSourceParty/Properties/AssemblyInfo.cs
|
1406
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenSourceParty")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OpenSourceParty")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("4f78ad6b-bc3d-4c1e-a712-7d157d739071")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
gpl-3.0
|
tukusejssirs/eSpievatko
|
spievatko/espievatko/prtbl/srv/php-5.5.11/ext/standard/tests/url/parse_url_basic_002.phpt
|
5675
|
--TEST--
Test parse_url() function: Parse a load of URLs without specifying PHP_URL_SCHEME as the URL component
--FILE--
<?php
/* Prototype : proto mixed parse_url(string url, [int url_component])
* Description: Parse a URL and return its components
* Source code: ext/standard/url.c
* Alias to functions:
*/
/*
* Parse a load of URLs without specifying PHP_URL_SCHEME as the URL component
*/
include_once(dirname(__FILE__) . '/urls.inc');
foreach ($urls as $url) {
echo "--> $url : ";
var_dump(parse_url($url, PHP_URL_SCHEME));
}
echo "Done";
?>
--EXPECTF--
--> 64.246.30.37 : NULL
--> http://64.246.30.37 : string(4) "http"
--> http://64.246.30.37/ : string(4) "http"
--> 64.246.30.37/ : NULL
--> 64.246.30.37:80/ : NULL
--> php.net : NULL
--> php.net/ : NULL
--> http://php.net : string(4) "http"
--> http://php.net/ : string(4) "http"
--> www.php.net : NULL
--> www.php.net/ : NULL
--> http://www.php.net : string(4) "http"
--> http://www.php.net/ : string(4) "http"
--> www.php.net:80 : NULL
--> http://www.php.net:80 : string(4) "http"
--> http://www.php.net:80/ : string(4) "http"
--> http://www.php.net/index.php : string(4) "http"
--> www.php.net/? : NULL
--> www.php.net:80/? : NULL
--> http://www.php.net/? : string(4) "http"
--> http://www.php.net:80/? : string(4) "http"
--> http://www.php.net:80/index.php : string(4) "http"
--> http://www.php.net:80/foo/bar/index.php : string(4) "http"
--> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : string(4) "http"
--> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2¶meters=3&too=4&here=5 : string(4) "http"
--> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : string(4) "http"
--> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : string(4) "http"
--> http://www.php.net:80/this/../a/../deep/directory : string(4) "http"
--> http://www.php.net:80/this/../a/../deep/directory/ : string(4) "http"
--> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : string(4) "http"
--> http://www.php.net:80/index.php : string(4) "http"
--> http://www.php.net:80/index.php? : string(4) "http"
--> http://www.php.net:80/#foo : string(4) "http"
--> http://www.php.net:80/?# : string(4) "http"
--> http://www.php.net:80/?test=1 : string(4) "http"
--> http://www.php.net/?test=1& : string(4) "http"
--> http://www.php.net:80/?& : string(4) "http"
--> http://www.php.net:80/index.php?test=1& : string(4) "http"
--> http://www.php.net/index.php?& : string(4) "http"
--> http://www.php.net:80/index.php?foo& : string(4) "http"
--> http://www.php.net/index.php?&foo : string(4) "http"
--> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : string(4) "http"
--> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL
--> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http"
--> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http"
--> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http"
--> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http"
--> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http"
--> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http"
--> nntp://news.php.net : string(4) "nntp"
--> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : string(3) "ftp"
--> zlib:http://foo@bar : string(4) "zlib"
--> zlib:filename.txt : string(4) "zlib"
--> zlib:/path/to/my/file/file.txt : string(4) "zlib"
--> foo://foo@bar : string(3) "foo"
--> mailto:me@mydomain.com : string(6) "mailto"
--> /foo.php?a=b&c=d : NULL
--> foo.php?a=b&c=d : NULL
--> http://user:passwd@www.example.com:8080?bar=1&boom=0 : string(4) "http"
--> file:///path/to/file : string(4) "file"
--> file://path/to/file : string(4) "file"
--> file:/path/to/file : string(4) "file"
--> http://1.2.3.4:/abc.asp?a=1&b=2 : string(4) "http"
--> http://foo.com#bar : string(4) "http"
--> scheme: : string(6) "scheme"
--> foo+bar://baz@bang/bla : string(7) "foo+bar"
--> gg:9130731 : string(2) "gg"
--> http://user:@pass@host/path?argument?value#etc : string(4) "http"
--> http://10.10.10.10/:80 : string(4) "http"
--> http://x:? : string(4) "http"
--> x:blah.com : string(1) "x"
--> x:/blah.com : string(1) "x"
--> x://::abc/? : bool(false)
--> http://::? : string(4) "http"
--> http://::# : string(4) "http"
--> x://::6.5 : string(1) "x"
--> http://?:/ : string(4) "http"
--> http://@?:/ : string(4) "http"
--> file:///: : string(4) "file"
--> file:///a:/ : string(4) "file"
--> file:///ab:/ : string(4) "file"
--> file:///a:/ : string(4) "file"
--> file:///@:/ : string(4) "file"
--> file:///:80/ : string(4) "file"
--> [] : NULL
--> http://[x:80]/ : string(4) "http"
--> : NULL
--> / : NULL
--> http:///blah.com : bool(false)
--> http://:80 : bool(false)
--> http://user@:80 : bool(false)
--> http://user:pass@:80 : bool(false)
--> http://: : bool(false)
--> http://@/ : bool(false)
--> http://@:/ : bool(false)
--> http://:/ : bool(false)
--> http://? : bool(false)
--> http://# : bool(false)
--> http://?: : bool(false)
--> http://:? : bool(false)
--> http://blah.com:123456 : bool(false)
--> http://blah.com:abcdef : bool(false)
Done
|
gpl-3.0
|
storri/libreverse
|
reverse/data_containers/control_flow_graph_sequence.cpp
|
5339
|
/* control_flow_graph_sequence.cpp
Copyright (C) 2008 Stephen Torri
This file is part of Libreverse.
Libreverse is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3, or (at your
option) any later version.
Libreverse is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see
<http://www.gnu.org/licenses/>.
*/
#include <reverse/data_containers/control_flow_graph_sequence.hpp>
#include <reverse/data_containers/control_flow_graph.hpp>
#include <reverse/errors/internal_exception.hpp>
#include <reverse/data_containers/basic_block.hpp>
#include <reverse/preconditions.hpp>
#include <reverse/trace.hpp>
#include <boost/format.hpp>
#include <boost/graph/topological_sort.hpp>
namespace reverse {
namespace data_containers {
control_flow_graph_sequence::control_flow_graph_sequence ()
{
trace::data_containers_detail ( "Inside control_flow_graph_sequence constructor" );
}
control_flow_graph_sequence::control_flow_graph_sequence ( control_flow_graph_sequence const& rhs )
{
trace::data_containers_detail ( "Entering control_flow_graph_sequence copy constructor" );
for ( control_flow_graph_sequence::sequence_t::const_iterator cpos = rhs.m_graph_list.begin();
cpos != rhs.m_graph_list.end();
++cpos ) {
boost::shared_ptr < const control_flow_graph > cfg_ptr = ( *cpos );
boost::shared_ptr < control_flow_graph > copied_cfg_ptr ( new data_containers::control_flow_graph ( *cfg_ptr ) );
m_graph_list.push_back ( copied_cfg_ptr );
}
trace::data_containers_detail ( "Exiting control_flow_graph_sequence copy constructor" );
}
void
control_flow_graph_sequence::add_control_flow_graph ( boost::shared_ptr< control_flow_graph >& input_block_ptr )
{
trace::data_containers_detail ( "Entering control_flow_graph_sequence::add_Control_Flow_Graph" );
reverse::preconditions::is_set ( input_block_ptr );
m_graph_list.push_back ( input_block_ptr );
trace::data_containers_detail ( "Exiting control_flow_graph_sequence::add_Control_Flow_Graph" );
}
control_flow_graph_sequence::sequence_t::iterator
control_flow_graph_sequence::begin()
{
return m_graph_list.begin();
}
control_flow_graph_sequence::sequence_t::iterator
control_flow_graph_sequence::end()
{
return m_graph_list.end();
}
control_flow_graph_sequence::sequence_t::const_iterator
control_flow_graph_sequence::begin() const
{
return m_graph_list.begin();
}
control_flow_graph_sequence::sequence_t::const_iterator
control_flow_graph_sequence::end() const
{
return m_graph_list.end();
}
size_t control_flow_graph_sequence::size() const
{
return m_graph_list.size();
}
bool
control_flow_graph_sequence::empty () const
{
trace::data_containers_detail ( "Inside control_flow_graph_sequence::empty ()" );
return m_graph_list.empty();
}
control_flow_graph_sequence&
control_flow_graph_sequence::operator= ( control_flow_graph_sequence const& rhs )
{
trace::data_containers_detail ( "Entering control_flow_graph_sequence::operator= (assignment)" );
control_flow_graph_sequence temp ( rhs );
swap ( temp );
trace::data_containers_detail ( "Exiting control_flow_graph_sequence::operator= (assignment)" );
return *this;
}
void
control_flow_graph_sequence::swap ( control_flow_graph_sequence& rhs )
{
trace::data_containers_detail ( "Entering control_flow_graph_sequence::swap" );
m_graph_list.swap ( rhs.m_graph_list );
trace::data_containers_detail ( "Exiting control_flow_graph_sequence::swap" );
}
std::ostream& operator<< ( std::ostream& os, control_flow_graph_sequence const& rhs )
{
trace::data_containers_detail ( "Entering control_flow_graph_sequence::to_String" );
trace::data_containers_data ( "Control Flow Graph count: %1%", rhs.size() );
for ( control_flow_graph_sequence::sequence_t::const_iterator cpos = rhs.begin();
cpos != rhs.end();
++cpos ) {
boost::shared_ptr < control_flow_graph > cfg_ptr = ( *cpos );
// print out text version of graph
os << cfg_ptr << std::endl;
}
trace::data_containers_detail ( "Exiting control_flow_graph_sequence::to_String" );
return os;
}
} /* namespace data_containers */
} /* namespace reverse */
|
gpl-3.0
|
YoannLaala/GorillaEngine
|
Sources/Engine/Renderer/Resource/RenderTarget.hpp
|
2399
|
#ifndef _RENDERER_RENDER_TARGET_HPP_
#define _RENDERER_RENDER_TARGET_HPP_
/******************************************************************************
** Includes
******************************************************************************/
#include <Renderer/Resource/Resource.hpp>
/******************************************************************************
** Forward Declaration
******************************************************************************/
namespace Gorilla { namespace Renderer
{
class Renderer;
class Texture2D;
class Texture3D;
class Buffer;
}}
/******************************************************************************
** Class Declaration
******************************************************************************/
namespace Gorilla { namespace Renderer
{
class RenderTarget : public Resource
{
friend class Renderer;
struct EEntry
{
enum Type : uint8
{
Target = 0,
DepthStencil,
Output,
Count,
};
};
public:
DECLARE_RESOURCE(EResource::RenderTarget);
private:
RenderTarget();
~RenderTarget();
void Initiliaze(Renderer* _pRenderer);
virtual void Release () override;
public:
inline uint32 GetTargetCount () const { return m_aResource[EEntry::Target].GetSize(); }
void AddTarget (Texture2D* _pTexture);
inline Texture2D* GetTarget (uint32 _uiIndex) { return static_cast<Texture2D*>(m_aResource[EEntry::Target][_uiIndex]); }
inline Texture2D* GetDepthStencil () { return static_cast<Texture2D*>(m_aResource[EEntry::DepthStencil][0]); }
void SetDepthStencil (Texture2D* _pTexture);
inline uint32 GetOutputCount () const { return m_aResource[EEntry::Output].GetSize(); }
void AddOutput (Buffer* _pBuffer);
void AddOutput (Texture2D* _pTexture);
void AddOutput (Texture3D* _pTexture);
inline void* GetOutput (uint32 _uiIndex) { return m_aResource[EEntry::Output][_uiIndex]; }
void Clear ();
private:
inline Vector<void*>& GetVecTargetView () { return m_aView[EEntry::Target]; }
inline void* GetDepthStencilView () { return m_aView[EEntry::DepthStencil].GetSize() ? m_aView[EEntry::DepthStencil][0] : NULL; }
inline Vector<void*>& GetVecOutputView () { return m_aView[EEntry::Output]; }
private:
Vector<void*> m_aResource[EEntry::Count];
Vector<void*> m_aView[EEntry::Count];
Renderer* m_pRenderer;
};
}}
#endif
|
gpl-3.0
|
tsokalo/ghn-plc
|
ghn-plc/model/ghn-plc-fulld-phy-pmd.cc
|
9724
|
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2013 TUD
*
* Created on: 25.06.2013
* Author: Stanislav Mudriievskyi <stanislav.mudriievskyi@tu-dresden.de>
*/
#include "ns3/log.h"
#include "ns3/nstime.h"
#include "ns3/simulator.h"
#include "ghn-plc-fulld-phy-pmd.h"
NS_LOG_COMPONENT_DEFINE ("GhnPlcPhyPmdFullD");
namespace ns3
{
namespace ghn {
NS_OBJECT_ENSURE_REGISTERED (GhnPlcPhyPmdFullD);
TypeId
GhnPlcPhyPmdFullD::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::GhnPlcPhyPmdFullD") .SetParent<PLC_InfRateFDPhy> () .AddConstructor<GhnPlcPhyPmdFullD> ();
return tid;
}
GhnPlcPhyPmdFullD::GhnPlcPhyPmdFullD ()
{
NS_LOG_FUNCTION (this);
SetBandplan (GDOTHN_BANDPLAN_25MHZ);
SetHeaderModulationAndCodingScheme (ModulationAndCodingScheme (QAM4, CODING_RATE_1_2, 0));
m_incommingFrameSize = 0;
}
GhnPlcPhyPmdFullD::~GhnPlcPhyPmdFullD ()
{
NS_LOG_FUNCTION_NOARGS ();
}
void
GhnPlcPhyPmdFullD::SetBandplan (BandPlanType bandplan)
{
m_bandplan = bandplan;
}
BandPlanType
GhnPlcPhyPmdFullD::GetBandplan (void)
{
return m_bandplan;
}
bool
GhnPlcPhyPmdFullD::Send (Ptr<Packet> txPhyFrame, GhnPlcPhyFrameType frameType, uint8_t headerSymbols, uint32_t payloadSymbols)
{
NS_LOG_FUNCTION (this << txPhyFrame);
//Append preamble
NS_LOG_LOGIC ("Adding preamble...");
txPhyFrame->AddHeader (PLC_Preamble ());
// Create meta information object
Ptr<PLC_TrxMetaInfo> metaInfo = Create<PLC_TrxMetaInfo> ();
metaInfo->SetMessage (txPhyFrame);
metaInfo->SetFrame (txPhyFrame);
metaInfo->SetHeaderDuration (PLC_Phy::GetHeaderSymbolDuration () * headerSymbols);
metaInfo->SetPayloadDuration (PLC_Phy::GetSymbolDuration () * payloadSymbols);
metaInfo->SetHeaderMcs (GetHeaderModulationAndCodingScheme ());
metaInfo->SetPayloadMcs (GetPayloadModulationAndCodingScheme ());
Time tx_duration = metaInfo->GetHeaderDuration () + metaInfo->GetPayloadDuration () + PLC_Preamble::GetDuration ();
NS_LOG_LOGIC ("header_duration: " << metaInfo->GetHeaderDuration ());
NS_LOG_LOGIC ("payload_duration: " << metaInfo->GetPayloadDuration ());
NS_LOG_LOGIC ("preamble_duration: " << PLC_Preamble::GetDuration ());
NS_LOG_LOGIC ("tx_duration: " << tx_duration);
DoStartTx (metaInfo);
}
void
GhnPlcPhyPmdFullD::SetPhyPma (Ptr<GhnPlcPhyPma> ghnPhyPma)
{
m_ghnPhyPma = ghnPhyPma;
}
Ptr<GhnPlcPhyPma>
GhnPlcPhyPmdFullD::GetPhyPma (void)
{
return m_ghnPhyPma;
}
void
GhnPlcPhyPmdFullD::StartReception (uint32_t txId, Ptr<const SpectrumValue> rxPsd, Time duration, Ptr<const PLC_TrxMetaInfo> metaInfo)
{
NS_LOG_FUNCTION (this << txId << rxPsd << duration << metaInfo);
NS_LOG_INFO ("Starting frame reception...");
// Determine uncoded header bits
ModulationAndCodingScheme header_mcs = metaInfo->GetHeaderMcs ();
size_t uncoded_header_bits = GDOTHN_PHY_HEADER * 8;
// Receive header
Time header_duration = metaInfo->GetHeaderDuration ();
NS_LOG_LOGIC ("header duration: " << header_duration);
// header is not FEC encoded => no coding overhead
m_information_rate_model->SetCodingOverhead (0);
m_information_rate_model->StartRx (header_mcs, rxPsd, uncoded_header_bits);
Simulator::Schedule (header_duration, &GhnPlcPhyPmdFullD::EndRxHeader, this, txId, rxPsd, metaInfo);
}
void
GhnPlcPhyPmdFullD::EndRxHeader (uint32_t txId, Ptr<const SpectrumValue> rxPsd, Ptr<const PLC_TrxMetaInfo> metaInfo)
{
NS_LOG_FUNCTION (this << metaInfo << GetState ());
if (GetState () == IDLE) return;
NS_ASSERT_MSG (GetState () == RX || GetState () == TXRX, "PHY state: " << GetState());
ModulationAndCodingScheme payload_mcs = metaInfo->GetPayloadMcs ();
Time payload_duration = metaInfo->GetPayloadDuration ();
SetPayloadModulationAndCodingScheme (payload_mcs);
if (m_information_rate_model->EndRx ())
{
NS_LOG_INFO ("Successfully received header, starting payload reception");
ModulationAndCodingScheme payload_mcs = metaInfo->GetPayloadMcs ();
// Remove PHY header common core part
m_incoming_frame->RemoveHeader (m_rxPhyHeaderCoreCommon);
GhnPlcPhyFrameType frameType = m_rxPhyHeaderCoreCommon.GetFrameType ();
GhnPlcPhyFrameHeaderCoreVariableMapRmap header201;
GhnPlcPhyFrameHeaderCoreVariableMsg header202;
GhnPlcPhyFrameHeaderCoreVariableAck header203;
GhnPlcPhyFrameHeaderCoreVariableRts header204;
GhnPlcPhyFrameHeaderCoreVariableCts header205;
GhnPlcPhyFrameHeaderCoreVariableCtmg header206;
GhnPlcPhyFrameHeaderCoreVariableProbe header207;
GhnPlcPhyFrameHeaderCoreVariableAckrq header208;
GhnPlcPhyFrameHeaderCoreVariableBmsg header209;
GhnPlcPhyFrameHeaderCoreVariableBack header210;
GhnPlcPhyFrameHeaderCoreVariableActmg header211;
GhnPlcPhyFrameHeaderCoreVariableFte header212;
switch (frameType)
{
case PHY_FRAME_MAP_RMAP:
m_incoming_frame->RemoveHeader (header201);
break;
case PHY_FRAME_MSG:
m_incoming_frame->RemoveHeader (header202);
break;
case PHY_FRAME_ACK:
m_incoming_frame->RemoveHeader (header202);
m_incoming_frame->RemoveHeader (header203);
break;
case PHY_FRAME_RTS:
m_incoming_frame->RemoveHeader (header204);
break;
case PHY_FRAME_CTS:
m_incoming_frame->RemoveHeader (header205);
break;
case PHY_FRAME_CTMG:
m_incoming_frame->RemoveHeader (header206);
break;
case PHY_FRAME_PROBE:
m_incoming_frame->RemoveHeader (header207);
break;
case PHY_FRAME_ACKRQ:
m_incoming_frame->RemoveHeader (header208);
break;
case PHY_FRAME_BMSG:
m_incoming_frame->RemoveHeader (header209);
break;
case PHY_FRAME_BACK:
m_incoming_frame->RemoveHeader (header210);
break;
case PHY_FRAME_ACTMG:
m_incoming_frame->RemoveHeader (header211);
break;
case PHY_FRAME_FTE:
m_incoming_frame->RemoveHeader (header212);
break;
}
GhnPlcPhyFrameHeaderCoreCommonHcs header3;
m_incoming_frame->RemoveHeader (header3);
// If header is rateless encoded take coding overhead into account for reception
if (payload_mcs.ct >= CODING_RATE_RATELESS)
{
m_information_rate_model->SetCodingOverhead (GetRatelessCodingOverhead ());
}
else
{
m_information_rate_model->SetCodingOverhead (0);
}
NS_LOG_INFO ("Remaining rx time: " << payload_duration);
size_t uncoded_payload_bits = m_incoming_frame->GetSize () * 8;
m_incommingFrameSize = uncoded_payload_bits;
if ((frameType == PHY_FRAME_ACK) || (frameType == PHY_FRAME_RTS) || (frameType == PHY_FRAME_CTS) || (frameType
== PHY_FRAME_CTMG) || (frameType == PHY_FRAME_ACKRQ) || (frameType == PHY_FRAME_ACTMG) || (frameType
== PHY_FRAME_FTE)) uncoded_payload_bits = 0;
NS_LOG_LOGIC ("Starting payload reception: " << payload_duration << payload_mcs << uncoded_payload_bits);
// NS_LOG_UNCOND ("Starting payload reception: " << payload_duration << payload_mcs << uncoded_payload_bits);
m_incoming_frame->AddHeader (header3);
switch (frameType)
{
case PHY_FRAME_MAP_RMAP:
m_incoming_frame->AddHeader (header201);
break;
case PHY_FRAME_MSG:
m_incoming_frame->AddHeader (header202);
break;
case PHY_FRAME_ACK:
m_incoming_frame->AddHeader (header203);
m_incoming_frame->AddHeader (header202);
break;
case PHY_FRAME_RTS:
m_incoming_frame->AddHeader (header204);
break;
case PHY_FRAME_CTS:
m_incoming_frame->AddHeader (header205);
break;
case PHY_FRAME_CTMG:
m_incoming_frame->AddHeader (header206);
break;
case PHY_FRAME_PROBE:
m_incoming_frame->AddHeader (header207);
break;
case PHY_FRAME_ACKRQ:
m_incoming_frame->AddHeader (header208);
break;
case PHY_FRAME_BMSG:
m_incoming_frame->AddHeader (header209);
break;
case PHY_FRAME_BACK:
m_incoming_frame->AddHeader (header210);
break;
case PHY_FRAME_ACTMG:
m_incoming_frame->AddHeader (header211);
break;
case PHY_FRAME_FTE:
m_incoming_frame->AddHeader (header212);
break;
}
m_incoming_frame->AddHeader (m_rxPhyHeaderCoreCommon);
m_information_rate_model->StartRx (payload_mcs, rxPsd, uncoded_payload_bits);
Simulator::Schedule (payload_duration, &GhnPlcPhyPmdFullD::EndRxPayload, this, metaInfo);
Simulator::Schedule (payload_duration, &PLC_InfRateFDPhy::ChangeState, this, IDLE);
}
else
{
NS_LOG_INFO ("Header reception failed, remaining signal treated as interference");
NoiseStart (txId, rxPsd, payload_duration);
Simulator::Schedule (payload_duration, &PLC_InfRateFDPhy::ReceptionFailure, this);
ChangeState (IDLE);
}
}
void
GhnPlcPhyPmdFullD::EndRxPayload (Ptr<const PLC_TrxMetaInfo> metaInfo)
{
NS_LOG_FUNCTION(this);
if (m_information_rate_model->EndRx ())
{
// Successful payload reception
NS_LOG_INFO ("Message successfully decoded");
NS_LOG_LOGIC ("Decoded packet: " << *m_incoming_frame);
if (!m_receive_success_cb.IsNull ())
{
m_receive_success_cb (metaInfo->GetMessage (), m_rxFch.GetMessageId ());
}
NotifySuccessfulReception ();
m_incoming_frame = 0;
}
else
{
NS_LOG_INFO ("Not able to decode datagram");
NotifyPayloadReceptionFailed (metaInfo);
ReceptionFailure ();
}
}
}
} // namespace ns3
|
gpl-3.0
|
Dalan94/Super_Martin
|
Super_Martin/doc/html/search/files_5.js
|
748
|
var searchData=
[
['main_2ec',['main.c',['../main_8c.html',1,'']]],
['map_2ec',['map.c',['../map_8c.html',1,'']]],
['map_2eh',['map.h',['../map_8h.html',1,'']]],
['menu_2ec',['menu.c',['../menu_8c.html',1,'']]],
['menu_2eh',['menu.h',['../menu_8h.html',1,'']]],
['menu_5flevel_2ec',['menu_level.c',['../menu__level_8c.html',1,'']]],
['menu_5flevel_2eh',['menu_level.h',['../menu__level_8h.html',1,'']]],
['menu_5foption_2ec',['menu_option.c',['../menu__option_8c.html',1,'']]],
['menu_5foption_2eh',['menu_option.h',['../menu__option_8h.html',1,'']]],
['mobile_5fplatform_2ec',['mobile_platform.c',['../mobile__platform_8c.html',1,'']]],
['mobile_5fplatform_2eh',['mobile_platform.h',['../mobile__platform_8h.html',1,'']]]
];
|
gpl-3.0
|
droidefense/engine
|
mods/memapktool/src/main/java/org/jf/dexlib2/dexbacked/instruction/DexBackedInstruction35mi.java
|
3118
|
/*
* Copyright 2013, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.jf.dexlib2.dexbacked.instruction;
import org.jf.dexlib2.Opcode;
import org.jf.dexlib2.dexbacked.DexBackedDexFile;
import org.jf.dexlib2.iface.instruction.formats.Instruction35mi;
import org.jf.util.NibbleUtils;
public class DexBackedInstruction35mi extends DexBackedInstruction implements Instruction35mi {
public DexBackedInstruction35mi(DexBackedDexFile dexFile,
Opcode opcode,
int instructionStart) {
super(dexFile, opcode, instructionStart);
}
@Override
public int getRegisterCount() {
return NibbleUtils.extractHighUnsignedNibble(dexFile.readUbyte(instructionStart + 1));
}
@Override
public int getRegisterC() {
return NibbleUtils.extractLowUnsignedNibble(dexFile.readUbyte(instructionStart + 4));
}
@Override
public int getRegisterD() {
return NibbleUtils.extractHighUnsignedNibble(dexFile.readUbyte(instructionStart + 4));
}
@Override
public int getRegisterE() {
return NibbleUtils.extractLowUnsignedNibble(dexFile.readUbyte(instructionStart + 5));
}
@Override
public int getRegisterF() {
return NibbleUtils.extractHighUnsignedNibble(dexFile.readUbyte(instructionStart + 5));
}
@Override
public int getRegisterG() {
return NibbleUtils.extractLowUnsignedNibble(dexFile.readUbyte(instructionStart + 1));
}
@Override
public int getInlineIndex() {
return dexFile.readUshort(instructionStart + 2);
}
}
|
gpl-3.0
|
tastyproject/tasty
|
tasty/tests/functional/protocols/conversions/unsigned-homomorphic-garbled-unsigned/protocol_online_server.py
|
521
|
from tasty.types import conversions
from tasty.types import *
from tasty.types.driver import TestDriver
__params__ = {'la': 32, 'lb': 32, 'dima': 10, 'dimb': 10}
driver = TestDriver()
def protocol(client, server, params):
server.b = Unsigned(bitlen=233, empty=True, signed=False, dim=[1]).input(src=driver, desc='b')
server.b.output(dest=driver, desc='sc2')
server.hb = Homomorphic(val=server.b, signed=False, bitlen=233, dim=[1])
conversions.Paillier_Garbled_send(server.hb, client.gb, 233, [1], False)
|
gpl-3.0
|
zenorogue/noteye
|
hydra/data.cpp
|
35029
|
// Hydra Slayer: math puzzle roguelike
// Copyright (C) 2010-2016 Zeno Rogue, see 'hydra.cpp' for details
#define LEVELS 12
#define LEVELS2 50
#define CLEVELS 10
struct levelinfo {
int maxheads;
int growlimit;
int weapon;
int bweapon;
int heal;
int msize;
};
levelinfo linf[LEVELS] = {
{ 3, 3, 3, 3, 4, 1},
{ 6, 4, 4, 6, 6, 1},
{ 9, 5, 5, 7, 6, 2},
{ 12, 6, 6, 8, 7, 2},
{ 17, 7, 7, 9, 7, 3},
{ 23, 8, 8,10, 7, 4},
{ 30, 9, 9,11, 8, 5},
{ 40, 10, 10,12, 8, 6},
{ 50, 11, 11,13, 9, 7},
{ 60, 12, 12,14,10, 8},
{256, 12, 12,15,25, 9},
{ 0, 12, 0, 0, 5,10}
};
struct itemInfo {
string name;
char icon;
int color;
char hotkey;
int value;
const char *desc;
};
#define ITEMS 18 // number of item types
#define IT_POTS 10 // first index of a potion
#define IT_SCRO 7 // first index of a scroll
#define IT_RSTUN 0
#define IT_RDEAD 1
#define IT_RCANC 2
#define IT_RGROW 3
#define IT_RCONF 4
#define IT_RFUNG 5
#define IT_RNECR 6
#define IT_SXMUT 7
#define IT_SGROW 8
#define IT_SPART 9
#define IT_PSWIP 10
#define IT_PCHRG 11
#define IT_PFAST 12
#define IT_PKNOW 13
#define IT_PARMS 14
#define IT_PSEED 15
#define IT_PAMBI 16
#define IT_PLIFE 17
#define IT_HINT 18
itemInfo iinf[ITEMS+1] = {
{ "Powder of Stunning", '$', 9, 's', 50,
"This powder must have been made by Hypnos himself. "
"Throw it at a Hydra, and it will be completely stunned!\n"
"Although this powder will affect every denizen of the Hydras Nest, "
"larger ones are stunned for shorter time.\n"
},
{ "Powder of Decapitation", '$', 7, 'd', 50,
"Some people think that killing a stunned Hydra is not honorable. What is your opinion?\n"
"Also known as Powder of Death or the Charon's Obol, it causes all stunned heads of a Hydra "
"to be instantly moved to Hades.\n"
"Rumored not to work on very powerful beings.\n"
},
{ "Powder of Cancellation", '$', 15, 'c', 10,
"These Hydras, and their heads growing back... Is there anything which can cause the heads to never grow back?\n"
"Yes, there is! The Powder of Cancellation removes all regenerative capabilities of a given Hydra. "
"Some very powerful Hydras partially resist it, though.\n"
},
{ "Powder of Growth", '$', 10, 'g', 3,
"Made by Apollo himself, this powder gives the Hydra additional heads. Who would use that? Well, master hydra slayers "
"know that fewer heads is not always less trouble...\n"
"The number of heads grown is chosen so that it will be possible to kill the Hydra "
"with current weaponry and the smallest amount of wounds possible.\n"
"If there are several possibilities, one with the smallest number of new heads "
"(greater than 0) is chosen. If it is impossible to slay hydra by growing heads, no heads are grown.\n"
"For very large hydras (over 20000 heads), it tries to grow as many heads as needed to make you able to use one of your divisors or powerful weapons; "
"if this would require more than 100 heads, only a part is grown.\n"
"The Powder of Growth calculates the strategies in the same way as the Potion of Knowledge does.\n"
},
{ "Powder of Conflict", '$', 12, 'o', 50,
"Hydras are aggresive beasts, and Eris taught the master hydra slayers "
"how to use this fact.\nThrow this powder at a target, and it "
"will fight other Hydras."
},
{ "Powder of Fungification", '$', 3, 'f', 90,
"Made by Demeter herself, this powder immediately turns a Hydra into a mushroom. "
"You have heard that this kind of unhonorable magic usually doesn't work on the most powerful "
"of your enemies, and you suppose this is also the case for this powder."
},
{ "Powder of Fungal Necromancy", '$', 8, 'n', 50,
"Mixes a dead Hydra and all mushrooms in sight into a friendly zombie hydra. "
"This zombie will join your team and attack your enemies, but it will be unable to regrow heads naturally. "
"Works only on the corpses of regular hydras."
},
{ "Scroll of Transmutation", '?', 1, 't', 3,
"Changes the material of the current weapon to the next one. The sequence of "
"elemental materials is the same as is displayed by (f)ull info."
},
{ "Scroll of the Big Stick", '?', 6, 'b', 10,
"This prayer to Hephaestus increases the size of the current weapon or shield by 1."
},
{ "Scroll of Reforging", '?', 10, 'r', 7,
"Turns a part of your current weapon or shield into a new one. The new one might be of a different type.\n"
"When combined with Ambidexterity, it is also possible to use this on several weapons of the same material, "
"and have the biggest one of them steal exactly half of the size off each other one.\n"
},
{ "Potion of Power Swipe", '!', 13, 'p', 25,
"Allows one to attack several surrounding hydras with one swipe. For "
"example, you can kill a 4-headed Green Hydra and cut "
"off 3 heads of 6-headed Red Hydra with a single Scythe (-7) attack.\n"
"Hydras are attacked in an anti-clockwise direction for the weapon in the "
"right hand (1), and clockwise for the weapon in the left hand (2). "
"On the last hydra, unstunned heads are affected first, even when using "
"divisors and similar artifacts.\n"
"Some brave or desperate heroes are rumored to end "
"with cutting their own head, but you are not one of them.\n"
"Centaurs are usually unable to use power swipes."
},
{ "Potion of Weapon Charge", '!', 5, 'w', 3,
"Allows one to attack several hydras in a straight line with a blade. For example, you can kill a 4-headed Green Hydra and cut "
"off 3 heads of 6-headed Red Hydra with a single Scythe (-7) attack. If the last hydra in line is not completely killed, "
"it is stunned for a short time."
},
{ "Potion of Extreme Speed", '!', 4, 'e', 3,
"Created by Hermes himself, this potion gives you double speed.\n"
"Double speed lasts as long as you are just moving and doing things that take no time. "
"When you attack or pick up an item, the effect is gone right away, although if you "
"do this on your first move of two, you can still move a second time before the Hydra "
"attacks you."
},
{ "Potion of Knowledge", '!', 14, 'k', 5,
"Created by Athena herself, this potion gives hints about how to kill any visible Hydra most efficiently with only your weapons.\n"
"An efficient kill is one that gives you as few wounds as possible. In case of a tie, usually a faster method is chosen.\n"
"For very large Hydras (over roughly 20000 heads) it might not work at all, or (over roughly 100 heads) not recommend stunning while it should. "
"It does not take your powders (including active ones) and missile weapons into account. Also assumes that "
"stunning lasts for long enough, which is usually not true for shield bashing, and maybe even for emerald weapons.\n"
"This potion works correctly for ambidextrous users, but might be really slow when you have a lot of choices.\n"
},
{ "Potion of Power Juice", '!', 11, 'j', 1000,
"Some people believe this potion will increase your chances against the Hydras somehow.\n"
"Other people believe this potion will decrease your chances of getting friends once you return to the society, "
"because it makes you somehow more like a Hydra.\n"
"Also known as Potion of Strength."
},
{ "Potion of Mushroom Spores", '!', 8, 'm', 2,
"Originally created by Demeter to help with farming, "
"but hydra slayers have found out that it is also useful in the dungeons.\n"
"Those who drink this potion leave a trace of mushrooms behind them."
},
{ "Potion of Ambidexterity", '!', 1, 'a', 30,
"Allows you to attack with several weapons at once. A greater control of your arms comes as a cost of losing "
"contol of your legs, so the effect wears off when you move (i.e. change position) after using the powers.\n"
"If you attack with several weapons of the same color, the hydra regrows heads only once.\n"
"Division takes precedence before subtraction. Missiles cannot be used.\n"
"The Potion of Ambidexterity also allows using scrolls on several weapons at once. In this case, "
"the potion can be used only for the scroll and nothing else.\n"
"Ambidexterity is not compatible with Power Swipes and Weapon Charges.\n"
"To help Titans, you keep the effects after moving if you have not used the powers yet.\n"
},
{ "Potion of Life", '!', 2, 'l', 5000,
"Who would be foolish enough to go to Olympus and steal some of "
"their famous nectar? And then lose it in the dungeon?\n"
"You have no idea, but you are happy that you have found it. "
"Extremely valuable, the more of them you carry home with you, "
"the richer you will be...\n"
"This potions permanently doubles your health and heals you completely, and is believed to even "
"be able to restore life.\n"
},
{ "Scroll of Learning", '?', 14, 'l', 0,
"No hint about this.\n"
}
};
// use up an item
bool useup(int ii, struct weapon *orb = NULL);
// letters available: ouvxyz
#define HCOLORS 10 // number of colors of hydras and blades
#define SCOLORS 4 // number of colors of bludgeons
#define COLORS (HCOLORS+SCOLORS+1)
// weapon colors
#define HC_OBSID 14
struct colorInfo {
string wname;
int color;
int stunturns;
const char *hverb;
const char *soundfile;
const char *hmessage;
const char *wdesc;
};
colorInfo cinf[COLORS] = {
{ "ash ", 6, 2, "hit", "elements/ash",
"Your %s loses its shine and turns to wood!",
"It is made of ash wood, which is believed to be effective against "
"skeletons, vultures, and some hydras. Wooden weapons are lighter "
"than other weapons, but that does not matter much to you."
},
{ "chaos ", 13, 2, "hit", "elements/chaos",
"Your %s starts wildly mutating!",
"One of the weapons created in the old times by the titans of Chaos to "
"destroy the Golden Legion of Order; it emits a "
"bright purple glow, and seems to constantly slowly change its shape."
},
{ "flaming ", 12, 3, "burn", "elements/fire",
"Your %s is suddenly consumed by flames!",
"Even Hephaestus would be proud "
"of this weapon. It is permanently covered with flames!\n"
"You hope they burn the hydras' "
"neck enough so that they don't grow new heads. Especially the icy "
"ones.",
},
{ "poison ", 10, 3, "cut", "elements/poison",
"A green liquid extinguishes flames on your %s!",
"Poison is dripping from it. Sometimes the poison is strong enough to "
"prevent new heads from growing. For some reason, poison is most potent "
"against chaos hydras."
},
{ "silver ", 15, 4, "cut", "elements/silver",
"The poison on your %s dries off and you see bare metal!",
"Although silver is a relatively soft metal, and usually not very good "
"for weapons, it is great at slaying werewolves and some hydras."
},
{ "storm ", 11, 4, "shock", "elements/storm",
"Sparks fly off your %s!",
"Blessed by Zeus himself, it is crackling all the time; the famous "
"hydra slayers who fought "
"hydras in the swamps have said that this crackling power disrupts "
"the hydras' regrowing ability, but it does not work so well in "
"locations which are more dry."
},
{ "acid ", 3, 5, "melt", "elements/acid",
"You produce acid using your %s!",
"It is covered by acid, which is especially good against the metallic "
"white hydras."
},
{ "frozen ", 9, 5, "freeze", "elements/frozen",
"The acid on your %s freezes!",
"It is extremely cold to the touch, it can freeze some hydra necks still "
"before they regrow new heads."
},
{ "bone ", 7, 6, "hit", "elements/bone",
"The ice from your %s melts and bare bone is shown!",
"According to your knowledge, weapons made of hydra bones are good against "
"most Hydras and beasts with storm powers."
},
{ "golden ", 14, 6, "hit", "elements/gold",
"Your %s is now made of pure gold!",
"Gold is a heavy precious material with many special properties, including "
"resistance to acid, and an ability to prevent head regrowth in some hydras. "
},
{ "emerald ", 2, 15, "slam", NULL,
"Your %s softens and turns green!",
"Although heavy, emerald is a relatively soft gem. You wonder why a "
"stunner has been made of it, there are so many harder gem types available."
},
{ "amethyst ", 5, 30, "strike", NULL,
"Your %s hardens and turns purple!",
"Amethyst weapons are believed to be extremely good against alcohol-breathing "
"monsters, but this won't help you since you have never heard about "
"alcohol hydras. Still, amethyst is quite hard."
},
{ "sapphire ", 1, 60, "smash", NULL,
"Your %s hardens and turns blue!",
"Sapphire is a very hard gem, great to stun your enemies with."
},
{ "ruby ", 4,100, "crush", NULL,
"Your %s hardens mightily and turns red!",
"Ruby is not only one of the hardest gems by itself, but it also has magical "
"properties which make it your best option if you want to stun someone for as "
"long as possible."
},
{ "meteorite ", 8,300, "cut", "elements/meteorite",
"Your mighty %s seems not affected!",
"Iron weapons are mostly useless for hydra slaying, as all hydras "
"always regrow two heads for each head cut with an iron weapon. "
"But you somehow feel that this is not ordinary iron... you feel "
"that it came from another world. Maybe this is the legendary "
"material which can kill any hydra on Earth?"
}
/* { "obsidian ", 8,300, "cut",
"Your mighty %s seems not affected!",
"You have not heard about obsidian weapons during your hydra slayer "
"training... but maybe this is the legendary material which can kill "
"any hydra on Earth?"
} */
};
#define HYDRAS 20
#define HC_ALIEN 10
#define HC_VAMPIRE 11
#define HC_ETTIN 12
#define HC_ANCIENT 13
#define HC_GROW 14
#define HC_WIZARD 15
#define HC_MONKEY 16
#define HC_TWIN_R 17
#define HC_SHADOW 18
#define HC_MUSH 19 // mushrooms produce fake hydras when using RGROW
#define HC_TWIN 32
#define HC_DRAGON 64
#define HC_DRMASK 63
#define ANIM_PLUS 20
#define ANIM_HAMMER 21
#define ANIM_DUST 22
#define ANIM_ZIG 23
#define ANIM_CANCEL 24
#define ANIM_MAX 25
struct hydraInfo {
string hname;
int atttype;
int color;
int suscept;
int weakness;
int strength;
const char *hverb;
const char *dverb;
const char *hdesc;
};
hydraInfo hyinf[HYDRAS] = {
{ "were-", 0, 6, 4, 4, 8, "bites", "throws thorns at",
"This hydra looks more like a mammal than a reptile. It is covered with "
"thick brown fur, and its heads look similar to those of wolves, jackals, "
"and giant rats. Some of them even look similar to human heads..."
},
{ "chaos ", 1, 13, 3, 3, 9, "bites", "breathes Chaos at",
"This hydra looks really strange. Each of its heads looks different, "
"and some of them are changing while you watch them! That makes no "
"sense. Anyway, it looks very dangerous."
},
{ "fire ", 2, 12, 7, 7, -1, "burns", "breathes fire at",
"This hydra is covered with hot red scales, and its jaws constantly "
"release smoke and steam."
},
{ "swamp ", 3, 10, 5, 5, 1, "bites", "spits poison at",
"A nasty green liquid is dripping from the fangs of this hydra. It looks "
"as if it came right from a swamp, since it is all wet and dirty."
},
{ "white ", 4, 15, 6, 6, 0, "bites", "breathes silverdust at",
"This hydra is covered by white scales. You wonder how it is "
"cleaning its teeth, as its breath actually smells nice, and "
"all of its 2N fangs look shining white, as if made of silver.",
},
{ "storm ", 5, 11, 8, 8, 3, "bites", "zaps",
"This hydra has a huge tail covered with a light cyan fur, "
"which crackles and releases sparks as it is dragged on the ground. "
"It reminds you of an urchin, since all of its 1N heads are supported "
"on very long necks, which seem to be straightened by some unnatural force. "
"Small lightnings appear whenever one of the heads gets close to a "
"wall."
},
{ "acid ", 6, 3, 9, 9, 4, "bites", "spits acid at",
"A nasty liquid is dripping from the fangs of this hydra. It seems to "
"burn the ground after it falls."
},
{ "ice ", 7, 9, 2, 2, -1, "freezes", "spits ice at",
"Although the dungeon is not so cold, this hydra is covered with ice. You also "
"see very sharp icy crystals on its fangs."
},
{ "skeletal ", 8, 7, 0, 0, 5, "bites", "breathes Death at",
"You have seen hydra skeletons in the collections of your rich friends, "
"but this one seems alive. Its main body seems to have lots of unnecessary "
"bones... or maybe are they used to regrow heads?"
},
{ "golden ", 9, 14, 1, 1, 6, "bites", "shines blindingly on",
"This hydra glows like Sun, and you look forward to improving your armor "
"by adding some of its golden scales."
},
{ "alien ", 14, 2, 14, 10, -1, "cuts", "fires a laser at",
"This hydra is not covered with scales, but with a deep green skin. "
"Its only features are huge black eyes and razor sharp teeth. The "
"legends say that such monsters have appeared after a strange "
"magical star fell on the land, and they are somehow different than "
"beings without extraterrestial heritage...\n"
"Alien hydras have x2 against meteorite weapons and resist Cancellation."
},
{ "vulture ", 14, 5, 0, 11, -1, "bites", "casts a spell at",
"This hydra is a relative of the vulture who used to feed on the liver "
"of Prometheus. After eating the liver which regenerated each day, "
"it obtained its own special regenerative properties: it grows heads "
"not only when attacked, but also when attacking.\n"
// "The main body of this hydra is dark purple, but its heads are pale white, "
// "with crimson red fangs.
// You feel that these fangs can suck out your "
// "blood and use it for the hydra's own purposes.\n"
"Vulture hydras gain a head for each enemy wound, and resist Conflict."
},
{ "giant ", 14, 1, 12, 12, -1, "hits", "hits",
"These two-headed giants are children of Geryon. "
"They live in hills and caves close to the Hydras Pit, "
"and sometimes a band of adventurous giants leaves their cave and "
"causes destruction among the the peasants, who try to defend their "
"possessions. Apparently such a band of giants has also entered the "
"Hydras Pit, but contrary to the peasants, the Hydras did not want "
"to fight... probably two heads confused the hydras, and they "
"thought of them as ones of their kind, and considered them to be friends. "
"Your mission does not force you to kill giants, but still, they are friends "
"with your enemies, and carry nice oversized weapons... that is, they would "
"be nice if you wielded them. Giants are more nimble than hydras, and they "
"are able to dodge ranged weapons. The powder of growth works on them, but "
"it is not as powerful as on Hydras. They do not attack as mindlessly as "
"hydras; they attack only if they consider the target vulnerable."
},
{ "ancient ", 14, 4, 14, 13, -1, "attacks", "reaches",
"You did not know that such huge beasts exist! But they apparently do. It "
"is much larger than any hydra you have seen or heard of, and its deep red "
"scales and deep dark eyes look very old, but its teeth still look "
"dangerous... You feel that this hydra is alone "
"only because mundane hydras respect its age and size, and do not want to "
"get into the way. You feel extremely unimportant compared to this huge beast."
"\n"
"Ancient hydra resists Fungification, Decapitation, partially Cancellation."
},
{ "ivy-", 14,18, 14, 10, -1, "crushes", "breathes leaves",
"A hydra with green plant-like skin. It seems to be able to regrow a head at "
"will, and also to understand your weapons enough to know that growing an "
"extra head is not always helpful."
},
{ "arch-", 14,21, 14, 11, -1, "bites", "casts a spell",
"All 1N heads of this hydra are surrounded by a glowing aura. You remember "
"this glow... the nymphs whose teleportation tricks you have "
"watched as a child glowed in the same way. But you think that this hydra "
"won't use them to amuse you, but rather to make your job as hard as "
"possible."
},
{ "monkey", 14, 1, 12, 12, -1, "punches", "throws feces at",
"A pack of three-headed monkeys was rumored to once be brought from "
"some remote island and live peacefully with humans for "
"some time... until they noticed a Hydra. From this point, "
"they have decided that they are more alike Hydras than humans. "
"They have escaped and joined the Hydras in the Hydras Pit... "
"and they were lucky, Hydras accepted their friendship.\n"
"This monkey looks as if it wants to sneak on you from behind, "
"and seems to concentrate on your weapons. "
"By looking at its muscles "
"which are larger than those of giants, "
"you think that it has already practiced, and that it could "
"even carry a weapon of size ML.\n"
"Just like giants, monkeys dodge ranged attacks, resist Growth, and "
"attack only vulnerable targets.\n"
},
{ "twin", 14, 13, -1, -1, -1,
"<copied>"
},
{ "shadow", 14, 8, -1, -1, -1, "touches", "wails at",
"While shadow hydras have no natural instant regeneration ability, "
"they have another power: invisibility. Even if you know where "
"the shadow hydra is, you still don't know how many heads it has... "
"even approximately, since they always attack with at most three heads to "
"mask the total amount of heads.\n"
"Shadow hydras fight only hydra slayers (hydras and other monsters "
"will just ignore them, even if zombified or conflicted), and ignore bows.\n"
"If your move is impossible due to presence of a shadow hydra with a "
"head count not right for your selected weapon, you will 'miss' it "
"and lose your turn.\n"
"You can use a Potion of Knowledge on the Shadow Hydra. "
"It won't tell you how many heads it has, or where exactly it is, "
"but it will recommend the first three single attacks.\n"
},
{ "mushroom", 14, 8, -1, -1, -1, "crushes", "throws spores at",
"Mushrooms block your way, so "
"you have to cut them before you proceed. They also have many uses, "
"though. They block the way of Hydras, and also provide additional "
"\"heads\" which are useful with some of the special abilities, or "
"for testing your weapons.\n" }
};
#define MAXARMS 10
#define RACES 6
#define R_HUMAN 0
#define R_ELF 1
#define R_NAGA 2
#define R_TROLL 3
#define R_TWIN 4
#define R_CENTAUR 5
struct raceInfo {
string rname;
char rkey;
char atsign;
int color;
const char *desc;
};
raceInfo rinf[RACES] = {
{ "Human", 'h', '@', 7,
"Humans are easy to learn, but hard to master.\n"
"They are recommended for newcomers. "
"Although they are probably not the easiest race to win, "
"they are the easiest race to play.\n"
#ifdef ANDROID
"(Especially on Android)\n"
#endif
},
{ "Elf", 'E', '@', 9,
"Elves have mastered fencing and archery. An Elf armed with a longsword (-5) can kill "
"two 2-headed hydras and one 1-headed mushroom "
"in one swipe. However, this power can only be used when the "
"heads of multiple targets add up exactly to the size of the weapon, "
"and only with normal blades (no divisors or axes). "
"This special attack style "
"makes them also unable to perform Ambidexterous attacks, even with a potion.\n"
"Elves also start with an elven bow instead of a dagger, and more arrows than they will ever need. "
"Shooting a hydra head turns it into two stunned heads. An attack hits all targets in the "
"given direction that they can see... and they can see very well, looking far "
"inside the underground mushroom forests.\n"
// "Elves think that using magical Runes is not honorable. They convert them "
// "to Scrolls of Transmutation instead of using them.\n"
},
{ "Echidna", 'e', '@', 10,
"Children of Echidna, with huge serpentine tails instead of legs. Although moving on such a "
"tail is much slower than walking on legs, their monstrous nature allows them to attack with "
"two weapons at once... or more. Echidna has been known to defeat her mighty enemies "
"with just one or two such ambidextrous attacks.\nThis specialization on quick attacks comes "
"at a cost, though: in battles which last longer than one turn, they are easier to hurt. "
"Also, regenerative effect received from the blood of killed Hydras is not as strong "
"as it is for other races, and using items is slower than for other races (especially "
"the powders).\n"
"(To select weapons 2, 3 and 5, press the following sequence of keys: 2235)\n"
#ifdef ANDROID
"\nNote: Echidna might be risky to play on Android due to memory requirements"
#endif
},
{ "Titan", 't', '@', 12,
"Titans are too impatient to keep items other than weapons (such as powders, scrolls, "
"and potions) for later, so they use them up immediately after pick up. Although this does "
"not mean that they have to use the effect immediately (as they can walk a bit before the "
"effect actually goes off), they are unable to keep any effects for another level (except "
"Mushroom Spores).\n"
"On the other hand, Titans value weapons very much, and are strong enough to carry lots of "
"them in their inventory, instead of items. The most valuable titanic artifact weapon is "
"rumored to be lost somewhere in the Hydra Pit. It is so heavy that only a Titan could "
"pick it up, and is believed to allow them to overcome disadvantages caused by their "
"impatience."
#ifdef ANDROID
"\nNote: Titans are not yet adapted for Android!"
#endif
},
{ "Twins", 'w', '@', 13,
"You start with fewer HP and an ability to wield just one "
"weapon. However, you have your twin with you, and you are both "
"self-claimed experts at hydra slaying!\n"
"You can press 's' to switch the twins at any time, and 'c' to switch "
"between controlling one or both twins. When controlling only one, "
"your twin will try to act reasonably, and should successfully guess "
"your plans often.\n"
"For convenience, the Twins share their items, so any of them can use an "
"item, no matter which one has picked it up. They always drink potions "
"of ambidexterity in pairs, because they have learned how to "
"make joint ambidextrous attacks."
#ifdef ANDROID
"\nNote: Twins might be a bit inconvenient to play on Android"
#endif
},
{ "Centaur", 'c', '@', 9,
"Centaurs have mastered archery, and thus they start with bows instead of daggers, "
"and more arrows than they will ever need. "
"Shooting a hydra head turns it into two stunned heads. An attack hits all targets in the "
"given direction that the Centaur can see.\n"
"Due to their equine bodies, it is hard for Centaurs to turn "
"around, and thus they are not able to "
"use the Potion of Power Swipe to attack several enemies around them "
"at once.\n"
}
};
#define HELPLEN 9
const char* helpinfo[HELPLEN] = {
"\bjHydra Slayer v" VER " by Zeno Rogue <zeno@attnam.com>\n"
#ifndef STEAM
"released under GNU General Public License version 2 and thus "
"comes with absolutely no warranty; see COPYING for details\n"
#else
"(Steam)\n"
#endif
"\bgHydra Slayer is a Roguelike game focused on one thing: slaying Hydras. "
"It is inspired by Greek mythology, Dungeon Crawl, MathRL seven day "
"roguelike, and some mathematical puzzles about brave heroes slaying many "
"headed beasts.\n"
"\bkPress Enter to get help about keyboard. Then press Enter again for the "
"background history. Press Space to exit help. You can also use arrows.\n"
"\blIf you need more information about Hydra Slayer, see the official website:\n"
"\bohttp://roguetemple.com/z/hydra.php\n",
"\biThere are two keyboard layouts available (press '=' now to switch). "
"Use arrow keys, numpad, WASD, or extended VI keys to move and to attack Hydras "
"with your weapons and active powders. Use numbers (1, 2...) or [] keys to "
"switch your magical weapons of hydra slaying.\n",
"Hydra slaying has a long history.\n"
"First explorers who have met hydras were completely unable to do any harm. "
"As they cut hydras' heads, two new heads always grew in place of each one cut.\n"
"Some of them started using clubs instead of swords. However, this was only "
"a temporary solution. A club may stun a hydra, and make it temporarily less "
"dangerous, but not kill it. When time comes, it will wake up and attack "
"further. Hydras remained indestructible monsters.\n"
"Some wise men have been employed to research methods of slaying Hydras. "
"The first thing they have invented was the Powder of Decapitation, which could "
"kill a completely stunned hydra, or permanently destroy some heads of a "
"non-completely stunned one. Another thing were the Powder of Cancellation, which "
"could remove hydra's regenerative abilities. However, both of these Powders "
"were very expensive to create, and thus not practical.\n",
"Then, a report came, claiming that heads won't regrow if the sword was put "
"on fire. Apparently all Hydras in some region were killed using that method. "
"Their meat was found extremely tasty, their blood good for healing wounds "
"(due to hydras' natural regenerative abilities), and their scales good for "
"improving armors.\n"
"Wise men tried this method. Unfortunately, it did not work for them, though. "
"However, they have experimented with other kinds of magically imbued weapons. "
"It turned out that some enchantments will reduce the number of heads "
"regrown. Possibly even no heads will regrow. Some hydras could be slayed "
"after these findings, but not all. It is rumored that some mage long ago "
"created a weapon which could slay any Hydra without regrowing heads, but "
"he got overconfident and killed, and the secret was lost.\n",
"Wise men experimented with their magical weapons even further. And they had "
"a new result: weapons which could cut (or stun) several heads at once. If "
"they cut all heads, the hydra was killed. If not, the Hydra would usually "
"regrow the same number of heads as if only one head was cut. The mages were "
"happy with that major result.\n"
"Of course, some new hydra slaying weapons and magics were created later, "
"but they were nothing compared to the previous major achievement. The "
"numbers of Hydras kept decreasing, and finally, they disappeared, and "
"were almost forgotten... And fewer and fewer people became acquainted with "
"the hydra slaying techniques, as other people laughed at them, because "
"their profession was completely useless in these times.\n",
"Now you, a young student, have heard about a manifestation of hydras in so "
"called Hydras Nest. Apparently some brave warriors came to kill the Hydras... "
"Brave, but stupid. Even if they equipped themselves with mighty hydra slaying "
"weapons, they had no knowledge about how to use them correctly. What use is "
"a mighty sword which can cut ten heads in one swipe, against a Hydra which "
"has only 9 heads? All these knights have been killed.\n"
"You are more clever. Since your earliest "
"years you have had an unnatural ability to count people in an instant, and "
"your great grandfather has suggested you to pursue the Hydra Slayer career, "
"and learn the forgotten art of Hydra Slaying. Now, you will show people that "
"it is not just a useless funny thing. You take two small weapons and "
"some items, hoping to rob better ones off dead bodies of these stupid "
"warriors, and head to Hydras Nest. Of course, not that you are one of these "
"clever guys who are too scared and weak to be useful in a battle... you could "
"also wield a two handed weapon with one hand.\n",
"\bgHint: You can use command line options to set default values for the "
"options, such as default character name and default geometry, or to "
"use special features like starting the game in a debug mode or from a given "
"random seed.\n"
"\biIn the main menu, you have an option to choose your geometry. Your options "
"are: (4) allow only horizontal and vertical movement, (6) simulate a hex "
"board, (8) allow movement in all directions. You change the selection by "
"pressing D, Space, 4, 6, or 8. Press '3' to create a game with variable "
"geometry.\n"
"\biYou can move by pressing arrows (in 4 directions), "
"numpad (in all directions), YUBN (for diagonal movement, or vertical "
"movement in the 4-directional mode) and HJKL (for orthogonal movement).\n"
"\boYour selection affects "
"what directions are available to all actions, including your movement, "
"hydra movement, missile weapons, grids targetted by Power Swipes, and so "
"on. Additionally, (6) makes levels smaller (because only each second "
"character is used) and (4) makes Hydras better at smelling you (for "
"balance reasons).\n",
"\bgIf you are too bored to explore the Hydras Nest yourself, you can press "
"'o' for automatic exploration. It only works if there is no enemy in sight, "
"and will try to do the following, in order:\n"
"- pick up an inventory item you are standing on (unless a Titan),\r"
"- go to the nearest inventory item not behind mushrooms,\r"
"- go to the nearest non-explored space not behind mushrooms,\r"
"- go to the nearest inventory item through mushrooms,\r"
"- go to the nearest non-explored space through mushrooms,\r"
"- go to the stairway down.\n\n",
"Also, pressing O (shift+O) if there are no enemies on the level will collect "
"all items (or all weapons, for Titan). If there are enemies on level, it will "
"quickly pass turns until you are attacked, a hydra dies (useful with Powder of "
"Conflict or Fungal Necromancy), a hydra approaches you, or 2000 turns pass."
"\boArt, game design, texts, and programming by Zeno Rogue, 2010-2016.\n"
"\boSounds effects and music by Brett Cornwall <brett@brettcornwall.com>, under the Creative Commons BY-SA 4.0 license.\n"
//"\bjHydra Slayer uses the following music from Rogue Bard:\n"
//"* \"The naive Bard\" by Bushy (a cover by Mingos)\n"
//"* \"Azog's March\" by jice\n"
//"See more at http://roguebard.eptalys.net\n"
"\biThanks to Ancient, Xecutor, JLC, sbluen, cephalopid, Legend, "
"CommentLurker, tricosahedron, zulmetefza, Ryan Dorkoski, #16, "
"Bloodysetsail, and vo3435 "
"for their bug reports, suggestions, and other help!\n\n"
"\boAnd thanks to you for playing!"
};
|
gpl-3.0
|
Foboy/GogoDesginer
|
upload/admin/language/zh-CN/extension/installer.php
|
1503
|
<?php
// Heading
$_['heading_title'] = '扩展安装';
// Text
$_['text_success'] = '成功:你已安装的扩展!';
$_['text_unzip'] = '解压缩文件!';
$_['text_ftp'] = '复制文件!';
$_['text_sql'] = '运行SQL!';
$_['text_xml'] = '申请修改!';
$_['text_php'] = '运行PHP!';
$_['text_remove'] = '删除临时文件!';
$_['text_clear'] = '成功:你已清除所有临时文件!';
// Entry
$_['entry_upload'] = '上传文件:';
$_['entry_overwrite'] = '将被覆盖的文件:';
$_['entry_progress'] = '进展:';
// Help
$_['help_upload'] = '需要一个Zip或XML格式的修改文件。';
// Error
$_['error_permission'] = '警告:您没有权限修改扩展!';
$_['error_temporary'] = '警告:有需要删除一些临时文件。点击清除按钮将其删除!';
$_['error_upload'] = '文件无法上传!';
$_['error_filetype'] = '无效的文件类型!';
$_['error_file'] = '文件找不到!';
$_['error_unzip'] = 'zip文件无法打开!';
$_['error_directory'] = '要上传的文件目录找不到!';
$_['error_ftp_connection'] = '无法连接到 %s:%s';
$_['error_ftp_login'] = '无法登录为 %s';
$_['error_ftp_root'] = '无法设置根目录为 %s';
$_['error_ftp_directory'] = '无法切换到目录 %s';
$_['error_ftp_file'] = '无法上传文件 %s';
|
gpl-3.0
|
tmrowco/electricitymap
|
web/src/components/countrytable.js
|
24581
|
import NoDataOverlay from '../components/nodataoverlay'
const d3 = Object.assign(
{},
require('d3-array'),
require('d3-axis'),
require('d3-collection'),
require('d3-format'),
require('d3-selection'),
require('d3-scale'),
);
var getSymbolFromCurrency = require('currency-symbol-map');
var moment = require('moment');
var flags = require('../helpers/flags');
var translation = require('../helpers/translation');
// TODO:
// All non-path (i.e. non-axis) elements should be drawn
// with a % scale.
// This means drawing them once at `.data()` or at construction, and not
// during `render()`
function CountryTable(selector, modeColor, modeOrder) {
var that = this;
this.root = d3.select(selector);
this.wrapperNoDataOverlay = new NoDataOverlay('.country-panel-wrap');
this.container = this.root.append('svg').attr('class', 'country-table');
// Create containers
this.headerRoot = this.container.append('g');
this.productionRoot = this.container.append('g');
this.exchangeRoot = this.container.append('g');
// Constants
this.ROW_HEIGHT = 13; // Height of the rects
this.RECT_OPACITY = 0.8;
this.LABEL_MAX_WIDTH = 102;
this.PADDING_X = 5; this.PADDING_Y = 7; // Inner paddings
this.FLAG_SIZE = 16;
this.TEXT_ADJUST_Y = 11; // To align properly on a line
this.X_AXIS_HEIGHT = 15;
this.MODE_COLORS = modeColor;
this.MODES = [];
modeOrder.forEach(function(k) {
that.MODES.push({'mode': k, 'isStorage': k.indexOf('storage') != -1});
});
this.SCALE_TICKS = 4;
this.TRANSITION_DURATION = 250;
// State
this._displayByEmissions = false;
// Header
this.gPowerAxis = this.headerRoot.append('g')
.attr('class', 'x axis');
// Scales
this.powerScale = d3.scaleLinear();
this.co2Scale = d3.scaleLinear();
// Initial objects
// ** Production labels and rects **
var gNewRow = this.productionRoot.selectAll('.row')
.data(this.MODES)
.enter()
.append('g')
.attr('class', 'row')
.attr('transform', function(d, i) {
return 'translate(0,' + (i * (that.ROW_HEIGHT + that.PADDING_Y)) + ')';
});
gNewRow.append('text')
.text(function(d) { return translation.translate(d.mode) || d.mode })
.style('text-anchor', 'end') // right align
.attr('transform', 'translate(' + (this.LABEL_MAX_WIDTH - 1.5 * this.PADDING_Y) + ', ' + this.TEXT_ADJUST_Y + ')');
gNewRow.append('rect')
.attr('class', 'capacity')
.attr('height', this.ROW_HEIGHT)
.attr('fill-opacity', 0.4)
.attr('opacity', 0.3)
.attr('shape-rendering', 'crispEdges');
gNewRow.append('rect')
.attr('class', 'production')
.attr('height', this.ROW_HEIGHT)
.attr('opacity', this.RECT_OPACITY)
.attr('shape-rendering', 'crispEdges');
gNewRow.append('text')
.attr('class', 'unknown')
.text('?')
.style('fill', 'darkgray')
.attr('transform', 'translate(1, ' + this.TEXT_ADJUST_Y + ')')
.style('display', 'none');
}
CountryTable.prototype.render = function(ignoreTransitions) {
var that = this;
if (this.root.node().getBoundingClientRect.width === 0){
return;
}
if (!this._data) {
return;
}
// Set header
const panel = d3.select('.left-panel-zone-details');
const datetime = this._data.stateDatetime || this._data.datetime;
panel.select('#country-flag').attr('src', flags.flagUri(this._data.countryCode, 24));
panel.select('.country-name').text(
translation.getFullZoneName(this._data.countryCode));
panel.selectAll('.country-time')
.text(datetime ? moment(datetime).format('LL LT') : '');
if (this.isMissingParser){
return;
}
const width = this.root.node().getBoundingClientRect().width;
if (!this._exchangeData) { return; }
// Update scale
this.barMaxWidth = width - this.LABEL_MAX_WIDTH - this.PADDING_X;
this.powerScale
.range([0, this.barMaxWidth]);
this.co2Scale
.range([0, this.barMaxWidth]);
var axisHeight =
(this.MODES.length + this._exchangeData.length + 1) * (this.ROW_HEIGHT + this.PADDING_Y)
+ this.PADDING_Y;
this.axis
.tickSizeInner(-1 * axisHeight)
.tickSizeOuter(0)
.ticks(this.SCALE_TICKS);
this.gPowerAxis
.transition()
.duration(ignoreTransitions ? 0 : this.TRANSITION_DURATION)
// TODO: We should offset by just one pixel because it looks better when
// the rectangles don't start exactly on the axis...
// But we should also handle "negative" rects
.attr('transform', 'translate(' + (this.powerScale.range()[0] + this.LABEL_MAX_WIDTH) + ', ' + this.X_AXIS_HEIGHT +')')
.call(this.axis);
var selection = this.productionRoot.selectAll('.row')
.data(this.sortedProductionData);
/*selection.select('rect.capacity')
.attr('fill', function (d) { return that.co2color()(d.gCo2eqPerkWh); })
.attr('stroke', function (d) { return that.co2color()(d.gCo2eqPerkWh); });*/
if (that._displayByEmissions)
selection.select('rect.capacity')
.transition()
.duration(ignoreTransitions ? 0 : this.TRANSITION_DURATION)
.style('display', 'none')
else
selection.select('rect.capacity')
.transition()
.duration(ignoreTransitions ? 0 : this.TRANSITION_DURATION)
.attr('x', function(d) {
var value = (!d.isStorage) ? d.capacity : -1 * d.capacity;
return that.LABEL_MAX_WIDTH + ((value == undefined || !isFinite(value)) ? that.powerScale(0) : that.powerScale(Math.min(0, value)));
})
.attr('width', function (d) {
var isDefined = d.capacity !== undefined && d.capacity >= (d.production || 0);
var capacity = d.isStorage ? (d.capacity * 2) : d.capacity
return isDefined ? (that.powerScale(capacity) - that.powerScale(0)) : 0;
})
.on('end', function () { d3.select(this).style('display', 'block'); });
// Add event handlers
selection.selectAll('rect.capacity,rect.production')
.on('mouseover', function (d) {
if (that.productionMouseOverHandler)
that.productionMouseOverHandler.call(this, d.mode, that._data, that._displayByEmissions);
})
.on('mouseout', function (d) {
if (that.productionMouseOutHandler)
that.productionMouseOutHandler.call(this, d.mode, that._data, that._displayByEmissions);
})
.on('mousemove', function (d) {
if (that.productionMouseMoveHandler)
that.productionMouseMoveHandler.call(this, d.mode, that._data, that._displayByEmissions);
});
/*selection.select('rect.production')
.attr('fill', function (d) { return that.co2color()(d.gCo2eqPerkWh); });*/
if (that._displayByEmissions)
selection.select('rect.production')
.transition()
.duration(ignoreTransitions ? 0 : this.TRANSITION_DURATION)
.attr('fill', function (d) {
// color by Co2 Intensity
// return that.co2color()(that._data.productionCo2Intensities[d.mode, that._data.countryCode]);
// color by production mode
return that.MODE_COLORS[d.mode];
})
.attr('x', that.LABEL_MAX_WIDTH + that.co2Scale(0))
.attr('width', function (d) {
return !isFinite(d.gCo2eqPerH) ? 0 : (that.co2Scale(d.gCo2eqPerH / 1e6 / 60.0) - that.co2Scale(0));
});
else
selection.select('rect.production')
.transition()
.duration(ignoreTransitions ? 0 : this.TRANSITION_DURATION)
.attr('fill', function (d) {
return that.MODE_COLORS[d.mode];
})
.attr('x', function (d) {
var value = (!d.isStorage) ? d.production : -1 * d.storage;
return that.LABEL_MAX_WIDTH + ((value == undefined || !isFinite(value)) ? that.powerScale(0) : that.powerScale(Math.min(0, value)));
})
.attr('width', function (d) {
var value = d.production != undefined ? d.production : -1 * d.storage;
return (value == undefined || !isFinite(value)) ? 0 : Math.abs(that.powerScale(value) - that.powerScale(0));
});
selection.select('text.unknown')
.transition()
.duration(ignoreTransitions ? 0 : this.TRANSITION_DURATION)
.attr('x', that.LABEL_MAX_WIDTH + (that._displayByEmissions ? that.co2Scale(0) : that.powerScale(0)))
.style('display', function (d) {
return (d.capacity == undefined || d.capacity > 0) &&
d.mode != 'unknown' &&
(d.isStorage ? d.storage == undefined : d.production == undefined) ?
'block' : 'none';
});
// Construct exchanges
function getExchangeCo2eq(d) {
return d.value > 0 ?
(that._data.exchangeCo2Intensities !== undefined && that._data.exchangeCo2Intensities[d.key] !== undefined) ? that._data.exchangeCo2Intensities[d.key] : undefined
: (that._data.co2intensity !== undefined) ? that._data.co2intensity : undefined;
}
var selection = this.exchangeRoot.selectAll('.row')
.data(this._exchangeData);
selection.exit().remove();
var gNewRow = selection.enter().append('g')
.attr('class', 'row')
.attr('transform', function (d, i) {
return 'translate(0,' + i * (that.ROW_HEIGHT + that.PADDING_Y) + ')';
});
gNewRow.append('image')
.attr('width', this.FLAG_SIZE)
.attr('height', this.FLAG_SIZE);
gNewRow.append('text')
.style('text-anchor', 'end') // right align
.attr('transform',
'translate(' + (this.LABEL_MAX_WIDTH - 2.0 * this.PADDING_X) + ', ' +
this.TEXT_ADJUST_Y + ')');
gNewRow.append('text')
.attr('class', 'unknown')
.style('fill', 'darkgray')
.text('?');
gNewRow.append('rect')
.attr('class', 'capacity')
.attr('height', this.ROW_HEIGHT)
.attr('fill-opacity', 0.4)
.attr('opacity', 0.3)
.attr('shape-rendering', 'crispEdges')
.attr('x', that.LABEL_MAX_WIDTH +
(this._displayByEmissions ? this.co2Scale(0) : this.powerScale(0)))
.style('transform-origin', 'left');
gNewRow.append('rect')
.attr('class', 'exchange')
.attr('height', this.ROW_HEIGHT)
.attr('opacity', this.RECT_OPACITY)
.attr('x', that.LABEL_MAX_WIDTH +
(this._displayByEmissions ? this.co2Scale(0) : this.powerScale(0)))
.style('transform-origin', 'left');
if (that._displayByEmissions)
gNewRow.merge(selection).select('rect.capacity')
.transition()
.duration(ignoreTransitions ? 0 : this.TRANSITION_DURATION)
.style('display', 'none')
else
gNewRow.merge(selection).select('rect.capacity')
.transition()
.duration(ignoreTransitions ? 0 : this.TRANSITION_DURATION)
.attr('x', function(d) {
var value = ((that._data.exchangeCapacities || {})[d.key] || [undefined, undefined])[0];
return that.LABEL_MAX_WIDTH + ((value == undefined || !isFinite(value)) ? that.powerScale(0) : that.powerScale(Math.min(0, value)));
})
.attr('width', function (d) {
var capacity = (that._data.exchangeCapacities || {})[d.key];
if (!capacity) return 0;
return that.powerScale(capacity[1] - capacity[0]) - that.powerScale(0);
})
.on('end', function () { d3.select(this).style('display', 'block'); });
gNewRow.merge(selection).select('text.unknown')
.transition()
.duration(ignoreTransitions ? 0 : this.TRANSITION_DURATION)
.attr('transform', 'translate(' + (that.LABEL_MAX_WIDTH + that.co2Scale(0)) + ', ' + this.TEXT_ADJUST_Y + ')')
.style('display', function(d) {
return (that._displayByEmissions && getExchangeCo2eq(d) === undefined) ? 'block' : 'none';
});
var labelLength = d3.max(this._exchangeData, function(d) { return d.key.length }) * 8;
gNewRow.merge(selection).select('image')
.attr('x', this.LABEL_MAX_WIDTH - 4.0 * this.PADDING_X - this.FLAG_SIZE - labelLength)
.attr('xlink:href', function (d) {
return flags.flagUri(d.key, that.FLAG_SIZE);
})
gNewRow.merge(selection).select('rect.exchange')
.transition()
.duration(ignoreTransitions ? 0 : this.TRANSITION_DURATION)
.attr('fill', function (d, i) {
if (that._displayByEmissions)
return 'gray';
else {
var co2intensity = getExchangeCo2eq(d);
return (co2intensity !== undefined) ? that.co2color()(co2intensity) : 'gray';
}
})
.attr('x', function (d) {
if (that._displayByEmissions) {
var co2intensity = getExchangeCo2eq(d);
if (getExchangeCo2eq(d) === undefined)
return that.LABEL_MAX_WIDTH;
else
return that.LABEL_MAX_WIDTH + that.co2Scale(Math.min((d.value || 0.0) / 1e3 / 60.0 * co2intensity, 0));
}
else {
return that.LABEL_MAX_WIDTH + that.powerScale(Math.min(d.value || 0.0, 0.0));
}
})
.attr('width', function (d) {
if (that._displayByEmissions) {
var co2intensity = getExchangeCo2eq(d);
if (getExchangeCo2eq(d) === undefined)
return 0;
else
return Math.abs(that.co2Scale((d.value || 0.0) / 1e3 / 60.0 * co2intensity) - that.co2Scale(0));
}
else
return Math.abs(that.powerScale(d.value || 0.0) - that.powerScale(0));
})
// Add event handlers
gNewRow.merge(selection).selectAll('rect.capacity,rect.exchange')
.on('mouseover', function (d) {
if (that.exchangeMouseOverHandler)
that.exchangeMouseOverHandler.call(this, d.key, that._data, that._displayByEmissions);
})
.on('mouseout', function (d) {
if (that.exchangeMouseOutHandler)
that.exchangeMouseOutHandler.call(this, d.key, that._data, that._displayByEmissions);
})
.on('mousemove', function (d) {
if (that.exchangeMouseMoveHandler)
that.exchangeMouseMoveHandler.call(this, d.key, that._data, that._displayByEmissions);
});
gNewRow.merge(selection).select('text')
.text(function(d) { return d.key; });
d3.select('.country-emission-intensity')
.text(Math.round(this._data.co2intensity) || '?');
var hasFossilFuelData = this._data.fossilFuelRatio != null;
var fossilFuelPercent = this._data.fossilFuelRatio * 100;
d3.selectAll('.left-panel-zone-details .lowcarbon-percentage')
.text(hasFossilFuelData ? Math.round(100 - fossilFuelPercent) : '?');
var hasRenewableData = this._data.renewableRatio != null;
var renewablePercent = this._data.renewableRatio * 100;
d3.selectAll('.left-panel-zone-details .renewable-percentage')
.text(hasRenewableData ? Math.round(renewablePercent) : '?');
var priceData = this._data.price || {};
var hasPrice = priceData.value != null;
d3.select('.country-spot-price')
.text(hasPrice ? Math.round(priceData.value) : '?')
.style('color', (priceData.value || 0) < 0 ? 'red' : undefined);
d3.select('.country-spot-price-currency')
.text(getSymbolFromCurrency(priceData.currency) || priceData.currency || '?')
d3.select('#country-emission-rect, .left-panel-zone-details .emission-rect')
.transition()
.duration(ignoreTransitions ? 0 : this.TRANSITION_DURATION)
.style('background-color',
this._data.co2intensity ?
that.co2color()(this._data.co2intensity) : 'gray');
d3.select('.country-data-source')
.text(this._data.source || '?');
this.resize();
return this;
}
CountryTable.prototype.displayByEmissions = function(arg) {
if (arg === undefined) return this._displayByEmissions;
else {
this._displayByEmissions = arg;
// Quick hack to re-render
// TODO: In principle we shouldn't be calling `.data()`
if (this._data){
this
.data(this._data)
.render();
}
}
return this;
}
CountryTable.prototype.onExchangeMouseOver = function(arg) {
if (!arguments.length) return this.exchangeMouseOverHandler;
else this.exchangeMouseOverHandler = arg;
return this;
}
CountryTable.prototype.onExchangeMouseOut = function(arg) {
if (!arguments.length) return this.exchangeMouseOutHandler;
else this.exchangeMouseOutHandler = arg;
return this;
}
CountryTable.prototype.onExchangeMouseMove = function(arg) {
if (!arguments.length) return this.exchangeMouseMoveHandler;
else this.exchangeMouseMoveHandler = arg;
return this;
}
CountryTable.prototype.onProductionMouseOver = function(arg) {
if (!arguments.length) return this.productionMouseOverHandler;
else this.productionMouseOverHandler = arg;
return this;
}
CountryTable.prototype.onProductionMouseOut = function(arg) {
if (!arguments.length) return this.productionMouseOutHandler;
else this.productionMouseOutHandler = arg;
return this;
}
CountryTable.prototype.onProductionMouseMove = function(arg) {
if (!arguments.length) return this.productionMouseMoveHandler;
else this.productionMouseMoveHandler = arg;
return this;
}
CountryTable.prototype.resize = function() {
this.productionHeight = this.MODES.length * (this.ROW_HEIGHT + this.PADDING_Y);
this.exchangeHeight = (!this._data) ? 0 : d3.entries(this._exchangeData).length * (this.ROW_HEIGHT + this.PADDING_Y);
this.yProduction = this.X_AXIS_HEIGHT + this.PADDING_Y;
this.productionRoot
.attr('transform', 'translate(0,' + this.yProduction + ')');
this.yExchange = this.yProduction + this.productionHeight + this.ROW_HEIGHT + this.PADDING_Y;
this.exchangeRoot
.attr('transform', 'translate(0,' + this.yExchange + ')');
this.container
.attr('height', this.yExchange + this.exchangeHeight);
}
CountryTable.prototype.data = function(arg) {
var that = this;
if (!arguments.length) return this._data;
this._data = arg;
if (!this._data) { return this }
this.hasProductionData = this._data.production !== undefined && Object.keys(this._data.production).length > 0;
this.isMissingParser = this._data.hasParser === undefined || !this._data.hasParser;
if (this._exchangeKeys) {
this._exchangeData = this._exchangeKeys
.map(function(k) {
return { key: k, value: (that._data.exchange || {})[k] }
})
.sort(function(x, y) {
return d3.ascending(x.key, y.key);
});
} else {
this._exchangeData = d3.entries(this._data.exchange)
.sort(function(x, y) {
return d3.ascending(x.key, y.key);
});
}
if (!this.hasProductionData){
// Remove exchange data values if no production is present, as table is greyed out
this._exchangeData.forEach(d => d.value = undefined);
}
// Construct a list having each production in the same order as this.MODES.
this.sortedProductionData = this.MODES.map(function (d) {
var footprint = !d.isStorage ?
that._data.productionCo2Intensities ?
that._data.productionCo2Intensities[d.mode] :
undefined :
0;
var production = !d.isStorage ? (that._data.production || {})[d.mode] : undefined;
var storage = d.isStorage ? (that._data.storage || {})[d.mode.replace(' storage', '')] : undefined;
var capacity = (that._data.capacity || {})[d.mode];
return {
production: production,
storage: storage,
isStorage: d.isStorage,
capacity: capacity,
mode: d.mode,
text: translation.translate(d.mode),
gCo2eqPerkWh: footprint,
gCo2eqPerH: footprint * 1000.0 * Math.max(production, 0)
};
});
// update scales
this.powerScale
.domain(this._powerScaleDomain || [
Math.min(
-this._data.maxStorageCapacity || 0,
-this._data.maxStorage || 0,
-this._data.maxExport || 0,
-this._data.maxExportCapacity || 0),
Math.max(
this._data.maxCapacity || 0,
this._data.maxProduction || 0,
this._data.maxDischarge || 0,
this._data.maxStorageCapacity || 0,
this._data.maxImport || 0,
this._data.maxImportCapacity || 0)
]);
// co2 scale in tCO2eq/min
var maxCO2eqExport = d3.max(this._exchangeData, function (d) {
return d.value >= 0 ? 0 : (that._data.co2intensity / 1e3 * -d.value / 60.0 || 0);
});
var maxCO2eqImport = d3.max(this._exchangeData, function (d) {
if (!that._data.exchangeCo2Intensities) return 0;
return d.value <= 0 ? 0 : that._data.exchangeCo2Intensities[d.key] / 1e3 * d.value / 60.0;
});
this.co2Scale // in tCO2eq/min
.domain(this._co2ScaleDomain || [
-maxCO2eqExport || 0,
Math.max(
d3.max(this.sortedProductionData, function (d) { return d.gCo2eqPerH / 1e6 / 60.0; }) || 0,
maxCO2eqImport || 0
)
]);
// Prepare axis
if (that._displayByEmissions) {
var maxAxisValue = d3.max(this.co2Scale.domain());
var p = d3.precisionPrefix(
(d3.max(this.co2Scale.domain()) - d3.min(this.co2Scale.domain())) / (this.SCALE_TICKS - 1),
maxAxisValue);
var f = d3.formatPrefix('.' + p, maxAxisValue);
this.axis = d3.axisTop(this.co2Scale)
.tickFormat(function (d) {
// convert to kgs if max value is below 1t
return maxAxisValue <= 1 ? `${d*1000} kg/min` : `${f(d)} t/min`
})
}
else {
var value = d3.max(this.powerScale.domain()) * 1e6;
var p = d3.precisionPrefix(
(d3.max(this.powerScale.domain()) - d3.min(this.powerScale.domain())) / (this.SCALE_TICKS - 1) * 1e6,
value);
var f = d3.formatPrefix('.' + p, value);
this.axis = d3.axisTop(this.powerScale)
.tickFormat(function (d) { return f(d * 1e6) + 'W'; });
}
return this;
};
// Hack to fix the scale at a minimum value
CountryTable.prototype.powerScaleDomain = function(arg) {
if (!arguments.length) return this._powerScaleDomain;
this._powerScaleDomain = arg;
return this;
}
CountryTable.prototype.co2ScaleDomain = function(arg) {
if (!arguments.length) return this._co2ScaleDomain;
this._co2ScaleDomain = arg;
return this;
}
CountryTable.prototype.co2color = function(arg) {
if (!arguments.length) return this._co2color;
else this._co2color = arg;
return this;
};
CountryTable.prototype.exchangeKeys = function(arg) {
if (!arguments.length) return this._exchangeKeys;
else {
this._exchangeKeys = arg;
// HACK: Trigger a new data update
this.data(this._data);
}
return this;
};
CountryTable.prototype.showNoParserMessageIf = function(condition) {
const allChildrenSelector = 'p,.country-table-header-inner,.country-show-emissions-wrap,.country-panel-wrap,.country-history';
d3.selectAll(allChildrenSelector).classed('all-screens-hidden', condition);
d3.select('.zone-details-no-parser-message').classed('visible', condition);
}
CountryTable.prototype.showNoDataMessageIf = function(condition, isRealtimeData) {
this.wrapperNoDataOverlay.showIfElseHide(condition);
this.wrapperNoDataOverlay.text(translation.translate(isRealtimeData? 'country-panel.noLiveData' : 'country-panel.noDataAtTimestamp'));
}
module.exports = CountryTable;
|
gpl-3.0
|
tdemarchi/financisto-converter
|
financisto-data/src/main/java/br/tkd/financisto/data/pojo/FinancistoDataEntityTransactionPojo.java
|
16841
|
package br.tkd.financisto.data.pojo;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;
import org.apache.commons.lang3.time.DateFormatUtils;
import br.tkd.financisto.data.FinancistoDataEntityAccount;
import br.tkd.financisto.data.FinancistoDataEntityAttribute;
import br.tkd.financisto.data.FinancistoDataEntityCategory;
import br.tkd.financisto.data.FinancistoDataEntityIdentifiedCollection;
import br.tkd.financisto.data.FinancistoDataEntityProject;
import br.tkd.financisto.data.FinancistoDataEntityTransaction;
import br.tkd.financisto.data.FinancistoDataEntityTransactionAttribute;
import br.tkd.financisto.data.FinancistoDataEntityTransactionIsTemplate;
import br.tkd.financisto.data.FinancistoDataEntityTransactionStatus;
/**
* POJO Financisto data transaction entity.
*/
public class FinancistoDataEntityTransactionPojo extends FinancistoDataEntityIdentifiedPojo implements FinancistoDataEntityTransaction {
private long parentID;
private Date dateTime;
private String note;
private long originalFromAmount;
private long fromAmount;
private long toAmount;
private FinancistoDataEntityTransactionIsTemplate isTemplate;
private String templateName;
private String recurrence;
private String notificationOptions;
private FinancistoDataEntityTransactionStatus status;
private boolean isCCardPayment;
private Date lastRecurrence;
private long categoryID;
private long projectID;
private long fromAccountID;
private long toAccountID;
private long payeeID;
private long originalCurrencyID;
private long locationID;
private int accuracy;
private int latitude;
private int longitude;
private FinancistoDataEntityTransactionPojo parent;
private FinancistoDataEntityCategoryPojo category;
private FinancistoDataEntityAccountPojo fromAccount;
private FinancistoDataEntityAccountPojo toAccount;
private FinancistoDataEntityProjectPojo project;
private FinancistoDataEntityIdentifiedCollection<FinancistoDataEntityTransaction> childrenTransactions = null;
private Map<Long, FinancistoDataEntityTransactionAttributePojo> attributesConnections = new LinkedHashMap<>();
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#getParentID()
*/
public long getParentID() {
return this.parentID;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setParentID(long)
*/
public void setParentID(long parentID) {
this.parentID = parentID;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#getDateTime()
*/
public Date getDateTime() {
return this.dateTime;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setDateTime(java.util.Date)
*/
public void setDateTime(Date dateTime) {
this.dateTime = dateTime;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#getNote()
*/
public String getNote() {
return this.note;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setNote(java.lang.String)
*/
public void setNote(String note) {
this.note = note;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#getOriginalFromAmount()
*/
public long getOriginalFromAmount() {
return this.originalFromAmount;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setOriginalFromAmount(long)
*/
public void setOriginalFromAmount(long originalFromAmount) {
this.originalFromAmount = originalFromAmount;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#getFromAmount()
*/
public long getFromAmount() {
return this.fromAmount;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setFromAmount(long)
*/
public void setFromAmount(long fromAmount) {
this.fromAmount = fromAmount;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#getToAmount()
*/
public long getToAmount() {
return this.toAmount;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setToAmount(long)
*/
public void setToAmount(long toAmount) {
this.toAmount = toAmount;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#isTemplate()
*/
public FinancistoDataEntityTransactionIsTemplate isTemplate() {
return this.isTemplate;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setTemplate(boolean)
*/
public void setIsTemplate(FinancistoDataEntityTransactionIsTemplate isTemplate) {
this.isTemplate = isTemplate;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#getTemplateName()
*/
public String getTemplateName() {
return this.templateName;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setTemplateName(java.lang.String)
*/
public void setTemplateName(String templateName) {
this.templateName = templateName;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#getRecurrence()
*/
public String getRecurrence() {
return this.recurrence;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setRecurrence(java.lang.String)
*/
public void setRecurrence(String recurrence) {
this.recurrence = recurrence;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#getNotificationOptions()
*/
public String getNotificationOptions() {
return this.notificationOptions;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setNotificationOptions(java.lang.String)
*/
public void setNotificationOptions(String notificationOptions) {
this.notificationOptions = notificationOptions;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#getStatus()
*/
public FinancistoDataEntityTransactionStatus getStatus() {
return this.status;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setStatus(br.tkd.financisto.data.FinancistoDataEntityTransactionStatus)
*/
public void setStatus(FinancistoDataEntityTransactionStatus status) {
this.status = status;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#isCCardPayment()
*/
public boolean isCCardPayment() {
return this.isCCardPayment;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setCCardPayment(boolean)
*/
public void setIsCCardPayment(boolean isCCardPayment) {
this.isCCardPayment = isCCardPayment;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#getLastRecurrence()
*/
public Date getLastRecurrence() {
return this.lastRecurrence;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setLastRecurrence(long)
*/
public void setLastRecurrence(Date lastRecurrence) {
this.lastRecurrence = lastRecurrence;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#getCategoryID()
*/
public long getCategoryID() {
return this.categoryID;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setCategoryID(long)
*/
public void setCategoryID(long categoryID) {
this.categoryID = categoryID;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#getProjectID()
*/
public long getProjectID() {
return this.projectID;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setProjectID(long)
*/
public void setProjectID(long projectID) {
this.projectID = projectID;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#getFromAccountID()
*/
public long getFromAccountID() {
return this.fromAccountID;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setFromAccountID(long)
*/
public void setFromAccountID(long fromAccountID) {
this.fromAccountID = fromAccountID;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#getToAccountID()
*/
public long getToAccountID() {
return this.toAccountID;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setToAccountID(long)
*/
public void setToAccountID(long toAccountID) {
this.toAccountID = toAccountID;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#getPayeeID()
*/
public long getPayeeID() {
return this.payeeID;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setPayeeID(long)
*/
public void setPayeeID(long payeeID) {
this.payeeID = payeeID;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#getOriginalCurrencyID()
*/
public long getOriginalCurrencyID() {
return this.originalCurrencyID;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setOriginalCurrencyID(long)
*/
public void setOriginalCurrencyID(long originalCurrencyID) {
this.originalCurrencyID = originalCurrencyID;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#getLocationID()
*/
public long getLocationID() {
return this.locationID;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setLocationID(long)
*/
public void setLocationID(long locationID) {
this.locationID = locationID;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#getAccuracy()
*/
public int getAccuracy() {
return this.accuracy;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setAccuracy(int)
*/
public void setAccuracy(int accuracy) {
this.accuracy = accuracy;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#getLatitude()
*/
public int getLatitude() {
return this.latitude;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setLatitude(int)
*/
public void setLatitude(int latitude) {
this.latitude = latitude;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#getLongitude()
*/
public int getLongitude() {
return this.longitude;
}
/*
* (non-Javadoc)
*
* @see br.tkd.financisto.data.pojo.FinancistoDataEntityTransaction#setLongitude(int)
*/
public void setLongitude(int longitude) {
this.longitude = longitude;
}
@Override
public boolean isDivisionHeader() {
return (this.getCategoryID() < 0);
}
@Override
public boolean isAccountTransfer() {
return (this.getToAccountID() != 0);
}
@Override
public String toString() {
return String.format("%s (id: %d; date: %s; account: %s; amount: %.2f; category path: %s; note: %s)", //
"transaction", this.getID(), DateFormatUtils.format(this.getDateTime(), "dd/MM/yyyy HH:mm"), //
(this.getFromAccount() == null ? "" : this.getFromAccount().getTitle()), (this.getFromAmount() / 100.0), //
(this.getCategory() == null ? "" : this.getCategory().getTitlePath()), //
((this.getParent() == null ? "" : String.format("[COMPOUND: %s] ", this.getParent().getNote())) + this.getNote()));
}
/**
* Set the transaction parent instance.
*
* @param parent
* the transaction parent instance
*/
public void setParent(FinancistoDataEntityTransactionPojo parent) {
if (parent.getID() != getParentID()) {
throw new RuntimeException(String.format("The transaction %d has a parent id %d different from the id %d of the transaction.", getID(), getParentID(), parent.getID()));
}
this.parent = parent;
// Add this transaction as a child of the parent transaction
if (parent.childrenTransactions == null) {
parent.childrenTransactions = new FinancistoDataEntityIdentifiedCollectionPojo<>(FinancistoDataEntityTransaction.class);
}
parent.childrenTransactions.addEntity(this);
}
@Override
public FinancistoDataEntityTransaction getParent() {
return parent;
}
@Override
public FinancistoDataEntityIdentifiedCollection<FinancistoDataEntityTransaction> getChildrenTransactions() {
if (this.childrenTransactions == null) {
return FinancistoDataEntityIdentifiedCollectionEmpty.emptyInstance();
}
return this.childrenTransactions;
}
/**
* Set the transaction category instance.
*
* @param category
* the category parent instance
*/
public void setCategory(FinancistoDataEntityCategoryPojo category) {
if (category.getID() != getCategoryID()) {
throw new RuntimeException(String.format("The transaction %d has a category id %d different from the id %d of the category.", getID(), getCategoryID(), category.getID()));
}
this.category = category;
}
@Override
public FinancistoDataEntityCategory getCategory() {
return category;
}
/**
* Set the transaction from account instance.
*
* @param account
* the account instance
*/
public void setFromAccount(FinancistoDataEntityAccountPojo account) {
if (account.getID() != getFromAccountID()) {
throw new RuntimeException(
String.format("The transaction %d has a from account id %d different from the id %d of the account.", getID(), getFromAccountID(), account.getID()));
}
this.fromAccount = account;
}
@Override
public FinancistoDataEntityAccount getFromAccount() {
return fromAccount;
}
/**
* Set the transaction to account instance.
*
* @param account
* the account instance
*/
public void setToAccount(FinancistoDataEntityAccountPojo account) {
if (account.getID() != getToAccountID()) {
throw new RuntimeException(
String.format("The transaction %d has a to account id %d different from the id %d of the account.", getID(), getToAccountID(), account.getID()));
}
this.toAccount = account;
}
@Override
public FinancistoDataEntityAccount getToAccount() {
return toAccount;
}
/**
* Set the transaction project instance.
*
* @param project
* the project instance
*/
public void setProject(FinancistoDataEntityProjectPojo project) {
if (project.getID() != getProjectID()) {
throw new RuntimeException(
String.format("The transaction %d has a project id %d different from the id %d of the project.", getID(), getProjectID(), project.getID()));
}
this.project = project;
}
@Override
public FinancistoDataEntityProject getProject() {
return project;
}
/**
* Add an attribute connection to the category.
*
* @param attribute
* the attribute connection
*/
public void addAttributeConnection(FinancistoDataEntityTransactionAttributePojo attributeConnection) {
if (attributeConnection.getTransactionID() != getID()) {
throw new RuntimeException(String.format("The connection has the id %d different from the id %d of the transaction.", getID(), attributeConnection.getTransactionID()));
}
this.attributesConnections.put(attributeConnection.getAttributeID(), attributeConnection);
}
@Override
public Collection<FinancistoDataEntityTransactionAttribute> getAttributesConnections() {
return Collections.unmodifiableCollection(attributesConnections.values());
}
@Override
public FinancistoDataEntityTransactionAttribute getAttributeConnection(FinancistoDataEntityAttribute attribute) {
return attributesConnections.get(attribute.getID());
}
}
|
gpl-3.0
|
Polaris1949/Polaris
|
todo/tree-chain.hpp
|
3723
|
class tree_chain
{
private:
int e,beg[200010],nex[200010],to[200010],wt[200010],a[200010<<2],laz[200010<<2],son[200010],id[200010],fa[200010],cnt,dep[200010],siz[200010],top[200010],res=0;
inline void pushdown(int rt,int lenn){
laz[rt<<1]+=laz[rt];
laz[rt<<1|1]+=laz[rt];
a[rt<<1]+=laz[rt]*(lenn-(lenn>>1));
a[rt<<1|1]+=laz[rt]*(lenn>>1);
a[rt<<1]%=mod;
a[rt<<1|1]%=mod;
laz[rt]=0;
}
inline void build(int rt,int l,int r){
if(l==r){
a[rt]=wt[l];
if(a[rt]>mod)a[rt]%=mod;
return;
}
build(rt<<1,l,((l+r)>>1));
build(rt<<1|1,((l+r)>>1)+1,r);
a[rt]=(a[rt<<1]+a[rt<<1|1])%mod;
}
inline void query(int rt,int l,int r,int L,int R){
if(L<=l&&r<=R){res+=a[rt];res%=mod;return;}
else{
if(laz[rt])pushdown(rt,(r-l+1));
if(L<=((l+r)>>1))query(rt<<1,l,((l+r)>>1),L,R);
if(R>((l+r)>>1))query(rt<<1|1,((l+r)>>1)+1,r,L,R);
}
}
inline void update(int rt,int l,int r,int L,int R,int k){
if(L<=l&&r<=R){
laz[rt]+=k;
a[rt]+=k*(r-l+1);
}
else{
if(laz[rt])pushdown(rt,(r-l+1));
if(L<=((l+r)>>1))update(rt<<1,l,((l+r)>>1),L,R,k);
if(R>((l+r)>>1))update(rt<<1|1,((l+r)>>1)+1,r,L,R,k);
a[rt]=(a[rt<<1]+a[rt<<1|1])%mod;
}
}
inline void dfs1(int x,int f,int deep){
dep[x]=deep;
fa[x]=f;
siz[x]=1;
int maxson=-1;
for(register int i=beg[x];i;i=nex[i]){
int y=to[i];
if(y==f)continue;
dfs1(y,x,deep+1);
siz[x]+=siz[y];
if(siz[y]>maxson)son[x]=y,maxson=siz[y];
}
}
inline void dfs2(int x,int topf){
id[x]=++cnt;
wt[cnt]=w[x];
top[x]=topf;
if(!son[x])return;
dfs2(son[x],topf);
for(register int i=beg[x];i;i=nex[i]){
int y=to[i];
if(y==fa[x]||y==son[x])continue;
dfs2(y,y);
}
}
public:
int w[200010];
inline void add_edge(int x,int y){
to[++e]=y;
nex[e]=beg[x];
beg[x]=e;
}
inline int query_range(int x,int y){
int ans=0;
while(top[x]!=top[y]){
if(dep[top[x]]<dep[top[y]])swap(x,y);
res=0;
query(1,1,n,id[top[x]],id[x]);
ans+=res;
ans%=mod;
x=fa[top[x]];
}
if(dep[x]>dep[y])swap(x,y);
res=0;
query(1,1,n,id[x],id[y]);
ans+=res;
return ans%mod;
}
inline void add_range(int x,int y,int k){
k%=mod;
while(top[x]!=top[y]){
if(dep[top[x]]<dep[top[y]])swap(x,y);
update(1,1,n,id[top[x]],id[x],k);
x=fa[top[x]];
}
if(dep[x]>dep[y])swap(x,y);
update(1,1,n,id[x],id[y],k);
}
inline int query_son(int x){
res=0;
query(1,1,n,id[x],id[x]+siz[x]-1);
return res;
}
inline void add_son(int x,int k){
update(1,1,n,id[x],id[x]+siz[x]-1,k);
}
inline void init(int root,int num){
dfs1(root,0,1);
dfs2(root,root);
build(1,1,num);
}
};
|
gpl-3.0
|
aodn/aodn-portal
|
src/test/javascript/portal/search/FacetDrilldownPanelSpec.js
|
3122
|
describe("Portal.search.FacetDrilldownPanel", function() {
var searcher;
var drilldownPanel;
var testContainer;
var mockSearchResponse = Portal.search.SearchSpecHelper.mockSearchResponse;
beforeEach(function() {
searcher = new Portal.service.CatalogSearcher();
drilldownPanel = new Portal.search.FacetDrilldownPanel({
searcher: searcher,
facetName: 'Measured Parameter'
});
});
describe('onSelectionChange', function() {
var nodeSelected = new Ext.tree.TreeNode();
nodeSelected.attributes.value = 'Oxygen';
it('triggers track usage', function() {
spyOn(window, 'trackUsage');
drilldownPanel._onSelectionChange('selectionchange', nodeSelected);
expect(window.trackUsage).toHaveBeenCalledWith(OpenLayers.i18n('facetTrackingCategory'), 'Measured Parameter', 'Oxygen');
});
it('fires drilldownchange event', function() {
spyOn(drilldownPanel, 'fireEvent');
drilldownPanel._onSelectionChange('selectionchange', nodeSelected);
expect(drilldownPanel.fireEvent).toHaveBeenCalledWith('drilldownchange', drilldownPanel);
});
it('sets drilldown path', function() {
drilldownPanel._onSelectionChange('selectionchange', nodeSelected);
expect(drilldownPanel.getDrilldownPath()).toEqual('Oxygen');
});
});
describe('on search complete', function() {
it('sets root node', function() {
var facetNode = new Ext.tree.TreeNode('facet');
spyOn(drilldownPanel, 'setRootNode');
spyOn(searcher, 'hasFacetNode').andReturn(true);
spyOn(searcher, 'getFacetNode').andReturn(facetNode);
drilldownPanel._onSearchComplete();
expect(drilldownPanel.setRootNode).toHaveBeenCalledWith(facetNode);
});
it('hides previously selected drilldowns', function() {
searcher.addDrilldownFilter('Measured%20Parameter/Salinity');
mockSearchResponse(searcher, {
tagName: 'response',
children: [{
tagName: 'summary',
count: 10,
children: [{
tagName: 'dimension',
value: 'Measured Parameter',
count: 10,
children: [{
value: 'Salinity',
count: 6,
leaf: true
}, {
value: 'Pressure',
count: 5,
leaf: true
}, {
value: 'Temperature',
count: 2,
leaf: true
}]
}]
}]
});
var salinityNode = drilldownPanel.root.findChild('value', 'Salinity', true);
expect(salinityNode.hidden).toEqual(true);
});
});
});
|
gpl-3.0
|
dgraziotin/Pomotux
|
src/pomotuxdatabase.cpp
|
29187
|
/* This file is generated by litesql-gen */
#include "pomotuxdatabase.hpp"
namespace pomotuxdatabase {
using namespace litesql;
ActivityInAIS::Row::Row(const litesql::Database& db, const litesql::Record& rec)
: activityInventorySheet(ActivityInAIS::ActivityInventorySheet), activity(ActivityInAIS::Activity)
{
switch (rec.size()) {
case 2:
activityInventorySheet = rec[1];
case 1:
activity = rec[0];
}
}
const std::string ActivityInAIS::table__("_06044cc54d2aba326c362937595d5709");
const litesql::FieldType ActivityInAIS::Activity("Activity1","INTEGER",table__);
const litesql::FieldType ActivityInAIS::ActivityInventorySheet("ActivityInventorySheet2","INTEGER",table__);
void ActivityInAIS::link(const litesql::Database& db, const pomotuxdatabase::Activity& o0, const pomotuxdatabase::ActivityInventorySheet& o1)
{
Record values;
Split fields;
fields.push_back(Activity.name());
values.push_back(o0.id);
fields.push_back(ActivityInventorySheet.name());
values.push_back(o1.id);
db.insert(table__, values, fields);
}
void ActivityInAIS::unlink(const litesql::Database& db, const pomotuxdatabase::Activity& o0, const pomotuxdatabase::ActivityInventorySheet& o1)
{
db.delete_(table__, (Activity == o0.id && ActivityInventorySheet == o1.id));
}
void ActivityInAIS::del(const litesql::Database& db, const litesql::Expr& expr)
{
db.delete_(table__, expr);
}
litesql::DataSource<ActivityInAIS::Row> ActivityInAIS::getRows(const litesql::Database& db, const litesql::Expr& expr)
{
SelectQuery sel;
sel.result(Activity.fullName());
sel.result(ActivityInventorySheet.fullName());
sel.source(table__);
sel.where(expr);
return DataSource<ActivityInAIS::Row>(db, sel);
}
template <> litesql::DataSource<pomotuxdatabase::Activity> ActivityInAIS::get(const litesql::Database& db, const litesql::Expr& expr, const litesql::Expr& srcExpr)
{
SelectQuery sel;
sel.source(table__);
sel.result(Activity.fullName());
sel.where(srcExpr);
return DataSource<pomotuxdatabase::Activity>(db, pomotuxdatabase::Activity::Id.in(sel) && expr);
}
template <> litesql::DataSource<pomotuxdatabase::ActivityInventorySheet> ActivityInAIS::get(const litesql::Database& db, const litesql::Expr& expr, const litesql::Expr& srcExpr)
{
SelectQuery sel;
sel.source(table__);
sel.result(ActivityInventorySheet.fullName());
sel.where(srcExpr);
return DataSource<pomotuxdatabase::ActivityInventorySheet>(db, pomotuxdatabase::ActivityInventorySheet::Id.in(sel) && expr);
}
ActivityInTTS::Row::Row(const litesql::Database& db, const litesql::Record& rec)
: todoTodaySheet(ActivityInTTS::TodoTodaySheet), activity(ActivityInTTS::Activity)
{
switch (rec.size()) {
case 2:
todoTodaySheet = rec[1];
case 1:
activity = rec[0];
}
}
const std::string ActivityInTTS::table__("Activity_TodoTodaySheet_");
const litesql::FieldType ActivityInTTS::Activity("Activity1","INTEGER",table__);
const litesql::FieldType ActivityInTTS::TodoTodaySheet("TodoTodaySheet2","INTEGER",table__);
void ActivityInTTS::link(const litesql::Database& db, const pomotuxdatabase::Activity& o0, const pomotuxdatabase::TodoTodaySheet& o1)
{
Record values;
Split fields;
fields.push_back(Activity.name());
values.push_back(o0.id);
fields.push_back(TodoTodaySheet.name());
values.push_back(o1.id);
db.insert(table__, values, fields);
}
void ActivityInTTS::unlink(const litesql::Database& db, const pomotuxdatabase::Activity& o0, const pomotuxdatabase::TodoTodaySheet& o1)
{
db.delete_(table__, (Activity == o0.id && TodoTodaySheet == o1.id));
}
void ActivityInTTS::del(const litesql::Database& db, const litesql::Expr& expr)
{
db.delete_(table__, expr);
}
litesql::DataSource<ActivityInTTS::Row> ActivityInTTS::getRows(const litesql::Database& db, const litesql::Expr& expr)
{
SelectQuery sel;
sel.result(Activity.fullName());
sel.result(TodoTodaySheet.fullName());
sel.source(table__);
sel.where(expr);
return DataSource<ActivityInTTS::Row>(db, sel);
}
template <> litesql::DataSource<pomotuxdatabase::Activity> ActivityInTTS::get(const litesql::Database& db, const litesql::Expr& expr, const litesql::Expr& srcExpr)
{
SelectQuery sel;
sel.source(table__);
sel.result(Activity.fullName());
sel.where(srcExpr);
return DataSource<pomotuxdatabase::Activity>(db, pomotuxdatabase::Activity::Id.in(sel) && expr);
}
template <> litesql::DataSource<pomotuxdatabase::TodoTodaySheet> ActivityInTTS::get(const litesql::Database& db, const litesql::Expr& expr, const litesql::Expr& srcExpr)
{
SelectQuery sel;
sel.source(table__);
sel.result(TodoTodaySheet.fullName());
sel.where(srcExpr);
return DataSource<pomotuxdatabase::TodoTodaySheet>(db, pomotuxdatabase::TodoTodaySheet::Id.in(sel) && expr);
}
const litesql::FieldType Activity::Own::Id("id_","INTEGER","Activity_");
const std::string Activity::type__("Activity");
const std::string Activity::table__("Activity_");
const std::string Activity::sequence__("Activity_seq");
const litesql::FieldType Activity::Id("id_","INTEGER",table__);
const litesql::FieldType Activity::Type("type_","TEXT",table__);
const litesql::FieldType Activity::MDescription("mDescription_","TEXT",table__);
const litesql::FieldType Activity::MInsertionDate("mInsertionDate_","INTEGER",table__);
const litesql::FieldType Activity::MDeadline("mDeadline_","INTEGER",table__);
const litesql::FieldType Activity::MNumPomodoro("mNumPomodoro_","INTEGER",table__);
const litesql::FieldType Activity::MOrder("mOrder_","INTEGER",table__);
const litesql::FieldType Activity::MIsFinished("mIsFinished_","INTEGER",table__);
void Activity::defaults()
{
id = 0;
mInsertionDate = 0;
mDeadline = 0;
mNumPomodoro = 0;
mOrder = 0;
mIsFinished = false;
}
Activity::Activity(const litesql::Database& db)
: litesql::Persistent(db), id(Id), type(Type), mDescription(MDescription), mInsertionDate(MInsertionDate), mDeadline(MDeadline), mNumPomodoro(MNumPomodoro), mOrder(MOrder), mIsFinished(MIsFinished)
{
defaults();
}
Activity::Activity(const litesql::Database& db, const litesql::Record& rec)
: litesql::Persistent(db, rec), id(Id), type(Type), mDescription(MDescription), mInsertionDate(MInsertionDate), mDeadline(MDeadline), mNumPomodoro(MNumPomodoro), mOrder(MOrder), mIsFinished(MIsFinished)
{
defaults();
size_t size = (rec.size() > 8) ? 8 : rec.size();
switch (size) {
case 8:
mIsFinished = convert<const std::string&, bool>(rec[7]);
mIsFinished.setModified(false);
case 7:
mOrder = convert<const std::string&, int>(rec[6]);
mOrder.setModified(false);
case 6:
mNumPomodoro = convert<const std::string&, int>(rec[5]);
mNumPomodoro.setModified(false);
case 5:
mDeadline = convert<const std::string&, litesql::Date>(rec[4]);
mDeadline.setModified(false);
case 4:
mInsertionDate = convert<const std::string&, litesql::Date>(rec[3]);
mInsertionDate.setModified(false);
case 3:
mDescription = convert<const std::string&, std::string>(rec[2]);
mDescription.setModified(false);
case 2:
type = convert<const std::string&, std::string>(rec[1]);
type.setModified(false);
case 1:
id = convert<const std::string&, int>(rec[0]);
id.setModified(false);
}
}
Activity::Activity(const Activity& obj)
: litesql::Persistent(obj), id(obj.id), type(obj.type), mDescription(obj.mDescription), mInsertionDate(obj.mInsertionDate), mDeadline(obj.mDeadline), mNumPomodoro(obj.mNumPomodoro), mOrder(obj.mOrder), mIsFinished(obj.mIsFinished)
{
}
const Activity& Activity::operator=(const Activity& obj)
{
if (this != &obj) {
id = obj.id;
type = obj.type;
mDescription = obj.mDescription;
mInsertionDate = obj.mInsertionDate;
mDeadline = obj.mDeadline;
mNumPomodoro = obj.mNumPomodoro;
mOrder = obj.mOrder;
mIsFinished = obj.mIsFinished;
}
litesql::Persistent::operator=(obj);
return *this;
}
std::string Activity::insert(litesql::Record& tables, litesql::Records& fieldRecs, litesql::Records& valueRecs)
{
tables.push_back(table__);
litesql::Record fields;
litesql::Record values;
fields.push_back(id.name());
values.push_back(id);
id.setModified(false);
fields.push_back(type.name());
values.push_back(type);
type.setModified(false);
fields.push_back(mDescription.name());
values.push_back(mDescription);
mDescription.setModified(false);
fields.push_back(mInsertionDate.name());
values.push_back(mInsertionDate);
mInsertionDate.setModified(false);
fields.push_back(mDeadline.name());
values.push_back(mDeadline);
mDeadline.setModified(false);
fields.push_back(mNumPomodoro.name());
values.push_back(mNumPomodoro);
mNumPomodoro.setModified(false);
fields.push_back(mOrder.name());
values.push_back(mOrder);
mOrder.setModified(false);
fields.push_back(mIsFinished.name());
values.push_back(mIsFinished);
mIsFinished.setModified(false);
fieldRecs.push_back(fields);
valueRecs.push_back(values);
return litesql::Persistent::insert(tables, fieldRecs, valueRecs, sequence__);
}
void Activity::create()
{
litesql::Record tables;
litesql::Records fieldRecs;
litesql::Records valueRecs;
type = type__;
std::string newID = insert(tables, fieldRecs, valueRecs);
if (id == 0)
id = newID;
}
void Activity::addUpdates(Updates& updates)
{
prepareUpdate(updates, table__);
updateField(updates, table__, id);
updateField(updates, table__, type);
updateField(updates, table__, mDescription);
updateField(updates, table__, mInsertionDate);
updateField(updates, table__, mDeadline);
updateField(updates, table__, mNumPomodoro);
updateField(updates, table__, mOrder);
updateField(updates, table__, mIsFinished);
}
void Activity::addIDUpdates(Updates& updates)
{
}
void Activity::getFieldTypes(std::vector<litesql::FieldType>& ftypes)
{
ftypes.push_back(Id);
ftypes.push_back(Type);
ftypes.push_back(MDescription);
ftypes.push_back(MInsertionDate);
ftypes.push_back(MDeadline);
ftypes.push_back(MNumPomodoro);
ftypes.push_back(MOrder);
ftypes.push_back(MIsFinished);
}
void Activity::delRecord()
{
deleteFromTable(table__, id);
}
void Activity::delRelations()
{
ActivityInAIS::del(*db, (ActivityInAIS::Activity == id));
ActivityInTTS::del(*db, (ActivityInTTS::Activity == id));
}
void Activity::update()
{
if (!inDatabase) {
create();
return;
}
Updates updates;
addUpdates(updates);
if (id != oldKey) {
if (!typeIsCorrect())
upcastCopy()->addIDUpdates(updates);
}
litesql::Persistent::update(updates);
oldKey = id;
}
void Activity::del()
{
if (typeIsCorrect() == false) {
std::auto_ptr<Activity> p(upcastCopy());
p->delRelations();
p->onDelete();
p->delRecord();
} else {
onDelete();
delRecord();
}
inDatabase = false;
}
bool Activity::typeIsCorrect()
{
return type == type__;
}
std::auto_ptr<Activity> Activity::upcast()
{
return auto_ptr<Activity>(new Activity(*this));
}
std::auto_ptr<Activity> Activity::upcastCopy()
{
Activity* np = NULL;
np->id = id;
np->type = type;
np->mDescription = mDescription;
np->mInsertionDate = mInsertionDate;
np->mDeadline = mDeadline;
np->mNumPomodoro = mNumPomodoro;
np->mOrder = mOrder;
np->mIsFinished = mIsFinished;
np->inDatabase = inDatabase;
if (!np)
np = new Activity(*this);
return auto_ptr<Activity>(np);
}
std::ostream & operator<<(std::ostream& os, Activity o)
{
os << "-------------------------------------" << std::endl;
os << o.id.name() << " = " << o.id << std::endl;
os << o.type.name() << " = " << o.type << std::endl;
os << o.mDescription.name() << " = " << o.mDescription << std::endl;
os << o.mInsertionDate.name() << " = " << o.mInsertionDate << std::endl;
os << o.mDeadline.name() << " = " << o.mDeadline << std::endl;
os << o.mNumPomodoro.name() << " = " << o.mNumPomodoro << std::endl;
os << o.mOrder.name() << " = " << o.mOrder << std::endl;
os << o.mIsFinished.name() << " = " << o.mIsFinished << std::endl;
os << "-------------------------------------" << std::endl;
return os;
}
const litesql::FieldType ActivityInventorySheet::Own::Id("id_","INTEGER","ActivityInventorySheet_");
const std::string ActivityInventorySheet::type__("ActivityInventorySheet");
const std::string ActivityInventorySheet::table__("ActivityInventorySheet_");
const std::string ActivityInventorySheet::sequence__("ActivityInventorySheet_seq");
const litesql::FieldType ActivityInventorySheet::Id("id_","INTEGER",table__);
const litesql::FieldType ActivityInventorySheet::Type("type_","TEXT",table__);
void ActivityInventorySheet::defaults()
{
id = 0;
}
ActivityInventorySheet::ActivityInventorySheet(const litesql::Database& db)
: litesql::Persistent(db), id(Id), type(Type)
{
defaults();
}
ActivityInventorySheet::ActivityInventorySheet(const litesql::Database& db, const litesql::Record& rec)
: litesql::Persistent(db, rec), id(Id), type(Type)
{
defaults();
size_t size = (rec.size() > 2) ? 2 : rec.size();
switch (size) {
case 2:
type = convert<const std::string&, std::string>(rec[1]);
type.setModified(false);
case 1:
id = convert<const std::string&, int>(rec[0]);
id.setModified(false);
}
}
ActivityInventorySheet::ActivityInventorySheet(const ActivityInventorySheet& obj)
: litesql::Persistent(obj), id(obj.id), type(obj.type)
{
}
const ActivityInventorySheet& ActivityInventorySheet::operator=(const ActivityInventorySheet& obj)
{
if (this != &obj) {
id = obj.id;
type = obj.type;
}
litesql::Persistent::operator=(obj);
return *this;
}
std::string ActivityInventorySheet::insert(litesql::Record& tables, litesql::Records& fieldRecs, litesql::Records& valueRecs)
{
tables.push_back(table__);
litesql::Record fields;
litesql::Record values;
fields.push_back(id.name());
values.push_back(id);
id.setModified(false);
fields.push_back(type.name());
values.push_back(type);
type.setModified(false);
fieldRecs.push_back(fields);
valueRecs.push_back(values);
return litesql::Persistent::insert(tables, fieldRecs, valueRecs, sequence__);
}
void ActivityInventorySheet::create()
{
litesql::Record tables;
litesql::Records fieldRecs;
litesql::Records valueRecs;
type = type__;
std::string newID = insert(tables, fieldRecs, valueRecs);
if (id == 0)
id = newID;
}
void ActivityInventorySheet::addUpdates(Updates& updates)
{
prepareUpdate(updates, table__);
updateField(updates, table__, id);
updateField(updates, table__, type);
}
void ActivityInventorySheet::addIDUpdates(Updates& updates)
{
}
void ActivityInventorySheet::getFieldTypes(std::vector<litesql::FieldType>& ftypes)
{
ftypes.push_back(Id);
ftypes.push_back(Type);
}
void ActivityInventorySheet::delRecord()
{
deleteFromTable(table__, id);
}
void ActivityInventorySheet::delRelations()
{
ActivityInAIS::del(*db, (ActivityInAIS::ActivityInventorySheet == id));
}
void ActivityInventorySheet::update()
{
if (!inDatabase) {
create();
return;
}
Updates updates;
addUpdates(updates);
if (id != oldKey) {
if (!typeIsCorrect())
upcastCopy()->addIDUpdates(updates);
}
litesql::Persistent::update(updates);
oldKey = id;
}
void ActivityInventorySheet::del()
{
if (typeIsCorrect() == false) {
std::auto_ptr<ActivityInventorySheet> p(upcastCopy());
p->delRelations();
p->onDelete();
p->delRecord();
} else {
onDelete();
delRecord();
}
inDatabase = false;
}
bool ActivityInventorySheet::typeIsCorrect()
{
return type == type__;
}
std::auto_ptr<ActivityInventorySheet> ActivityInventorySheet::upcast()
{
return auto_ptr<ActivityInventorySheet>(new ActivityInventorySheet(*this));
}
std::auto_ptr<ActivityInventorySheet> ActivityInventorySheet::upcastCopy()
{
ActivityInventorySheet* np = NULL;
np->id = id;
np->type = type;
np->inDatabase = inDatabase;
if (!np)
np = new ActivityInventorySheet(*this);
return auto_ptr<ActivityInventorySheet>(np);
}
std::ostream & operator<<(std::ostream& os, ActivityInventorySheet o)
{
os << "-------------------------------------" << std::endl;
os << o.id.name() << " = " << o.id << std::endl;
os << o.type.name() << " = " << o.type << std::endl;
os << "-------------------------------------" << std::endl;
return os;
}
const litesql::FieldType TodoTodaySheet::Own::Id("id_","INTEGER","TodoTodaySheet_");
const std::string TodoTodaySheet::type__("TodoTodaySheet");
const std::string TodoTodaySheet::table__("TodoTodaySheet_");
const std::string TodoTodaySheet::sequence__("TodoTodaySheet_seq");
const litesql::FieldType TodoTodaySheet::Id("id_","INTEGER",table__);
const litesql::FieldType TodoTodaySheet::Type("type_","TEXT",table__);
void TodoTodaySheet::defaults()
{
id = 0;
}
TodoTodaySheet::TodoTodaySheet(const litesql::Database& db)
: litesql::Persistent(db), id(Id), type(Type)
{
defaults();
}
TodoTodaySheet::TodoTodaySheet(const litesql::Database& db, const litesql::Record& rec)
: litesql::Persistent(db, rec), id(Id), type(Type)
{
defaults();
size_t size = (rec.size() > 2) ? 2 : rec.size();
switch (size) {
case 2:
type = convert<const std::string&, std::string>(rec[1]);
type.setModified(false);
case 1:
id = convert<const std::string&, int>(rec[0]);
id.setModified(false);
}
}
TodoTodaySheet::TodoTodaySheet(const TodoTodaySheet& obj)
: litesql::Persistent(obj), id(obj.id), type(obj.type)
{
}
const TodoTodaySheet& TodoTodaySheet::operator=(const TodoTodaySheet& obj)
{
if (this != &obj) {
id = obj.id;
type = obj.type;
}
litesql::Persistent::operator=(obj);
return *this;
}
std::string TodoTodaySheet::insert(litesql::Record& tables, litesql::Records& fieldRecs, litesql::Records& valueRecs)
{
tables.push_back(table__);
litesql::Record fields;
litesql::Record values;
fields.push_back(id.name());
values.push_back(id);
id.setModified(false);
fields.push_back(type.name());
values.push_back(type);
type.setModified(false);
fieldRecs.push_back(fields);
valueRecs.push_back(values);
return litesql::Persistent::insert(tables, fieldRecs, valueRecs, sequence__);
}
void TodoTodaySheet::create()
{
litesql::Record tables;
litesql::Records fieldRecs;
litesql::Records valueRecs;
type = type__;
std::string newID = insert(tables, fieldRecs, valueRecs);
if (id == 0)
id = newID;
}
void TodoTodaySheet::addUpdates(Updates& updates)
{
prepareUpdate(updates, table__);
updateField(updates, table__, id);
updateField(updates, table__, type);
}
void TodoTodaySheet::addIDUpdates(Updates& updates)
{
}
void TodoTodaySheet::getFieldTypes(std::vector<litesql::FieldType>& ftypes)
{
ftypes.push_back(Id);
ftypes.push_back(Type);
}
void TodoTodaySheet::delRecord()
{
deleteFromTable(table__, id);
}
void TodoTodaySheet::delRelations()
{
ActivityInTTS::del(*db, (ActivityInTTS::TodoTodaySheet == id));
}
void TodoTodaySheet::update()
{
if (!inDatabase) {
create();
return;
}
Updates updates;
addUpdates(updates);
if (id != oldKey) {
if (!typeIsCorrect())
upcastCopy()->addIDUpdates(updates);
}
litesql::Persistent::update(updates);
oldKey = id;
}
void TodoTodaySheet::del()
{
if (typeIsCorrect() == false) {
std::auto_ptr<TodoTodaySheet> p(upcastCopy());
p->delRelations();
p->onDelete();
p->delRecord();
} else {
onDelete();
delRecord();
}
inDatabase = false;
}
bool TodoTodaySheet::typeIsCorrect()
{
return type == type__;
}
std::auto_ptr<TodoTodaySheet> TodoTodaySheet::upcast()
{
return auto_ptr<TodoTodaySheet>(new TodoTodaySheet(*this));
}
std::auto_ptr<TodoTodaySheet> TodoTodaySheet::upcastCopy()
{
TodoTodaySheet* np = NULL;
np->id = id;
np->type = type;
np->inDatabase = inDatabase;
if (!np)
np = new TodoTodaySheet(*this);
return auto_ptr<TodoTodaySheet>(np);
}
std::ostream & operator<<(std::ostream& os, TodoTodaySheet o)
{
os << "-------------------------------------" << std::endl;
os << o.id.name() << " = " << o.id << std::endl;
os << o.type.name() << " = " << o.type << std::endl;
os << "-------------------------------------" << std::endl;
return os;
}
const litesql::FieldType Settings::Own::Id("id_","INTEGER","Settings_");
const std::string Settings::type__("Settings");
const std::string Settings::table__("Settings_");
const std::string Settings::sequence__("Settings_seq");
const litesql::FieldType Settings::Id("id_","INTEGER",table__);
const litesql::FieldType Settings::Type("type_","TEXT",table__);
const litesql::FieldType Settings::MName("mName_","TEXT",table__);
const litesql::FieldType Settings::MValue("mValue_","TEXT",table__);
void Settings::defaults()
{
id = 0;
}
Settings::Settings(const litesql::Database& db)
: litesql::Persistent(db), id(Id), type(Type), mName(MName), mValue(MValue)
{
defaults();
}
Settings::Settings(const litesql::Database& db, const litesql::Record& rec)
: litesql::Persistent(db, rec), id(Id), type(Type), mName(MName), mValue(MValue)
{
defaults();
size_t size = (rec.size() > 4) ? 4 : rec.size();
switch (size) {
case 4:
mValue = convert<const std::string&, std::string>(rec[3]);
mValue.setModified(false);
case 3:
mName = convert<const std::string&, std::string>(rec[2]);
mName.setModified(false);
case 2:
type = convert<const std::string&, std::string>(rec[1]);
type.setModified(false);
case 1:
id = convert<const std::string&, int>(rec[0]);
id.setModified(false);
}
}
Settings::Settings(const Settings& obj)
: litesql::Persistent(obj), id(obj.id), type(obj.type), mName(obj.mName), mValue(obj.mValue)
{
}
const Settings& Settings::operator=(const Settings& obj)
{
if (this != &obj) {
id = obj.id;
type = obj.type;
mName = obj.mName;
mValue = obj.mValue;
}
litesql::Persistent::operator=(obj);
return *this;
}
std::string Settings::insert(litesql::Record& tables, litesql::Records& fieldRecs, litesql::Records& valueRecs)
{
tables.push_back(table__);
litesql::Record fields;
litesql::Record values;
fields.push_back(id.name());
values.push_back(id);
id.setModified(false);
fields.push_back(type.name());
values.push_back(type);
type.setModified(false);
fields.push_back(mName.name());
values.push_back(mName);
mName.setModified(false);
fields.push_back(mValue.name());
values.push_back(mValue);
mValue.setModified(false);
fieldRecs.push_back(fields);
valueRecs.push_back(values);
return litesql::Persistent::insert(tables, fieldRecs, valueRecs, sequence__);
}
void Settings::create()
{
litesql::Record tables;
litesql::Records fieldRecs;
litesql::Records valueRecs;
type = type__;
std::string newID = insert(tables, fieldRecs, valueRecs);
if (id == 0)
id = newID;
}
void Settings::addUpdates(Updates& updates)
{
prepareUpdate(updates, table__);
updateField(updates, table__, id);
updateField(updates, table__, type);
updateField(updates, table__, mName);
updateField(updates, table__, mValue);
}
void Settings::addIDUpdates(Updates& updates)
{
}
void Settings::getFieldTypes(std::vector<litesql::FieldType>& ftypes)
{
ftypes.push_back(Id);
ftypes.push_back(Type);
ftypes.push_back(MName);
ftypes.push_back(MValue);
}
void Settings::delRecord()
{
deleteFromTable(table__, id);
}
void Settings::delRelations()
{
}
void Settings::update()
{
if (!inDatabase) {
create();
return;
}
Updates updates;
addUpdates(updates);
if (id != oldKey) {
if (!typeIsCorrect())
upcastCopy()->addIDUpdates(updates);
}
litesql::Persistent::update(updates);
oldKey = id;
}
void Settings::del()
{
if (typeIsCorrect() == false) {
std::auto_ptr<Settings> p(upcastCopy());
p->delRelations();
p->onDelete();
p->delRecord();
} else {
onDelete();
delRecord();
}
inDatabase = false;
}
bool Settings::typeIsCorrect()
{
return type == type__;
}
std::auto_ptr<Settings> Settings::upcast()
{
return auto_ptr<Settings>(new Settings(*this));
}
std::auto_ptr<Settings> Settings::upcastCopy()
{
Settings* np = NULL;
np->id = id;
np->type = type;
np->mName = mName;
np->mValue = mValue;
np->inDatabase = inDatabase;
if (!np)
np = new Settings(*this);
return auto_ptr<Settings>(np);
}
std::ostream & operator<<(std::ostream& os, Settings o)
{
os << "-------------------------------------" << std::endl;
os << o.id.name() << " = " << o.id << std::endl;
os << o.type.name() << " = " << o.type << std::endl;
os << o.mName.name() << " = " << o.mName << std::endl;
os << o.mValue.name() << " = " << o.mValue << std::endl;
os << "-------------------------------------" << std::endl;
return os;
}
PomotuxDatabase::PomotuxDatabase(std::string backendType, std::string connInfo)
: litesql::Database(backendType, connInfo)
{
initialize();
}
std::vector<litesql::Database::SchemaItem> PomotuxDatabase::getSchema() const
{
vector<Database::SchemaItem> res;
res.push_back(Database::SchemaItem("schema_","table","CREATE TABLE schema_ (name_ TEXT, type_ TEXT, sql_ TEXT);"));
if (backend->supportsSequences()) {
res.push_back(Database::SchemaItem("Activity_seq","sequence","CREATE SEQUENCE Activity_seq START 1 INCREMENT 1"));
res.push_back(Database::SchemaItem("ActivityInventorySheet_seq","sequence","CREATE SEQUENCE ActivityInventorySheet_seq START 1 INCREMENT 1"));
res.push_back(Database::SchemaItem("TodoTodaySheet_seq","sequence","CREATE SEQUENCE TodoTodaySheet_seq START 1 INCREMENT 1"));
res.push_back(Database::SchemaItem("Settings_seq","sequence","CREATE SEQUENCE Settings_seq START 1 INCREMENT 1"));
}
res.push_back(Database::SchemaItem("Activity_","table","CREATE TABLE Activity_ (id_ " + backend->getRowIDType() + ",type_ TEXT,mDescription_ TEXT,mInsertionDate_ INTEGER,mDeadline_ INTEGER,mNumPomodoro_ INTEGER,mOrder_ INTEGER,mIsFinished_ INTEGER)"));
res.push_back(Database::SchemaItem("ActivityInventorySheet_","table","CREATE TABLE ActivityInventorySheet_ (id_ " + backend->getRowIDType() + ",type_ TEXT)"));
res.push_back(Database::SchemaItem("TodoTodaySheet_","table","CREATE TABLE TodoTodaySheet_ (id_ " + backend->getRowIDType() + ",type_ TEXT)"));
res.push_back(Database::SchemaItem("Settings_","table","CREATE TABLE Settings_ (id_ " + backend->getRowIDType() + ",type_ TEXT,mName_ TEXT,mValue_ TEXT)"));
res.push_back(Database::SchemaItem("_06044cc54d2aba326c362937595d5709","table","CREATE TABLE _06044cc54d2aba326c362937595d5709 (Activity1 INTEGER UNIQUE,ActivityInventorySheet2 INTEGER)"));
res.push_back(Database::SchemaItem("Activity_TodoTodaySheet_","table","CREATE TABLE Activity_TodoTodaySheet_ (Activity1 INTEGER UNIQUE,TodoTodaySheet2 INTEGER)"));
res.push_back(Database::SchemaItem("_cb57b43da17da05f58b6c4cb99b69ab1","index","CREATE INDEX _cb57b43da17da05f58b6c4cb99b69ab1 ON _06044cc54d2aba326c362937595d5709 (Activity1)"));
res.push_back(Database::SchemaItem("_a39a664b70ff48d2712a612321afe25a","index","CREATE INDEX _a39a664b70ff48d2712a612321afe25a ON _06044cc54d2aba326c362937595d5709 (ActivityInventorySheet2)"));
res.push_back(Database::SchemaItem("_5e72e2d2961ee8074a50f61945b4d8d6","index","CREATE INDEX _5e72e2d2961ee8074a50f61945b4d8d6 ON _06044cc54d2aba326c362937595d5709 (Activity1,ActivityInventorySheet2)"));
res.push_back(Database::SchemaItem("_819f6c8604a2ed951954e6d2e5783cff","index","CREATE INDEX _819f6c8604a2ed951954e6d2e5783cff ON Activity_TodoTodaySheet_ (Activity1)"));
res.push_back(Database::SchemaItem("_7517cb999f4a2d220446a6e2fa66ccd7","index","CREATE INDEX _7517cb999f4a2d220446a6e2fa66ccd7 ON Activity_TodoTodaySheet_ (TodoTodaySheet2)"));
res.push_back(Database::SchemaItem("_0cc98704fb046de91749a1aa7c6c4f96","index","CREATE INDEX _0cc98704fb046de91749a1aa7c6c4f96 ON Activity_TodoTodaySheet_ (Activity1,TodoTodaySheet2)"));
return res;
}
void PomotuxDatabase::initialize()
{
static bool initialized = false;
if (initialized)
return;
initialized = true;
}
}
|
gpl-3.0
|
roelmann/uswmoodle
|
question/type/opaque/backup/moodle2/restore_qtype_opaque_plugin.class.php
|
3532
|
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package qtype_opaque
* @copyright 2011 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/question/type/opaque/enginemanager.php');
/**
* Restore plugin class that provides the necessary information
* needed to restore one ddwtos qtype plugin.
*
* @copyright 2011 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class restore_qtype_opaque_plugin extends restore_qtype_plugin {
protected $enginemanager = null;
/* Overridden. See parent class for docs. */
protected function define_question_plugin_structure() {
return array(
new restore_path_element('opaque', $this->get_pathfor('/opaque'), true),
new restore_path_element('engine', $this->get_pathfor('/opaque/engine')),
new restore_path_element('server', $this->get_pathfor('/opaque/engine/server')),
);
}
/**
* Process the qtype/opaque element.
*/
public function process_opaque($data) {
global $DB;
$engine = (object) $data['engine'][0];
$engine->questionengines = array();
$engine->questionbanks = array();
foreach ($data['engine'][0]['server'] as $server) {
if ($server['type'] == 'qe') {
$engine->questionengines[] = $server['url'];
} else if ($server['type'] == 'qb') {
$engine->questionbanks[] = $server['url'];
}
}
if (empty($engine->questionengines)) {
throw new coding_exception(
'Missing question engine URLs in an Opaque question backup.');
}
// Detect if the question is created or mapped.
$oldquestionid = $this->get_old_parentid('question');
$newquestionid = $this->get_new_parentid('question');
$questioncreated = $this->get_mappingid('question_created', $oldquestionid) ? true : false;
// If the question has been created by restore, we need to create its
// question_ddwtos too.
if ($questioncreated) {
// New question, insert.
$question = (object) $data;
$question->engineid = qtype_opaque_engine_manager::get()->find_or_create($engine);
$question->questionid = $newquestionid;
$DB->insert_record('qtype_opaque_options', $question);
}
}
/**
* Process the qtype/opaque/server element
*/
public function process_engine($data) {
// Do nothing. All the data is processed in process_opaque.
}
/**
* Process the qtype/opaque/server element
*/
public function process_server($data) {
// Do nothing. All the data is processed in process_opaque.
}
}
|
gpl-3.0
|
daria-mih/DPR
|
Week 5/CommandPattern/commands/On.cs
|
434
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CommandPattern
{
public class On : Command
{
Device device;
public On(Device d)
{
device = d;
}
public void execute()
{
device.on();
}
public void undo()
{
device.off();
}
}
}
|
gpl-3.0
|
pacomus/roboblocks
|
src/blocks/text_char_special/text_char_special.js
|
1218
|
'use strict';
/* global Blockly, JST, RoboBlocks */
/* jshint sub:true */
/**
* text_char_special code generation
* @return {String} Code generated with block parameters
*/
Blockly.Arduino.text_char_special = function() {
var char = this.getFieldValue('CHAR');
var code = JST['text_char_special']({
'char': char
});
return [code, Blockly.Arduino.ORDER_ATOMIC];
};
/**
* text_char_special block definition
* @type {Object}
*/
Blockly.Blocks.text_char_special = {
category: RoboBlocks.locales.getKey('LANG_CATEGORY_TEXT'),
helpUrl: RoboBlocks.URL_TEXT,
tags: ['text'],
/**
* text_char_special initialization
*/
init: function() {
this.setColour(RoboBlocks.LANG_COLOUR_TEXT);
this.appendDummyInput('')
.appendField(RoboBlocks.locales.getKey('LANG_TEXT_SPECIAL'))
.appendField(new Blockly.FieldDropdown([
[RoboBlocks.locales.getKey('LANG_TEXT_SPECIAL_TAB')||'TAB', '\\t'],
[RoboBlocks.locales.getKey('LANG_TEXT_SPECIAL_CARRIAGE_RETURN')||'CARRIAGE RETURN', '\\r'],
[RoboBlocks.locales.getKey('LANG_TEXT_SPECIAL_LINE_FEED')||'LINE FEED', '\\n']
]), 'CHAR');
this.setOutput(true, String);
this.setTooltip(RoboBlocks.locales.getKey('LANG_TEXT_SPECIAL_TOOLTIP'));
}
};
|
gpl-3.0
|
alexisamzpro/HypeV3
|
tradeIlegal/organe.lua
|
11089
|
----------------------------------------------------
--===================Aurelien=====================--
----------------------------------------------------
------------------------Lua-------------------------
local DrawMarkerShow = true
local DrawBlipTradeShow = true
-- -900.0, -3002.0, 13.0
-- -800.0, -3002.0, 13.0
-- -1078.0, -3002.0, 13.0
local Price = 1500
local Position = {
-- VOS POINTS ICI
Recolet={x=0.0,y=0.0,z=0.0, distance=2},
traitement={x=0.0,y=0.0,z=0.0, distance=2},
traitement2={x=0.0,y=0.0,z=0.0, distance=2},
traitement3={x=0.0,y=0.0,z=0.0, distance=2},
vente={x=0.0,y=0.0,z=0.0, distance=2}
}
function drawTxt(text,font,centre,x,y,scale,r,g,b,a)
SetTextFont(font)
SetTextProportional(0)
SetTextScale(scale, scale)
SetTextColour(r, g, b, a)
SetTextDropShadow(0, 0, 0, 0,255)
SetTextEdge(1, 0, 0, 0, 255)
SetTextDropShadow()
SetTextOutline()
SetTextCentre(centre)
SetTextEntry("STRING")
AddTextComponentString(text)
DrawText(x, y)
end
function ShowInfo(text, state)
SetTextComponentFormat("STRING")
AddTextComponentString(text)DisplayHelpTextFromStringLabel(0, state, 0, -1)
end
function IsInVehicle()
local ply = GetPlayerPed(-1)
if IsPedSittingInAnyVehicle(ply) then
return true
else
return false
end
end
local ShowMsgtime = { msg = "", time = 0 }
local weedcount = 0
AddEventHandler("tradeill:cbgetQuantity", function(itemQty)
weedcount = itemQty
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if ShowMsgtime.time ~= 0 then
drawTxt(ShowMsgtime.msg, 0, 1, 0.5, 0.8, 0.6, 255, 255, 255, 255)
ShowMsgtime.time = ShowMsgtime.time - 1
end
end
end)
Citizen.CreateThread(function()
if DrawBlipTradeShow then
--SetBlipTrade(273, "~g~ Voler ~b~Organe", 2, Position.Recolet.x, Position.Recolet.y, Position.Recolet.z)
--SetBlipTrade(42, "~g~ Emballage... ~b~d'organe", 1, Position.traitement.x, Position.traitement.y, Position.traitement.z)
--SetBlipTrade(171, "~g~ Analyse... ~b~des organes", 1, Position.traitement2.x, Position.traitement2.y, Position.traitement2.z)
--SetBlipTrade(459, "~g~ Recherche... ~b~de client potentiel", 1, Position.traitement3.x, Position.traitement3.y, Position.traitement3.z)
--SetBlipTrade(458, "~g~ Vendre ~b~organe emballé", 1, Position.vente.x, Position.vente.y, Position.vente.z)
end
while true do
Citizen.Wait(0)
if DrawMarkerShow then
--DrawMarker(1, Position.Recolet.x, Position.Recolet.y, Position.Recolet.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4.0, 4.0, 1.0, 0, 0, 255, 75, 0, 0, 2, 0, 0, 0, 0)
--DrawMarker(1, Position.traitement.x, Position.traitement.y, Position.traitement.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4.0, 4.0, 1.0, 0, 0, 255, 25, 0, 0, 2, 0, 0, 0, 0)
--DrawMarker(1, Position.traitement2.x, Position.traitement2.y, Position.traitement2.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4.0, 4.0, 1.0, 0, 0, 255, 25, 0, 0, 2, 0, 0, 0, 0)
-- DrawMarker(1, Position.traitement3.x, Position.traitement3.y, Position.traitement3.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4.0, 4.0, 1.0, 0, 0, 255, 25, 0, 0, 2, 0, 0, 0, 0)
--DrawMarker(1, Position.vente.x, Position.vente.y, Position.vente.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4.0, 4.0, 1.0, 0, 0, 255, 75, 0, 0, 2, 0, 0, 0, 0)
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local playerPos = GetEntityCoords(GetPlayerPed(-1))
local distanceWeedFarm = GetDistanceBetweenCoords(playerPos.x, playerPos.y, playerPos.z, Position.Recolet.x, Position.Recolet.y, Position.Recolet.z, true)
if not IsInVehicle() then
if distanceWeedFarm < Position.Recolet.distance then
ShowInfo('~b~Appuyer sur ~g~E~b~ pour ramasser', 0)
if IsControlJustPressed(1, 38) then
weedcount = 0
-- TriggerEvent("player:getQuantity", 4, function(data)
-- weedcount = data.count
-- end)
TriggerEvent("player:getQuantity", 13)
Wait(100)
Citizen.Wait(1)
if weedcount < 30 then
ShowMsgtime.msg = '~g~ Prendre ~b~un organe'
ShowMsgtime.time = 250
TriggerEvent("vmenu:anim" ,"pickup_object", "pickup_low")
Wait(2500)
ShowMsgtime.msg = '~g~ + 1 ~b~organe'
ShowMsgtime.time = 150
TriggerEvent("player:receiveItem", 13, 1) --13
else
ShowMsgtime.msg = '~r~ Inventaire plein !'
ShowMsgtime.time = 150
end
end
end
end
-------------------------Bloc Pour rajouter un traitement-------------------------------------------
local distanceWeedFarm = GetDistanceBetweenCoords(playerPos.x, playerPos.y, playerPos.z, Position.traitement.x, Position.traitement.y, Position.traitement.z, true)
if not IsInVehicle() then
if distanceWeedFarm < Position.traitement.distance then
ShowInfo('~b~Appuyer sur ~g~E~b~ pour emballer ~b~organe', 0)
if IsControlJustPressed(1, 38) then
weedcount = 0
-- TriggerEvent("player:getQuantity", 6, function(data)
-- weedcount = data.count
-- end)
TriggerEvent("player:getQuantity", 13) --13
Wait(100)
if weedcount ~= 0 then
ShowMsgtime.msg = '~g~ Emballer ~b~organe'
ShowMsgtime.time = 250
TriggerEvent("vmenu:anim" ,"pickup_object", "pickup_low")
Wait(2500)
ShowMsgtime.msg = '~g~ + 1 ~b~Organe emballé'
ShowMsgtime.time = 150
TriggerEvent("player:looseItem", 13, 1) --13
TriggerEvent("player:receiveItem", 14, 1) --14
else
ShowMsgtime.msg = "~r~ Vous n'avez pas d'organe !"
ShowMsgtime.time = 150
end
end
end
end
local distanceWeedFarm = GetDistanceBetweenCoords(playerPos.x, playerPos.y, playerPos.z, Position.traitement2.x, Position.traitement2.y, Position.traitement2.z, true)
if not IsInVehicle() then
if distanceWeedFarm < Position.traitement2.distance then
ShowInfo('~b~Appuyer sur ~g~E~b~ pour analyser ~b~Organe emballé', 0)
if IsControlJustPressed(1, 38) then
weedcount = 0
-- TriggerEvent("player:getQuantity", 6, function(data)
-- weedcount = data.count
-- end)
TriggerEvent("player:getQuantity", 14)
Wait(100)
if weedcount ~= 0 then
ShowMsgtime.msg = '~g~ Analyser ~b~Organe emballé'
ShowMsgtime.time = 250
TriggerEvent("vmenu:anim" ,"pickup_object", "pickup_low")
Wait(2500)
ShowMsgtime.msg = '~g~ + 1 ~b~Organe analysé'
ShowMsgtime.time = 150
TriggerEvent("player:looseItem", 14, 1) --14
TriggerEvent("player:receiveItem", 15, 1) --15
else
ShowMsgtime.msg = "~r~ Vous n'avez pas d'organe emballé !"
ShowMsgtime.time = 150
end
end
end
end
local distanceWeedFarm = GetDistanceBetweenCoords(playerPos.x, playerPos.y, playerPos.z, Position.traitement3.x, Position.traitement3.y, Position.traitement3.z, true)
if not IsInVehicle() then
if distanceWeedFarm < Position.traitement3.distance then
ShowInfo('~b~Appuyer sur ~g~E~b~ pour ~b~trouver des clients', 0)
if IsControlJustPressed(1, 38) then
weedcount = 0
-- TriggerEvent("player:getQuantity", 6, function(data)
-- weedcount = data.count
-- end)
TriggerEvent("player:getQuantity", 15)
Wait(100)
if weedcount ~= 0 then
ShowMsgtime.msg = '~g~ Recherche... ~b~de clients potentiels...'
ShowMsgtime.time = 250
TriggerEvent("vmenu:anim" ,"pickup_object", "pickup_low")
Wait(2500)
ShowMsgtime.msg = '~g~ Vous avez trouvé un ~b~client'
ShowMsgtime.time = 150
TriggerEvent("player:looseItem", 15, 1) --16
TriggerEvent("player:receiveItem", 16, 1) --17
else
ShowMsgtime.msg = "~r~ Vous n'avez pas d'organe analysé !"..weedcount
ShowMsgtime.time = 150
end
end
end
end
-------------------------Fin Du Bloc Pour rajouter un traitement-------------------------------------------
local distanceWeedFarm = GetDistanceBetweenCoords(playerPos.x, playerPos.y, playerPos.z, Position.vente.x, Position.vente.y, Position.vente.z, true)
if not IsInVehicle() then
if distanceWeedFarm < Position.vente.distance then
ShowInfo('~b~ Appuyer sur ~g~E~b~ pour vendre', 0)
if IsControlJustPressed(1, 38) then
weedcount = 0
-- TriggerEvent("player:getQuantity", 7, function(data)
-- weedcount = data.count
-- end)
TriggerEvent("player:getQuantity", 16)
Wait(100)
if weedcount ~= 0 then
ShowMsgtime.msg = '~g~ Vendre ~b~organe'
ShowMsgtime.time = 250
TriggerEvent("vmenu:anim" ,"pickup_object", "pickup_low")
Wait(2500)
ShowMsgtime.msg = '~g~ +'..Price..'$'
ShowMsgtime.time = 150
TriggerEvent("player:sellItem", 16, Price) --17
else
ShowMsgtime.msg = "~r~Vous n'avez pas organe !"
ShowMsgtime.time = 150
end
end
end
end
end
end)
function SetBlipTrade(id, text, color, x, y, z)
local Blip = AddBlipForCoord(x, y, z)
SetBlipSprite(Blip, id)
SetBlipColour(Blip, color)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString(text)
EndTextCommandSetBlipName(Blip)
end
|
gpl-3.0
|
smart-facility/cognicity-server
|
test/testValidation.js
|
1630
|
'use strict';
/* jshint -W079 */ // Ignore this error for this import only, as we get a redefinition problem
var test = require('unit.js');
/* jshint +W079 */
var Validation = require('../Validation.js');
var moment = require('moment');
describe( "validateNumberParameter", function() {
it( 'passes with a number', function() {
test.bool( Validation.validateNumberParameter( 7 ) ).isTrue();
});
it( 'fails if type is not number', function() {
test.bool( Validation.validateNumberParameter( "7" ) ).isFalse();
});
it( 'fails if number is NaN', function() {
test.bool( Validation.validateNumberParameter( NaN ) ).isFalse();
});
it( 'fails if number is less than min', function() {
test.bool( Validation.validateNumberParameter( 7, 8, 9 ) ).isFalse();
});
it( 'fails if number is more than max', function() {
test.bool( Validation.validateNumberParameter( 7, 5, 6 ) ).isFalse();
});
it( 'passes on a moment date parse and unix time of a valid ISO8601 string', function() {
var time = moment( "1984-01-02T03:04:05Z", moment.ISO_8601 ).unix();
test.bool( Validation.validateNumberParameter(time) ).isTrue();
});
it( 'fails on a moment date parse and unix time of an invalid ISO8601 string', function() {
var time = moment( "03:04:05PM Jan 2nd 1984 UST", moment.ISO_8601 ).unix();
test.bool( Validation.validateNumberParameter(time) ).isFalse();
});
});
//Test template
//describe( "suite", function() {
// before( function() {
// });
//
// beforeEach( function() {
// });
//
// it( 'case', function() {
// });
//
// after( function(){
// });
//});
|
gpl-3.0
|
dennerlager/sepibrews
|
sepibrews/progressbar/__about__.py
|
995
|
'''Text progress bar library for Python.
A text progress bar is typically used to display the progress of a long
running operation, providing a visual cue that processing is underway.
The ProgressBar class manages the current progress, and the format of the line
is given by a number of widgets. A widget is an object that may display
differently depending on the state of the progress bar.
The progressbar module is very easy to use, yet very powerful. It will also
automatically enable features like auto-resizing when the system supports it.
'''
__title__ = 'Python Progressbar'
__package_name__ = 'progressbar2'
__author__ = 'Rick van Hattem (Wolph)'
__description__ = ' '.join('''
A Python Progressbar library to provide visual (yet text based) progress to
long running operations.
'''.strip().split())
__email__ = 'wolph@wol.ph'
__version__ = '3.47.0'
__license__ = 'BSD'
__copyright__ = 'Copyright 2015 Rick van Hattem (Wolph)'
__url__ = 'https://github.com/WoLpH/python-progressbar'
|
gpl-3.0
|
themiwi/freefoam-debian
|
src/sampling/sampledSurface/isoSurface/isoSurface.H
|
14189
|
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::isoSurface
Description
A surface formed by the iso value.
After "Regularised Marching Tetrahedra: improved iso-surface extraction",
G.M. Treece, R.W. Prager and A.H. Gee.
Note:
- does tets without using cell centres/cell values. Not tested.
- regularisation can create duplicate triangles/non-manifold surfaces.
Current handling of those is bit ad-hoc for now and not perfect.
- regularisation does not do boundary points so as to preserve the
boundary perfectly.
- uses geometric merge with fraction of bounding box as distance.
- triangles can be between two cell centres so constant sampling
does not make sense.
- on empty patches behaves like zero gradient.
- does not do 2D correctly, creates non-flat iso surface.
- on processor boundaries might two overlapping (identical) triangles
(one from either side)
The handling on coupled patches is a bit complex. All fields
(values and coordinates) get rewritten so
- empty patches get zerogradient (value) and facecentre (coordinates)
- separated processor patch faces get interpolate (value) and facecentre
(coordinates). (this is already the default for cyclics)
- non-separated processor patch faces keep opposite value and cell centre
Now the triangle generation on non-separated processor patch faces
can use the neighbouring value. Any separated processor face or cyclic
face gets handled just like any boundary face.
SourceFiles
isoSurface.C
\*---------------------------------------------------------------------------*/
#ifndef isoSurface_H
#define isoSurface_H
#include <triSurface/triSurface.H>
#include <OpenFOAM/labelPair.H>
#include <meshTools/pointIndexHit.H>
#include <OpenFOAM/PackedBoolList.H>
#include <finiteVolume/volFields.H>
#include <finiteVolume/slicedVolFields.H>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class fvMesh;
/*---------------------------------------------------------------------------*\
Class isoSurface Declaration
\*---------------------------------------------------------------------------*/
class isoSurface
:
public triSurface
{
// Private data
enum segmentCutType
{
NEARFIRST, // intersection close to e.first()
NEARSECOND, // ,, e.second()
NOTNEAR // no intersection
};
enum cellCutType
{
NOTCUT, // not cut
SPHERE, // all edges to cell centre cut
CUT // normal cut
};
//- Reference to mesh
const fvMesh& mesh_;
const scalarField& pVals_;
//- Input volScalarField with separated coupled patches rewritten
autoPtr<slicedVolScalarField> cValsPtr_;
//- Isosurface value
const scalar iso_;
//- Regularise?
const Switch regularise_;
//- When to merge points
const scalar mergeDistance_;
//- Whether face might be cut
List<cellCutType> faceCutType_;
//- Whether cell might be cut
List<cellCutType> cellCutType_;
//- Estimated number of cut cells
label nCutCells_;
//- For every triangle the original cell in mesh
labelList meshCells_;
//- For every unmerged triangle point the point in the triSurface
labelList triPointMergeMap_;
// Private Member Functions
// Point synchronisation
//- Does tensor differ (to within mergeTolerance) from identity
bool noTransform(const tensor& tt) const;
//- Is patch a collocated (i.e. non-separated) coupled patch?
static bool collocatedPatch(const polyPatch&);
//- Per face whether is collocated
PackedBoolList collocatedFaces(const coupledPolyPatch&) const;
//- Take value at local point patchPointI and assign it to its
// correct place in patchValues (for transferral) and sharedValues
// (for reduction)
void insertPointData
(
const processorPolyPatch& pp,
const Map<label>& meshToShared,
const pointField& pointValues,
const label patchPointI,
pointField& patchValues,
pointField& sharedValues
) const;
//- Synchonise points on all non-separated coupled patches
void syncUnseparatedPoints
(
pointField& collapsedPoint,
const point& nullValue
) const;
//- Get location of iso value as fraction inbetween s0,s1
scalar isoFraction
(
const scalar s0,
const scalar s1
) const;
//- Check if any edge of a face is cut
bool isEdgeOfFaceCut
(
const scalarField& pVals,
const face& f,
const bool ownLower,
const bool neiLower
) const;
void getNeighbour
(
const labelList& boundaryRegion,
const volVectorField& meshC,
const volScalarField& cVals,
const label cellI,
const label faceI,
scalar& nbrValue,
point& nbrPoint
) const;
//- Set faceCutType,cellCutType.
void calcCutTypes
(
const labelList& boundaryRegion,
const volVectorField& meshC,
const volScalarField& cVals,
const scalarField& pVals
);
static labelPair findCommonPoints
(
const labelledTri&,
const labelledTri&
);
static point calcCentre(const triSurface&);
static pointIndexHit collapseSurface
(
pointField& localPoints,
DynamicList<labelledTri, 64>& localTris
);
//- Determine per cc whether all near cuts can be snapped to single
// point.
void calcSnappedCc
(
const labelList& boundaryRegion,
const volVectorField& meshC,
const volScalarField& cVals,
const scalarField& pVals,
DynamicList<point>& snappedPoints,
labelList& snappedCc
) const;
//- Determine per point whether all near cuts can be snapped to single
// point.
void calcSnappedPoint
(
const PackedBoolList& isBoundaryPoint,
const labelList& boundaryRegion,
const volVectorField& meshC,
const volScalarField& cVals,
const scalarField& pVals,
DynamicList<point>& snappedPoints,
labelList& snappedPoint
) const;
//- Return input field with coupled (and empty) patch values rewritten
template<class Type>
tmp<SlicedGeometricField
<Type, fvPatchField, slicedFvPatchField, volMesh> >
adaptPatchFields
(
const GeometricField<Type, fvPatchField, volMesh>& fld
) const;
//- Generate single point by interpolation or snapping
template<class Type>
Type generatePoint
(
const scalar s0,
const Type& p0,
const bool hasSnap0,
const Type& snapP0,
const scalar s1,
const Type& p1,
const bool hasSnap1,
const Type& snapP1
) const;
template<class Type>
void generateTriPoints
(
const scalar s0,
const Type& p0,
const bool hasSnap0,
const Type& snapP0,
const scalar s1,
const Type& p1,
const bool hasSnap1,
const Type& snapP1,
const scalar s2,
const Type& p2,
const bool hasSnap2,
const Type& snapP2,
const scalar s3,
const Type& p3,
const bool hasSnap3,
const Type& snapP3,
DynamicList<Type>& points
) const;
template<class Type>
label generateFaceTriPoints
(
const volScalarField& cVals,
const scalarField& pVals,
const GeometricField<Type, fvPatchField, volMesh>& cCoords,
const Field<Type>& pCoords,
const DynamicList<Type>& snappedPoints,
const labelList& snappedCc,
const labelList& snappedPoint,
const label faceI,
const scalar neiVal,
const Type& neiPt,
const bool hasNeiSnap,
const Type& neiSnapPt,
DynamicList<Type>& triPoints,
DynamicList<label>& triMeshCells
) const;
template<class Type>
void generateTriPoints
(
const volScalarField& cVals,
const scalarField& pVals,
const GeometricField<Type, fvPatchField, volMesh>& cCoords,
const Field<Type>& pCoords,
const DynamicList<Type>& snappedPoints,
const labelList& snappedCc,
const labelList& snappedPoint,
DynamicList<Type>& triPoints,
DynamicList<label>& triMeshCells
) const;
triSurface stitchTriPoints
(
const bool checkDuplicates,
const List<point>& triPoints,
labelList& triPointReverseMap, // unmerged to merged point
labelList& triMap // merged to unmerged triangle
) const;
//- Check single triangle for (topological) validity
static bool validTri(const triSurface&, const label);
//- Determine edge-face addressing
void calcAddressing
(
const triSurface& surf,
List<FixedList<label, 3> >& faceEdges,
labelList& edgeFace0,
labelList& edgeFace1,
Map<labelList>& edgeFacesRest
) const;
//- Determine orientation
static void walkOrientation
(
const triSurface& surf,
const List<FixedList<label, 3> >& faceEdges,
const labelList& edgeFace0,
const labelList& edgeFace1,
const label seedTriI,
labelList& flipState
);
//- Orient surface
static void orientSurface
(
triSurface&,
const List<FixedList<label, 3> >& faceEdges,
const labelList& edgeFace0,
const labelList& edgeFace1,
const Map<labelList>& edgeFacesRest
);
//- Is triangle (given by 3 edges) not fully connected?
static bool danglingTriangle
(
const FixedList<label, 3>& fEdges,
const labelList& edgeFace1
);
//- Mark all non-fully connected triangles
static label markDanglingTriangles
(
const List<FixedList<label, 3> >& faceEdges,
const labelList& edgeFace0,
const labelList& edgeFace1,
const Map<labelList>& edgeFacesRest,
boolList& keepTriangles
);
static triSurface subsetMesh
(
const triSurface& s,
const labelList& newToOldFaces,
labelList& oldToNewPoints,
labelList& newToOldPoints
);
public:
//- Runtime type information
TypeName("isoSurface");
// Constructors
//- Construct from cell values and point values. Uses boundaryField
// for boundary values. Holds reference to cellIsoVals and
// pointIsoVals.
isoSurface
(
const volScalarField& cellIsoVals,
const scalarField& pointIsoVals,
const scalar iso,
const bool regularise,
const scalar mergeTol = 1E-6 // fraction of bounding box
);
// Member Functions
//- For every face original cell in mesh
const labelList& meshCells() const
{
return meshCells_;
}
//- For every unmerged triangle point the point in the triSurface
const labelList& triPointMergeMap() const
{
return triPointMergeMap_;
}
//- Interpolates cCoords,pCoords. Uses the references to the original
// fields used to create the iso surface.
template <class Type>
tmp<Field<Type> > interpolate
(
const GeometricField<Type, fvPatchField, volMesh>& cCoords,
const Field<Type>& pCoords
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "isoSurfaceTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************ vim: set sw=4 sts=4 et: ************************ //
|
gpl-3.0
|
erudit/zenon
|
eruditorg/base/test/factories.py
|
1731
|
from django.conf import settings
from django.contrib.auth.models import Group
from django.test import RequestFactory, Client
from django.contrib.auth.models import AnonymousUser
import factory
from faker import Factory as FakerFactory
from core.subscription.models import UserSubscriptions
faker = FakerFactory.create()
class UserFactory(factory.django.DjangoModelFactory):
username = factory.Sequence(lambda n: 'test{}'.format(n))
email = factory.Sequence(lambda n: 'test{0}@example.com'.format(n))
class Meta:
model = settings.AUTH_USER_MODEL
@factory.post_generation
def password(self, create, extracted, **kwargs):
if extracted:
password = extracted
else:
password = "default"
self._plaintext_password = password
self.set_password(password)
self.save()
class GroupFactory(factory.django.DjangoModelFactory):
name = factory.Sequence(lambda n: '{}-{}'.format(str(n), faker.job()))
class Meta:
model = Group
def get_authenticated_request(user=None):
request = RequestFactory().get('/')
if user:
request.user = user
else:
request.user = UserFactory()
request.subscriptions = UserSubscriptions()
request.session = dict()
return request
def get_anonymous_request():
request = RequestFactory().get('/')
request.user = AnonymousUser()
request.subscriptions = UserSubscriptions()
request.session = dict()
return request
def logged_client(user=None):
if user is None:
user = UserFactory.create()
print(user.is_superuser)
client = Client()
client.login(username=user.username, password=user._plaintext_password)
return client
|
gpl-3.0
|
EmmanuelMess/Simple-Accounting
|
SimpleAccounting/app/src/main/java/com/emmanuelmess/simpleaccounting/db/legacy/TableMonthlyBalance.java
|
3866
|
package com.emmanuelmess.simpleaccounting.db.legacy;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.emmanuelmess.simpleaccounting.data.Session;
import static android.database.Cursor.FIELD_TYPE_NULL;
import static com.alexfu.sqlitequerybuilder.api.SQLiteClauseBuilder.clause;
import static com.alexfu.sqlitequerybuilder.api.SQLiteExpressionBuilder.caseExp;
import static com.alexfu.sqlitequerybuilder.api.SQLiteQueryBuilder.select;
import static java.lang.String.format;
/**
* @author Emmanuel
* on 14/11/2016, at 16:52.
*/
public class TableMonthlyBalance extends Database {
//Beware the columns in this array may not be in the real order
public static final String[] COLUMNS = new String[] {"MONTH", "YEAR", "CURRENCY", "BALANCE"};
public static final String TABLE_NAME = "MONTHLY_BALANCE";
private static final int DATABASE_VERSION = 4;
public static final String TABLE_CREATE = format("CREATE TABLE %1$s(%2$s INT, %3$s INT, %4$s INT, %5$s TEXT, %6$s REAL);",
TABLE_NAME, NUMBER_COLUMN, COLUMNS[0], COLUMNS[1], COLUMNS[2], COLUMNS[3]);
public TableMonthlyBalance(Context context) {
super(context, TABLE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(TABLE_CREATE);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
switch(oldVersion) {
/*I made a mistake on update 1.1.4, this should undo that*/
case 1:
String sql = "DROP TABLE " + TableMonthlyBalance.TABLE_NAME;
db.execSQL(sql);
db.execSQL(TABLE_CREATE);
case 2:
sql = "ALTER TABLE " + TABLE_NAME + " ADD " + COLUMNS[2] + " TEXT default '';";
db.execSQL(sql);
}
}
public void updateMonth(int month, int year, String currency, double balance) {
if(!isMonthInBD(month, year, currency))
createMonth(month, year, currency);
CV.put(COLUMNS[3], balance);
getWritableDatabase().update(TABLE_NAME, CV, SQLShort(AND, format("%1$s=%2$s" , COLUMNS[0], month),
format("%1$s=%2$s" , COLUMNS[1], year), format("%1$s=%2$s" , COLUMNS[2], "?")), new String[] {currency});
CV.clear();
}
public Double getBalanceLastMonthWithData(Session session) {
int month = session.getMonth();
int year = session.getYear();
String currency = session.getCurrency();
String querySum =
select(COLUMNS[3])
.from(TABLE_NAME)
.where(clause(clause(COLUMNS[0] + "<" + month).and(COLUMNS[1] + "=" + year))
.or(COLUMNS[1] + "<" + year)
.and(COLUMNS[2] + "=?"))
.orderBy(COLUMNS[1] + " DESC, " + COLUMNS[0]).desc().limit(1)
.build();
Cursor c = getReadableDatabase().rawQuery(querySum, new String[] {currency});
c.moveToFirst();
Double data;
try {
if(c.getCount() == 0) {
return null;
}
data = c.getType(0) != FIELD_TYPE_NULL? c.getDouble(0):null;
} finally {
c.close();
}
return data;
}
public void deleteAllForCurrency(String currency) {
String condition = format("%1$s=%2$s" , COLUMNS[2], "?");
getWritableDatabase().delete(TABLE_NAME, condition, new String[] {currency});
}
private boolean isMonthInBD(int month, int year, String currency) {
boolean data;
Cursor c = getReadableDatabase().query(TABLE_NAME, new String[] {COLUMNS[3]},
SQLShort(AND, format("%1$s=%2$s" , COLUMNS[0], month),
format("%1$s=%2$s" , COLUMNS[1], year),
format("%1$s=%2$s" , COLUMNS[2], "?")),
new String[] {currency}, null, null, null, "1");
data = c.getCount() != 0;
c.close();
return data;
}
private void createMonth(int month, int year, String currency) {
if(!isMonthInBD(month, year, currency)) {
CV.put(COLUMNS[0], month);
CV.put(COLUMNS[1], year);
CV.put(COLUMNS[2], currency);
CV.put(COLUMNS[3], 0);
getWritableDatabase().insert(TABLE_NAME, null, CV);
CV.clear();
}
}
}
|
gpl-3.0
|
cpp-ftw/ccsh
|
lib/ccsh_utils_windows.cpp
|
6452
|
#include <ccsh/ccsh_utils.hpp>
#include "ccsh_internals.hpp"
#ifdef _WIN32
#ifndef _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
#define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
#endif
#include <codecvt>
#include <mutex>
namespace ccsh {
fs::path get_home()
{
tchar_t result[MAX_PATH];
winapi_hresult_thrower(SHGetFolderPathW(nullptr, CSIDL_PROFILE, nullptr, 0, result));
return {result};
}
std::string get_hostname()
{
tchar_t result[MAX_COMPUTERNAME_LENGTH + 1];
DWORD sz = sizeof(result);
winapi_thrower(GetComputerNameW(result, &sz));
return to_utf8(result);
}
std::string get_ttyname()
{
tchar_t result[MAX_PATH];
winapi_thrower(GetConsoleTitleW(result, MAX_PATH));
return to_utf8(result);
}
bool is_user_possibly_elevated()
{
fd_t temp = nullptr;
winapi_thrower(OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &temp));
internal::open_wrapper hToken{temp};
TOKEN_ELEVATION Elevation;
DWORD cbSize = sizeof(Elevation);
winapi_thrower(GetTokenInformation(hToken.get(), TokenElevation, &Elevation, cbSize, &cbSize));
return Elevation.TokenIsElevated;
}
std::string get_error_as_string(error_t errorMessageID)
{
if (errorMessageID == 0)
return "Success";
tchar_t* messageBuffer = nullptr;
size_t size = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
nullptr, errorMessageID, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), reinterpret_cast<tchar_t*>(&messageBuffer), 0, nullptr);
tstring_t message(messageBuffer, size);
LocalFree(messageBuffer);
while (!message.empty() && message.back() == L'\n')
message.pop_back();
return to_utf8(message);
}
winapi_error::winapi_error()
: winapi_error(GetLastError())
{}
winapi_error::winapi_error(error_t no)
: shell_error(get_error_as_string(no))
, error_number(no)
{}
winapi_error::winapi_error(std::string const & msg)
: winapi_error(GetLastError(), msg)
{}
winapi_error::winapi_error(error_t no, std::string const & msg)
: shell_error(msg.empty() ? get_error_as_string(no) : msg + ": " + get_error_as_string(no))
, error_number(no)
{}
std::string const& stdc_error::strerror(int no)
{
static thread_local std::string result(BUFSIZ, '\0');
// Let's hope strerror_s can't fail unless buffer is too small.
// Anyway, if buffer is small, it returns EINVAL (?)
int err;
while ((err = strerror_s(&result[0], result.size(), no)) == EINVAL)
result.resize(result.size() * 2);
if (err != EINVAL) // should not happen
result = "An unknown error occured in strerror_s.";
// Removing trailing '\n'. Assuming that if it contains a newline,
// it won't be in the middle of the string. Looking at this wonderful API,
// this assumption is risky.
auto pos = result.find_last_of('\n');
if (pos != std::string::npos)
result[pos] = '\0';
return result;
}
namespace {
static std::mutex env_var_mtx;
bool get_env_var(std::string const& name, std::string& result)
{
std::lock_guard<std::mutex> guard{env_var_mtx};
std::size_t retsize;
getenv_s(&retsize, &result[0], result.size(), name.c_str());
if (retsize == 0)
return false;
if (retsize > result.size())
{
result = std::string(retsize, '\0');
getenv_s(&retsize, &result[0], result.size(), name.c_str());
}
return true;
}
}
std::string env_var::get(std::string const& name)
{
std::string result(BUFSIZ, '\0');
if (!get_env_var(name, result))
throw shell_error("Environment variable " + name + " does not exist.");
return result;
}
const char* env_var::try_get(std::string const& name)
{
static thread_local std::string result(BUFSIZ, '\0');
if (!get_env_var(name, result))
return nullptr;
return result.c_str();
}
void env_var::set(std::string const& name, std::string const& value, bool override)
{
internal::stdc_thrower(try_set(name, value, override));
}
int env_var::try_set(std::string const& name, std::string const& value, bool overwrite)
{
std::lock_guard<std::mutex> guard{env_var_mtx};
int errcode = 0;
if (!overwrite)
{
size_t envsize = 0;
errcode = getenv_s(&envsize, nullptr, 0, name.c_str());
if (errcode || envsize) return errcode;
}
auto err = _putenv_s(name.c_str(), value.c_str());
if (err)
{
errno = err;
return -1;
}
return 0;
}
namespace internal {
const fd_t open_traits::invalid_value = INVALID_HANDLE_VALUE;
void open_traits::dtor_func(fd_t fd) noexcept
{
// let's assume these won't be changed
static fd_t handle1 = GetStdHandle(STD_INPUT_HANDLE);
static fd_t handle2 = GetStdHandle(STD_OUTPUT_HANDLE);
static fd_t handle3 = GetStdHandle(STD_ERROR_HANDLE);
if (fd != handle1 && fd != handle2 && fd != handle3)
CloseHandle(fd);
}
pipe_t pipe_compat()
{
SECURITY_ATTRIBUTES secattr = {0};
secattr.nLength = sizeof(secattr);
secattr.lpSecurityDescriptor = nullptr;
secattr.bInheritHandle = inherit_by_default();
HANDLE read_end;
HANDLE write_end;
winapi_thrower(CreatePipe(&read_end, &write_end, &secattr, 0));
return {open_wrapper{read_end}, open_wrapper{write_end}};
}
std::size_t read_compat(fd_t file, void* data, std::size_t size)
{
DWORD result;
winapi_thrower(ReadFile(file, data, unsigned(size), &result, nullptr));
return std::size_t(result);
}
std::size_t write_compat(fd_t file, void* data, std::size_t size)
{
DWORD result;
winapi_thrower(WriteFile(file, data, unsigned(size), &result, nullptr));
return std::size_t(result);
}
fd_t duplicate_compat(fd_t file)
{
fd_t result;
winapi_thrower(DuplicateHandle(GetCurrentProcess(), file, GetCurrentProcess(), &result, 0, false, DUPLICATE_SAME_ACCESS));
return result;
}
void close_compat(fd_t fd)
{
CloseHandle(fd);
}
char* strtok_compat(char* str, char const* delim, char** context)
{
return strtok_s(str, delim, context);
}
} // namespace internal
std::string to_utf8(tstring_t const& str)
{
std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> converter;
return converter.to_bytes(str);
}
tstring_t from_utf8(std::string const& str)
{
std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> converter;
return converter.from_bytes(str);
}
}
#endif // _WIN32
|
gpl-3.0
|
aaujon/dolibarr
|
htdocs/projet/index.php
|
9672
|
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/projet/index.php
* \ingroup projet
* \brief Main project home page
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$langs->load("projects");
$langs->load("companies");
$mine = GETPOST('mode')=='mine' ? 1 : 0;
// Security check
$socid=0;
if ($user->societe_id > 0) $socid=$user->societe_id;
if (!$user->rights->projet->lire) accessforbidden();
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
/*
* View
*/
$socstatic=new Societe($db);
$projectstatic=new Project($db);
$userstatic=new User($db);
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,($mine?$mine:(empty($user->rights->projet->all->lire)?0:2)),1);
//var_dump($projectsListId);
llxHeader("",$langs->trans("Projects"),"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos");
$text=$langs->trans("Projects");
if ($mine) $text=$langs->trans("MyProjects");
print_fiche_titre($text);
// Show description of content
if ($mine) print $langs->trans("MyProjectsDesc").'<br><br>';
else
{
if (! empty($user->rights->projet->all->lire) && ! $socid) print $langs->trans("ProjectsDesc").'<br><br>';
else print $langs->trans("ProjectsPublicDesc").'<br><br>';
}
print '<div class="fichecenter"><div class="fichethirdleft">';
// Search project
if (! empty($conf->projet->enabled) && $user->rights->projet->lire)
{
$var=false;
print '<form method="post" action="'.DOL_URL_ROOT.'/projet/list.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchAProject").'</td></tr>';
print '<tr '.$bc[$var].'>';
print '<td class="nowrap"><label for="sf_ref">'.$langs->trans("Ref").'</label>:</td><td><input type="text" class="flat" name="search_ref" id="sf_ref" size="18"></td>';
print '<td rowspan="3"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print '<tr '.$bc[$var].'><td class="nowrap"><label for="syear">'.$langs->trans("Year").'</label>:</td><td><input type="text" class="flat" name="search_year" id="search_year" size="18"></td>';
print '<tr '.$bc[$var].'><td class="nowrap"><label for="sall">'.$langs->trans("Other").'</label>:</td><td><input type="text" class="flat" name="search_all" id="search_all" size="18"></td>';
print '</tr>';
print "</table></form>\n";
print "<br>\n";
}
print_projecttasks_array($db,$socid,$projectsListId,0,0);
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("ThirdParties"),$_SERVER["PHP_SELF"],"s.nom","","","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("NbOfProjects"),"","","","",'align="right"',$sortfield,$sortorder);
print "</tr>\n";
$sql = "SELECT count(p.rowid) as nb";
$sql.= ", s.nom as name, s.rowid as socid";
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
$sql.= " WHERE p.entity = ".$conf->entity;
if ($mine || empty($user->rights->projet->all->lire)) $sql.= " AND p.rowid IN (".$projectsListId.")";
if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
$sql.= " GROUP BY s.nom, s.rowid";
$var=true;
$resql = $db->query($sql);
if ( $resql )
{
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td class="nowrap">';
if ($obj->socid)
{
$socstatic->id=$obj->socid;
$socstatic->name=$obj->name;
print $socstatic->getNomUrl(1);
}
else
{
print $langs->trans("OthersNotLinkedToThirdParty");
}
print '</td>';
print '<td align="right"><a href="'.DOL_URL_ROOT.'/projet/list.php?socid='.$obj->socid.'">'.$obj->nb.'</a></td>';
print "</tr>\n";
$i++;
}
$db->free($resql);
}
else
{
dol_print_error($db);
}
print "</table>";
print '</div></div></div>';
if (empty($conf->global->PROJECT_HIDE_TASKS))
{
// Tasks for all resources of all opened projects and time spent for each task/resource
print '<div class="fichecenter">';
$max = (empty($conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA)?1000:$conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA);
$sql = "SELECT p.ref, p.title, p.rowid as projectid, t.label, t.rowid as taskid, t.planned_workload, t.duration_effective, t.progress, t.dateo, t.datee, SUM(tasktime.task_duration) as timespent";
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task_time as tasktime on tasktime.fk_task = t.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on tasktime.fk_user = u.rowid";
$sql.= " WHERE p.entity = ".$conf->entity;
if ($mine || empty($user->rights->projet->all->lire)) $sql.= " AND p.rowid IN (".$projectsListId.")";
if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
$sql.= " AND p.fk_statut=1";
$sql.= " GROUP BY p.ref, p.title, p.rowid, t.label, t.rowid, t.planned_workload, t.duration_effective, t.progress, t.dateo, t.datee";
$sql.= " ORDER BY t.rowid, t.dateo, t.datee";
$sql.= $db->plimit($max+1); // We want more to know if we have more than limit
$var=true;
dol_syslog('projet:index.php: affectationpercent', LOG_DEBUG);
$resql = $db->query($sql);
if ( $resql )
{
$num = $db->num_rows($resql);
$i = 0;
print '<br>';
print_fiche_titre($langs->trans("TasksOnOpenedProject"),'','').'<br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
//print '<th>'.$langs->trans('TaskRessourceLinks').'</th>';
print '<th>'.$langs->trans('Projects').'</th>';
print '<th>'.$langs->trans('Task').'</th>';
print '<th>'.$langs->trans('DateStart').'</th>';
print '<th>'.$langs->trans('DateEnd').'</th>';
print '<th align="right">'.$langs->trans('PlannedWorkload').'</th>';
print '<th align="right">'.$langs->trans("ProgressDeclared").'</td>';
print '<th align="right">'.$langs->trans('TimeSpent').'</th>';
print '<th align="right">'.$langs->trans("ProgressCalculated").'</td>';
print '</tr>';
while ($i < $num && $i < $max)
{
$obj = $db->fetch_object($resql);
$var=!$var;
$username='';
if ($obj->userid && $userstatic->id != $obj->userid) // We have a user and it is not last loaded user
{
$result=$userstatic->fetch($obj->userid);
if (! $result) $userstatic->id=0;
}
if ($userstatic->id) $username = $userstatic->getNomUrl(0,0);
print "<tr ".$bc[$var].">";
//print '<td>'.$username.'</td>';
print '<td>';
$projectstatic->id=$obj->projectid;
$projectstatic->ref=$obj->ref;
$projectstatic->title=$obj->title;
print $projectstatic->getNomUrl(1,'',16);
//print '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$obj->projectid.'">'.$obj->title.'</a>';
print '</td>';
print '<td>';
if (! empty($obj->taskid))
{
print '<a href="'.DOL_URL_ROOT.'/projet/tasks/task.php?id='.$obj->taskid.'&withproject=1">'.$obj->label.'</a>';
}
else print $langs->trans("NoTasks");
print '</td>';
print '<td>'.dol_print_date($db->jdate($obj->dateo),'day').'</td>';
print '<td>'.dol_print_date($db->jdate($obj->datee),'day').'</td>';
print '<td align="right"><a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$obj->taskid.'&withproject=1">';
print convertSecondToTime($obj->planned_workload, 'all');
print '</a></td>';
print '<td align="right">';
print ($obj->taskid>0)?$obj->progress.'%':'';
print '</td>';
print '<td align="right"><a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$obj->taskid.'&withproject=1">';
print convertSecondToTime($obj->timespent, 'all');
print '</a></td>';
print '<td align="right">';
if (! empty($obj->taskid))
{
if (empty($obj->planned_workload) > 0) {
$percentcompletion = $langs->trans("WorkloadNotDefined");
} else {
$percentcompletion = intval($obj->duration_effective*100/$obj->planned_workload).'%';
}
}
print $percentcompletion;
print '</td>';
print "</tr>\n";
$i++;
}
if ($num > $max)
{
print '<tr><td colspan="6">'.$langs->trans("WarningTooManyDataPleaseUseMoreFilters").'</td></tr>';
}
print "</table>";
$db->free($resql);
}
else
{
dol_print_error($db);
}
print '</div>';
}
llxFooter();
$db->close();
|
gpl-3.0
|
romus/statistic4text
|
statistic4text/utils/read_utils.py
|
3010
|
# -*- coding: utf-8 -*-
__author__ = 'romus'
from abc import ABCMeta, abstractmethod
import pymongo
class ReadUtils():
__metaclass__ = ABCMeta
@abstractmethod
def getDict(self, dictID):
"""
Получить данные по словарю по ID
:param dictID: ID словаря
:rtype: dict
:return: словарь с данными по словарю/файлу/источнику
"""
return None
@abstractmethod
def getSubDicts(self, mergeDictID):
"""
Получить данные по дочерним словарям (lazy)
:param mergeDictID: ID основного словаря
:rtype: dict
:return: словарь с данными по словарю/файлу/источнику
"""
return None
@abstractmethod
def getDictData(self, dictID):
"""
Получить данные по словарю/файлу/источнику (lazy)
:param dictID: ID словаря, для получения данных
:rtype: dict
:return: словарь с данными из словаря/файла/источника
"""
return None
class MongoReadUtils(ReadUtils):
def __init__(self, host, port, user, password, databaseName, filesCollectionName, dataFilesCollectionName):
"""
Инициализация
:param host: хост
:param port: порт
:param user: пользователь
:param password: пароль
:param databaseName: имя базы
:param filesCollectionName: имя коллекции для описания свойств сохраняемых словарей (файлов)
:param dataFilesCollectionName: имя коллекции для хранения данных словарей (файлов)
"""
self._client = pymongo.MongoClient(host=host, port=port)
self._db = self._client[databaseName]
self._db.authenticate(user, password)
self._filesCollection = self._db[filesCollectionName]
self._dataFilesCollection = self._db[dataFilesCollectionName]
def getDict(self, dictID):
return self._filesCollection.find_one({"_id": dictID})
def getSubDicts(self, mergeDictID):
return self._getLazyData(self._filesCollection, {"merge_dict_id": mergeDictID})
def getDictData(self, dictID):
return self._getLazyData(self._dataFilesCollection, {"dict_id": dictID})
def _getLazyData(self, collection, findProps):
"""
Получение данных из коллекции
:param collection: объект коллекции
:param findProps: словарь для поиска необходимых данных
"""
while True:
for itemData in collection.find(findProps):
yield itemData
break
|
gpl-3.0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.