Skip to content

Commit

Permalink
feat(mods/teleportation_tech): Teleporter mod (#3165)
Browse files Browse the repository at this point in the history
* Create a folder

* Add files via upload

* Delete data/mods/Borsek_teleporters/

* Update modinfo.json

* style(autofix.ci): automated formatting

* Add files via upload

* style(autofix.ci): automated formatting

* Add files via upload

* style(autofix.ci): automated formatting

* Delete data/mods/Borsek_teleporters directory

* Create furniture.json

* Add files via upload

* style(autofix.ci): automated formatting

* Update data/mods/teleportation_mod/item.json

Co-authored-by: scarf <greenscarf005@gmail.com>

* Update data/mods/teleportation_mod/item.json

Co-authored-by: scarf <greenscarf005@gmail.com>

* Update data/mods/teleportation_mod/item.json

Co-authored-by: scarf <greenscarf005@gmail.com>

* Update main.lua

* Create README.txt

* Update main.lua

* chore: add `mods/teleportation_tech`

* docs: use markdown

* feat: place player on overmap function

* fix: `use_action` can be string (lua)

* fix: units

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: scarf <greenscarf005@gmail.com>
  • Loading branch information
3 people authored Dec 4, 2023
1 parent 503687f commit ea16272
Show file tree
Hide file tree
Showing 13 changed files with 1,031 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,5 @@ scopes:
- mods/smart_house_remote_mod
- mods/speedydex
- mods/stats_through_kills
- mods/teleportation_tech
- mods/test_data
61 changes: 61 additions & 0 deletions data/mods/teleportation_mod/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Teleportation Tech Mod

## Quick guide

- Find "Teleporter network schematics", a book that spawns where schematics spawn (labs, bank
vaults)
- Build a teleporter station. Use the item to place it - upon succesful placement, the station is
registered in the teleporter network. Placement of this device is irrelevant if you don't intend
to actively charge it. Otherwise place it in your base, and you can manually charge it with your
electrical grid power to supplement the passive trickle charge.
- Build a teleporter remote. This tool takes batteries, and you use it to interact with the
stations. You can use it to check the station power, manually charge the stations, and teleport.
- Build a teleporter anchor. Use the item to place it - upon succesful placement, the anchor is
registered in the teleporter network. The anchor is the 'destination' you can teleport to.
Teleportation is slightly inaccurate, but you will land on the same overmap square. This is
intentional, so I suggest not placing it in tight underground locations (a mostly clear overmap
lab tile is fine, a single tile hole in the ground very likely won't be).
- Deconstruction of anchors and stations is also possible, which removes them from the map, but does
not yet return items. Debug them in if you want for now (working on this one).

## Items

- personal teleporter remote
- teleporter base (deployed, undeployed)
- teleporter target anchor (deployed, undeployed)

## Logic/design

- on use: teleporter anchor registers its tripoint in the teleporter network
- on use: teleporter station registers itself in the teleporter network (position, time of
placement, and charge)
- teleporter network: array of stations with charge, timestamp and tripoint position, and anchor
with tripoint position
- on use: teleporter remote:
- updates charge on stations (if a minute has passed since the last use)

- opens window with two options - teleport, and charge station
- teleport gives a list of anchors with the distance to them, 1 distance = 1 charge
- pick an anchor, pick station to use, player is teleported to anchor OMT, distance gets removed
from station charge

- charge station works if you are on the same grid with the station, it allows players to manually
dump grid energy into the teleporter station -on use dumps energy into the station, removes it
from grid

- teleporter stations also charge hourly, depending on the charge multiplier variable (easy edit by
user at the top of the main.lua file)
- the amount of kj needed to get 1 unit of power is also a variable that's easily editable

- can build more stations for a larger "bank", though each teleporter has their own energy bank.
These are currently unlimited, should not ever hit the ?double/float? limit either way.
- stations and anchors are removable, but debug is needed to spawn the item back. Quick fix once the
item spawn function is exposed to LUA.

## TODO Feature frenzy (not done)

- give back the item upon deconstruction
- can draw vehicle power to charge stations(though you can probably connect vehicle to grid and do
it that way?)
- teleporter stations and anchors as parts of vehicles. Would need hooks for something like
on_build_veh_part or whatever.
28 changes: 28 additions & 0 deletions data/mods/teleportation_mod/furniture.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[
{
"id": "teleporter_anchor_deployed",
"type": "furniture",
"name": "Teleporter anchor (deployed)",
"move_cost_mod": 4,
"coverage": 0,
"required_str": 100,
"description": "A teleporter anchor, functioning as a target you can teleport to.",
"symbol": "O",
"color": "yellow",
"flags": [ "EASY_DECONSTRUCT", "NOCOLLIDE" ],
"looks_like": "telepad"
},
{
"id": "teleporter_station_deployed",
"type": "furniture",
"name": "Teleporter station (deployed)",
"move_cost_mod": 4,
"coverage": 0,
"required_str": 100,
"description": "A teleporter station, can be used to teleport.",
"symbol": "O",
"color": "yellow",
"flags": [ "EASY_DECONSTRUCT" ],
"looks_like": "f_MRI"
}
]
80 changes: 80 additions & 0 deletions data/mods/teleportation_mod/item.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
[
{
"id": "teleporter_controller",
"category": "tools",
"type": "TOOL",
"name": { "str": "Teleporter remote" },
"description": "A device with a digital display, connected to the teleporter network. Can be used to check teleporter status and teleport the user.",
"symbol": "{",
"color": "black",
"weight": "500 g",
"volume": "1 L",
"price": "40 USD",
"price_postapoc": "10 USD",
"material": [ "steel" ],
"to_hit": -4,
"bashing": 1,
"use_action": "teleporter_controller_use",
"looks_like": "teleporter",
"ammo": "battery",
"charges_per_use": 1,
"magazines": [
[
"battery",
[
"light_battery_cell",
"light_plus_battery_cell",
"light_minus_battery_cell",
"light_atomic_battery_cell",
"light_minus_atomic_battery_cell",
"light_minus_disposable_cell",
"light_disposable_cell"
]
]
],
"magazine_well": "250 ml"
},
{
"id": "teleporter_anchor_undeployed",
"category": "tools",
"type": "TOOL",
"name": { "str": "Teleporter anchor (undeployed)" },
"description": "A teleporter anchor, can be placed to function as a target.",
"symbol": "{",
"color": "black",
"weight": "150 kg",
"volume": "150 L",
"price": "400 USD",
"price_postapoc": "50 USD",
"material": [ "steel" ],
"to_hit": -4,
"bashing": 1,
"use_action": "teleporter_anchor_use",
"looks_like": "telepad"
},
{
"id": "teleporter_station_undeployed",
"category": "tools",
"type": "TOOL",
"name": { "str": "Teleporter station (undeployed)" },
"description": "A deployable teleporter station.",
"symbol": "{",
"color": "black",
"weight": "400 kg",
"volume": "350 L",
"price": "1200 USD",
"price_postapoc": "100 USD",
"material": [ "steel" ],
"to_hit": -4,
"bashing": 1,
"use_action": "teleporter_station_use",
"looks_like": "f_MRI"
},
{
"id": "schematics_teleportation",
"type": "BOOK",
"name": { "str_sp": "Teleporter network schematics" },
"description": "A disjointed collection of lab book pages , post-it notes, and computer printouts containing some funky physics equations and circuit diagrams. They seem to be describing some form of stable teleportation technology.",
"copy-from": "schematics_generic"
}
]
22 changes: 22 additions & 0 deletions data/mods/teleportation_mod/item_groups.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"id": "science",
"type": "item_group",
"items": [ [ "schematics_teleportation", 1 ] ]
},
{
"id": "schematics",
"type": "item_group",
"items": [ [ "schematics_teleportation", 10 ] ]
},
{
"id": "books_bank_vault",
"type": "item_group",
"items": [ [ "schematics_teleportation", 10 ] ]
},
{
"id": "teleport",
"type": "item_group",
"items": [ [ "schematics_teleportation", 10 ] ]
}
]
17 changes: 17 additions & 0 deletions data/mods/teleportation_mod/iuse.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
{
"type": "item_action",
"id": "teleporter_controller_use",
"name": { "str": "Activate the teleporter network." }
},
{
"type": "item_action",
"id": "teleporter_anchor_use",
"name": { "str": "Place and activate the teleporter anchor." }
},
{
"type": "item_action",
"id": "teleporter_station_use",
"name": { "str": "Place and activate the teleporter station." }
}
]
Loading

0 comments on commit ea16272

Please sign in to comment.