Allow color inverter to process colors as well

This commit is contained in:
tobspr 2020-07-07 09:06:17 +02:00
parent 7257642223
commit 0d6b855253
15 changed files with 695 additions and 687 deletions

View File

@ -1383,6 +1383,6 @@
"format": "RGBA8888",
"size": {"w":690,"h":127},
"scale": "0.1",
"smartupdate": "$TexturePacker:SmartUpdate:402faa0126e6dcd814be979d8e838c46:68488838c03e95969cf7c09daf42f69a:f159918d23e5952766c6d23ab52278c6$"
"smartupdate": "$TexturePacker:SmartUpdate:4e5fb3bd7f1e5423e4fcea2215debe11:0c5d091d0b928944c68553dcc592c801:f159918d23e5952766c6d23ab52278c6$"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 KiB

After

Width:  |  Height:  |  Size: 216 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 520 KiB

After

Width:  |  Height:  |  Size: 515 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 976 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -94,9 +94,7 @@ export class MetaAdvancedProcessorBuilding extends MetaBuilding {
{
pos: new Vector(0, 1),
directions: [enumDirection.left],
filter: enumItemType.shape,
},
{
pos: new Vector(0, 0),
directions: [enumDirection.top],

View File

@ -1,13 +1,11 @@
import { globalConfig } from "../../core/config";
import { BaseItem } from "../base_item";
import { enumColorMixingResults } from "../colors";
import { BaseItem, enumItemType } from "../base_item";
import { enumColorMixingResults, enumInvertedColors } from "../colors";
import { enumItemProcessorTypes, ItemProcessorComponent } from "../components/item_processor";
import { Entity } from "../entity";
import { GameSystemWithFilter } from "../game_system_with_filter";
import { ColorItem } from "../items/color_item";
import { ShapeItem } from "../items/shape_item";
import { enumLayer } from "../root";
import { NEGATIVE_ENERGY_ITEM_SINGLETON } from "../items/negative_energy_item";
export class ItemProcessorSystem extends GameSystemWithFilter {
constructor(root) {
@ -346,13 +344,29 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
// ADVANCED PROCESSING
case enumItemProcessorTypes.advancedProcessor: {
const shapeItem = /** @type {ShapeItem} */ (items[0].item);
const newItem = this.root.shapeDefinitionMgr.shapeActionInvertColors(shapeItem.definition);
const item = items[0].item;
if (item.getItemType() === enumItemType.color) {
const colorItem = /** @type {ColorItem} */ (items[0].item);
const newColor = enumInvertedColors[colorItem.color];
outItems.push({
item: new ColorItem(newColor),
requiredSlot: 0,
});
} else if (item.getItemType() === enumItemType.shape) {
const shapeItem = /** @type {ShapeItem} */ (items[0].item);
const newItem = this.root.shapeDefinitionMgr.shapeActionInvertColors(
shapeItem.definition
);
outItems.push({
item: new ShapeItem(newItem),
requiredSlot: 0,
});
} else {
assertAlways(false, "Bad item type: " + item.getItemType() + " for advanced processor.");
}
outItems.push({
item: new ShapeItem(newItem),
requiredSlot: 0,
});
break;
}

View File

@ -467,8 +467,8 @@ buildings:
wire:
default:
name: &wire Wire
description: Allows you to transport energy
name: &wire Energy Wire
description: Allows you to transport energy.
miner: # Internal name for the Extractor
default:
@ -511,8 +511,8 @@ buildings:
advanced_processor:
default:
name: &advanced_processor Advanced Processor
description: Advanced shape processing
name: &advanced_processor Color Inverter
description: Accepts a color or shape and inverts it.
rotater:
default:
@ -565,16 +565,16 @@ buildings:
default:
name: &energy_generator Energy Generator
description: Generates energy by consuming shapes. Each energy generator requires a different shape.
description: Generates energy by consuming shapes.
wire_crossings:
default:
name: &wire_crossings Wire Splitter
description: Splits a wire into two
description: Splits a energy wire into two.
merger:
name: Wire Merger
description: Merges two wires into one
description: Merges two energy wires into one.
storyRewards:
# Those are the rewards gained from completing the store
@ -654,10 +654,6 @@ storyRewards:
desc: >-
This level gave you no reward, but the next one will! <br><br> PS: Better don't destroy your existing factory - You need <strong>all</strong> those shapes later again to <strong>unlock upgrades</strong>!
reward_wires:
title: Wires
desc: TODO
no_reward_freeplay:
title: Next level
desc: >-