soldering wire

This commit is contained in:
minjaesong
2024-03-11 01:57:36 +09:00
parent ef2413f33d
commit 60eeeae759
11 changed files with 66 additions and 55 deletions

View File

@@ -35,6 +35,13 @@
]
},
"item@basegame:50": { /* soldering wire */
"workbench": "wirerollingmill",
"ingredients": [
[10, 1, "item@basegame:181"] /* 1 solder bar */
]
},
"item@basegame:35": { /* copper bulb */
"workbench": "basiccrafting",
"ingredients": [

View File

@@ -48,6 +48,7 @@ id;classname;tags
47;net.torvald.terrarum.modulebasegame.gameitems.ItemWrench;TOOL,WRENCH
48;net.torvald.terrarum.modulebasegame.gameitems.ItemAlloyingFurnace;FIXTURE,STATION
49;net.torvald.terrarum.modulebasegame.gameitems.ItemLogicSignalAdder;FIXTURE,SIGNAL
50;net.torvald.terrarum.modulebasegame.gameitems.ItemSolderingWire;
# ingots
112;net.torvald.terrarum.modulebasegame.gameitems.IngotCopper;INGOT
1 id classname tags
48 48 net.torvald.terrarum.modulebasegame.gameitems.ItemAlloyingFurnace FIXTURE,STATION
49 49 net.torvald.terrarum.modulebasegame.gameitems.ItemLogicSignalAdder FIXTURE,SIGNAL
50 # ingots 50 net.torvald.terrarum.modulebasegame.gameitems.ItemSolderingWire
51 # ingots
52 112 net.torvald.terrarum.modulebasegame.gameitems.IngotCopper INGOT
53 113 net.torvald.terrarum.modulebasegame.gameitems.IngotIron INGOT
54 114 net.torvald.terrarum.modulebasegame.gameitems.ItemCoalCoke COMBUSTIBLE

Binary file not shown.

View File

@@ -44,6 +44,7 @@
"TOOLTIP_item@basegame:36": "Creates wires from metal ingots",
"TOOLTIP_item@basegame:47": "Reorients gadgets",
"TOOLTIP_item@basegame:48": "Melts two metal ingots to make a bar of alloy",
"TOOLTIP_item@basegame:50": "Put it on the Electronics Workbench",
"TOOLTIP_item@basegame:114": "A precious fuel for the steel production",

View File

@@ -70,6 +70,7 @@
"ITEM_SLEDGEHAMMER_COPPER": "Copper Sledgehammer",
"ITEM_SLEDGEHAMMER_IRON": "Iron Sledgehammer",
"ITEM_SLEDGEHAMMER_STEEL": "Steel Sledgehammer",
"ITEM_SOLDERING_WIRE": "Soldering Wire",
"ITEM_SMELTER_SMALL": "Small Smelter",
"ITEM_STORAGE_CHEST": "Storage Chest",
"ITEM_TABLE_OAK": "Oak Table",

View File

@@ -43,6 +43,7 @@
"TOOLTIP_item@basegame:36": "금속 주괴를 사용해 철사를 뽑아냅니다",
"TOOLTIP_item@basegame:47": "기기의 방향을 바꿉니다",
"TOOLTIP_item@basegame:48": "두 금속 괴를 녹여 합금을 만듭니다",
"TOOLTIP_item@basegame:50": "전자 작업대에 갖다놓으세요",
"TOOLTIP_item@basegame:114": "강철 생산의 소중한 연료입니다",

View File

@@ -33,7 +33,7 @@
"ITEM_INGOT_ROSEGOLD": "분홍금괴",
"ITEM_INGOT_SILVER": "은괴",
"ITEM_INGOT_SILVER_BILLON": "은동괴",
"ITEM_INGOT_SOLDER": "납",
"ITEM_INGOT_SOLDER": "막대납",
"ITEM_INGOT_STEEL": "강철괴",
"ITEM_INGOT_TIN": "주석괴",
"ITEM_INGOT_ZINC": "아연괴",
@@ -70,6 +70,7 @@
"ITEM_SLEDGEHAMMER_COPPER": "구리 해머",
"ITEM_SLEDGEHAMMER_IRON": "철 해머",
"ITEM_SLEDGEHAMMER_STEEL": "강철 해머",
"ITEM_SOLDERING_WIRE": "실납",
"ITEM_SMELTER_SMALL": "소형 고로",
"ITEM_STORAGE_CHEST": "보관상자",
"ITEM_TABLE_OAK": "나무 탁자",

View File

@@ -716,63 +716,50 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
////////////////////////////////
// #1. Consume an consumables
// don't want to open the UI and use the item at the same time, would ya?
if (itemOnGrip?.isConsumable == true) {
// click filtering (latch stuff) is handled by IngameController (see inventoryCategoryAllowClickAndDrag)
// To disable click dragging for tool/block/etc., put `override val disallowToolDragging = true` to the item's code
val consumptionSuccessful = itemOnGrip.startPrimaryUse(actor, delta)
if (consumptionSuccessful > -1)
(actor as Pocketed).inventory.consumeItem(itemOnGrip, consumptionSuccessful)
mouseInInteractableRange(actor) { mwx, mwy, mtx, mty ->
// #1. interact with the fixture if NOT FixtureInteractionBlocked
// scan for the one with non-null UI.
// what if there's multiple of such fixtures? whatever, you are supposed to DISALLOW such situation.
if (fixtureUnderMouse != null && itemOnGrip !is FixtureInteractionBlocked) {
if (!worldPrimaryClickLatch) {
worldPrimaryClickLatch = true
fixtureUnderMouse.let { fixture ->
fixture.mainUI?.let { ui ->
uiOpened = true
worldPrimaryClickLatch = true
}
else { // held item is not consumable or holding no items
mouseInInteractableRange(actor) { mwx, mwy, mtx, mty ->
// #2. interact with the fixture
// scan for the one with non-null UI.
// what if there's multiple of such fixtures? whatever, you are supposed to DISALLOW such situation.
if (fixtureUnderMouse != null && itemOnGrip !is FixtureInteractionBlocked) {
if (!worldPrimaryClickLatch) {
worldPrimaryClickLatch = true
fixtureUnderMouse.let { fixture ->
fixture.mainUI?.let { ui ->
uiOpened = true
// property 'uiFixture' is a dedicated property that the TerrarumIngame recognises.
// when it's not null, the UI will be updated and rendered
// when the UI is closed, it'll be replaced with a null value
uiFixture = ui
ui.setPosition(
(Toolkit.drawWidth - ui.width) / 4,
(App.scr.height - ui.height) / 4 // what the fuck?
)
ui.setAsOpen()
}
// property 'uiFixture' is a dedicated property that the TerrarumIngame recognises.
// when it's not null, the UI will be updated and rendered
// when the UI is closed, it'll be replaced with a null value
uiFixture = ui
ui.setPosition(
(Toolkit.drawWidth - ui.width) / 4,
(App.scr.height - ui.height) / 4 // what the fuck?
)
ui.setAsOpen()
}
if (!uiOpened) {
fireFixtureInteractEvent(fixture, mwx, mwy)
}
if (!uiOpened) {
fireFixtureInteractEvent(fixture, mwx, mwy)
}
}
}
// #3. If no fixture under mouse or FixtureInteractionBlocked, use the item
else if (itemOnGrip != null) {
// click filtering (latch stuff) is handled by IngameController (see inventoryCategoryAllowClickAndDrag)
// To disable click dragging for tool/block/etc., put `override val disallowToolDragging = true` to the item's code
val consumptionSuccessful = itemOnGrip.startPrimaryUse(actor, delta)
if (consumptionSuccessful > -1)
(actor as Pocketed).inventory.consumeItem(itemOnGrip, consumptionSuccessful)
worldPrimaryClickLatch = true
}
// #4. If not holding any item and can do barehandaction (size big enough that barehandactionminheight check passes), do it
else {
performBarehandAction(actor, delta, mwx, mwy, mtx, mty)
}
0L
}
// #2. If no fixture under mouse or FixtureInteractionBlocked, use the item
else if (itemOnGrip != null) {
// click filtering (latch stuff) is handled by IngameController (see inventoryCategoryAllowClickAndDrag)
// To disable click dragging for tool/block/etc., put `override val disallowToolDragging = true` to the item's code
val consumptionSuccessful = itemOnGrip.startPrimaryUse(actor, delta)
if (consumptionSuccessful > -1)
(actor as Pocketed).inventory.consumeItem(itemOnGrip, consumptionSuccessful)
worldPrimaryClickLatch = true
}
// #3. If not holding any item and can do barehandaction (size big enough that barehandactionminheight check passes), do it
else {
performBarehandAction(actor, delta, mwx, mwy, mtx, mty)
}
0L
}
}

View File

@@ -88,4 +88,13 @@ class ItemTorch(originalID: ItemID) : LightIngredientBase(originalID) {
override fun effectWhileEquipped(actor: ActorWithBody, delta: Float) {
BlockBase.blockEffectWhenEquipped(actor, delta)
}
}
/**
* Created by minjaesong on 2024-03-11.
*/
class ItemSolderingWire(originalID: ItemID) : LightIngredientBase(originalID) {
override var originalName = "ITEM_SOLDERING_WIRE"
override val itemImage: TextureRegion
get() = CommonResourcePool.getAsItemSheet("basegame.items").get(6,2)
}

Binary file not shown.