initial commit.
|
@ -0,0 +1,11 @@
|
|||
README.html
|
||||
build/music/**
|
||||
build/sound_effects/**
|
||||
build/*.xml
|
||||
.idea
|
||||
venv
|
||||
build
|
||||
__pycache__
|
||||
utils
|
||||
barotrauma-sunken-tapes
|
||||
barotrauma-sunken-tapes.zip
|
|
@ -0,0 +1,71 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license document.
|
||||
|
||||
4. Combined Works.
|
||||
You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.
|
|
@ -0,0 +1,97 @@
|
|||
# Sunken Tapes
|
||||
|
||||
Sunken Tapes mod for Barotrauma
|
||||
|
||||
There's a Boombox.
|
||||
|
||||
![Boombox](./source/images/boombox.png)
|
||||
|
||||
And cassette tapes. Can you find them all?
|
||||
|
||||
![Tapes](./docs/tapes_horizontal.png)
|
||||
|
||||
This mod does not include any licensed music. It provides you the tools to get it and integrate it yourself, hence the somewhat convoluted installation procedure.
|
||||
|
||||
## Features
|
||||
|
||||
- Boombox that you can carry.
|
||||
- Cassette tapes determine the songs.
|
||||
- Play/Stop controls.
|
||||
- Boombox plays sound without players needing to hold it.
|
||||
- Tapes have durability and a limited number of plays.
|
||||
- Energetic music gets you hyped.
|
||||
- Buy and sell cassette tapes at traders. Some are available only in certain types of stations.
|
||||
- Some cassette tapes are not available at merchants.
|
||||
- Inspect cassette cover art.
|
||||
- Throw against the wall and smash an annoying tape that your crew-mate keeps playing.
|
||||
|
||||
## Install
|
||||
|
||||
1. Download the zipped [archive](https://obzorje.kompot.si/s/WJGiitXANsHggWy/download/barotrauma-sunken-tapes.zip) and extract it.
|
||||
2. Run `install.bat`.
|
||||
3. Check the settings if they are correct.
|
||||
4. Click on `Download`.
|
||||
5. Click on `Deploy`.
|
||||
|
||||
|
||||
### Activate the mod in the game
|
||||
|
||||
1. Activate the mod in Settings. Make sure that it is on the top of the list.
|
||||
2. Restart the game.
|
||||
|
||||
### Notes
|
||||
|
||||
*Note:* The installation instructions are for Windows 10 64-bit users. If you're a Linux user you can try to install the dependencies in `main.py` and `deploy.py` and edit the files so they don't use the embedded `exe` files, sorry :/.
|
||||
|
||||
## Update
|
||||
|
||||
1. Run `install.bat`.
|
||||
2. Click on `Update`.
|
||||
3. Click on `Deploy`.
|
||||
|
||||
## Settings
|
||||
|
||||
* If your Barotrauma installation directory is anywhere else than in `C:/Program Files (x86)/Steam/steamapps/common/Barotrauma` you need to specify that.
|
||||
|
||||
* [Into the Abyss](https://steamcommunity.com/sharedfiles/filedetails/?id=2005463692): Sunken tapes overrides the `style.xml` but it includes the small changes that *Into the Abyss* makes to the file. If you don't use *Into the Abyss* you might only get some warnings for missing files but you can also uncheck the tickbox before the installation to override the vanilla `style.xml`.
|
||||
|
||||
* You can turn off the buffs from the tapes.
|
||||
|
||||
* If your screen ratio is any other than 16:9 (e.g. 1920x1080) you should correct the resolution variables before installing.
|
||||
|
||||
|
||||
## Some more details
|
||||
|
||||
|
||||
Installation generally does the following:
|
||||
|
||||
- Downloads all the songs that are available on YouTube.
|
||||
- Cuts and compresses the songs with ffmpeg.
|
||||
- Assembles the covers and icons images.
|
||||
- Creates the XMLs that define the mod.
|
||||
- Copies all the required files in your Barotrauma install folder.
|
||||
|
||||
|
||||
## Technical information
|
||||
|
||||
Many have tried to make such a mod but all got discouraged by the following issue. In multiplayer there's a desync happening during the level loading if you have items with sounds files too big (cumulatively) that are associated with an item. This results in inability to enter the game with all your friends because the server wants to load all the audio files during the level loading. Sunken Tapes mod resolves this issue by spawning invisible items with one sound file only when songs are played.
|
||||
|
||||
The first time someone plays a particular song in a level there will be a slight stutter for everyone because the server loads the sound. After that you can start and stop playing that song without any stutter.
|
||||
|
||||
## Adding your own tapes
|
||||
|
||||
1. Add a new entry into `tapes.yaml`. See how the other tapes are made. Beware, there be spoilers in the file!
|
||||
2. Add cover and icon images to `./source/images` with names being equal to `identifier` variable in `tapes.yaml`. The resolutions have to be `512x328px` and `64x41px` respectively.
|
||||
3. Run `install.bat` and click on `Deploy` again. It will assemble the png images, copy the files to `./build/` and update the mod in your game installation folder.
|
||||
|
||||
## Roadmap
|
||||
|
||||
- [ ] More loot options.
|
||||
- [ ] Layered noise sounds at low durability.
|
||||
- [ ] Fabricating special versions.
|
||||
- [ ] Editor for adding your own tapes.
|
||||
- [ ] Encounters/quests with the people from the underwater music scene on the stations.
|
||||
|
||||
## Support
|
||||
|
||||
**08080** provided original music for the mod. You can check out or buy his debut release *Astro Disco* on [08080.bandcamp.com](https://08080.bandcamp.com/).
|
|
@ -0,0 +1,254 @@
|
|||
import jinja2 as j2
|
||||
import yaml
|
||||
import subprocess
|
||||
import shutil
|
||||
import urllib.request
|
||||
import os
|
||||
import os.path
|
||||
import sys
|
||||
import time
|
||||
import logging
|
||||
from PIL import Image
|
||||
from mutagen.oggvorbis import OggVorbis
|
||||
from distutils.dir_util import copy_tree
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def rmfulldir(dirpath):
|
||||
try:
|
||||
shutil.rmtree(dirpath)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
|
||||
def update():
|
||||
pull = ["utils/git/bin/git.exe", "pull"]
|
||||
subprocess.call(pull)
|
||||
|
||||
|
||||
def download_and_extract(url_source, out_archive):
|
||||
logging.info(f"Downloading {url_source}, this may take a while.")
|
||||
|
||||
urllib.request.urlretrieve(url_source, out_archive)
|
||||
time.sleep(0.7)
|
||||
logging.info("Download complete.")
|
||||
|
||||
logging.info(f"Extracting {out_archive}")
|
||||
extract = ["utils/7z/7za.exe", "x", out_archive, "-o" "./utils/"]
|
||||
subprocess.call(extract)
|
||||
|
||||
time.sleep(0.7)
|
||||
logging.info("Removing " + out_archive)
|
||||
os.remove(out_archive)
|
||||
|
||||
|
||||
def download_ffmpeg(clean=False):
|
||||
if clean:
|
||||
rmfulldir("./utils/ffmpeg-" + get_ffmpeg_version() + "-full_build")
|
||||
|
||||
url_ffmpeg_source = "https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full.7z"
|
||||
out_ffmpeg_archive = "./utils/ffmpeg-release-full.7z.exe"
|
||||
|
||||
download_and_extract(url_ffmpeg_source, out_ffmpeg_archive)
|
||||
|
||||
|
||||
def download_git(clean=False):
|
||||
if clean:
|
||||
rmfulldir("./utils/PortableGit-2.33.0.2-64-bit")
|
||||
|
||||
url_git_source = "https://github.com/git-for-windows/git/releases/download/" + \
|
||||
"v2.33.0.windows.2/PortableGit-2.33.0.2-64-bit.7z.exe"
|
||||
out_git_archive = "./utils/PortableGit-2.33.0.2-64-bit.7z"
|
||||
|
||||
urllib.request.urlretrieve(url_git_source, out_git_archive)
|
||||
time.sleep(0.7)
|
||||
logging.info("Download complete.")
|
||||
|
||||
logging.info(f"Extracting {out_git_archive}")
|
||||
extract = [out_git_archive, "-o" "./utils/git", "-y"]
|
||||
subprocess.call(extract)
|
||||
|
||||
time.sleep(0.7)
|
||||
logging.info("Removing " + out_git_archive)
|
||||
os.remove(out_git_archive)
|
||||
|
||||
|
||||
def get_ffmpeg_version():
|
||||
url_ffmpeg_version = "https://www.gyan.dev/ffmpeg/builds/release-version"
|
||||
|
||||
fp = urllib.request.urlopen(url_ffmpeg_version)
|
||||
ffmpeg_version = fp.read().decode("utf8")
|
||||
fp.close()
|
||||
|
||||
return ffmpeg_version
|
||||
|
||||
|
||||
def fetch_and_cut_song(tape, ffmpeg_version):
|
||||
python_executable = "./utils/python-3.9.7-embed-amd64/python.exe"
|
||||
script = "./fetch_song.py"
|
||||
|
||||
if type(tape["source"]) == str:
|
||||
shutil.copy(tape["source"], f"./build/music/{tape['identifier']}.ogg")
|
||||
else:
|
||||
fetch = [python_executable, script, tape["source"]["url"], "-x", "--audio-format", "vorbis",
|
||||
"--audio-quality", "0", "-o", f"./build/tmp_music/{tape['identifier']}.ogg"]
|
||||
|
||||
# this is done in a separate python script because subprocess.call makes sure that the
|
||||
# download process is finished before trying to cut the song
|
||||
|
||||
subprocess.call(fetch)
|
||||
|
||||
time.sleep(0.1)
|
||||
|
||||
cut = ["./utils/ffmpeg-" + ffmpeg_version + "-full_build/bin/ffmpeg.exe",
|
||||
"-y", "-ss", f"{tape['source']['start']}",
|
||||
"-i", f"./build/tmp_music/{tape['identifier']}.ogg", "-acodec", "libvorbis",
|
||||
"-ac", "1", "-af", f"volume={tape['source']['volume']}dB",
|
||||
f"./build/music/{tape['identifier']}.ogg"]
|
||||
|
||||
if tape["source"]["end"] != -1:
|
||||
cut = cut[:-7] + ["-to", f"{tape['source']['end']}"] + cut[-7:]
|
||||
|
||||
try:
|
||||
subprocess.call(cut)
|
||||
except FileNotFoundError:
|
||||
print("ffmpeg not in utils directory. Run python install_dependencies.py "
|
||||
"or download the latest release version manually.")
|
||||
sys.exit()
|
||||
|
||||
|
||||
def assemble_png_image(tapes, icons=False):
|
||||
if icons:
|
||||
img_names = [f"./source/images/{tape['identifier']}_icon.png" for tape in tapes]
|
||||
images = [Image.open("./source/images/boombox_icon.png")]
|
||||
else:
|
||||
img_names = [f"./source/images/{tape['identifier']}.png" for tape in tapes]
|
||||
images = []
|
||||
|
||||
images += [Image.open(x) for x in img_names]
|
||||
widths, heights = zip(*(i.size for i in images))
|
||||
|
||||
total_width = max(widths)
|
||||
max_height = sum(heights)
|
||||
|
||||
new_im = Image.new('RGBA', (total_width, max_height))
|
||||
|
||||
y_offset = 0
|
||||
for im in images:
|
||||
new_im.paste(im, (0, y_offset))
|
||||
y_offset += im.size[1]
|
||||
|
||||
if icons:
|
||||
new_im.save("./build/icons.png")
|
||||
else:
|
||||
new_im.save("./build/covers.png")
|
||||
|
||||
|
||||
def prepare_music(data):
|
||||
try:
|
||||
os.mkdir('./build/music/')
|
||||
except FileExistsError:
|
||||
pass
|
||||
|
||||
logging.info("reading ffmpeg version")
|
||||
ffmpeg_version = get_ffmpeg_version()
|
||||
logging.info(f"ffmpeg version is {ffmpeg_version}")
|
||||
|
||||
logging.info("downloading and cutting the songs")
|
||||
for tape in data:
|
||||
if not os.path.exists(f"./build/music/{tape['identifier']}.ogg"):
|
||||
logging.info(f"Downloading {tape['name']}")
|
||||
fetch_and_cut_song(tape, ffmpeg_version)
|
||||
else:
|
||||
logging.info(f"Skipping {tape['name']}")
|
||||
|
||||
logging.info(f"removing temporary music folder")
|
||||
rmfulldir('./build/tmp_music/')
|
||||
|
||||
logging.info(f"copying the sound effects to build")
|
||||
copy_tree("./source/sound_effects", "./build/sound_effects")
|
||||
|
||||
|
||||
def prepare_images(data, config):
|
||||
logging.info(f"assembling covers and icons into png files")
|
||||
assemble_png_image(data)
|
||||
assemble_png_image(data, icons=True)
|
||||
|
||||
logging.info(f"copying other images")
|
||||
shutil.copy("./source/images/boombox.png", "./build/boombox.png")
|
||||
|
||||
if config["use_ita"]:
|
||||
shutil.copy("./source/images/sunken_tapes_titletext_ita.png",
|
||||
"./build/sunken_tapes_titletext_ita.png")
|
||||
else:
|
||||
shutil.copy("./source/images/sunken_tapes_titletext_vanilla.png",
|
||||
"./build/sunken_tapes_titletext_vanilla.png")
|
||||
|
||||
|
||||
def build_xml_code(data, config):
|
||||
logging.info(f"copying filelist.xml")
|
||||
shutil.copy("./source/filelist.xml", "./build/filelist.xml")
|
||||
|
||||
logging.info(f"calculate the value that lets you use the songs n-times")
|
||||
song_lengths = [OggVorbis(f"./build/music/{tape['identifier']}.ogg").info.length
|
||||
for tape in data]
|
||||
|
||||
use_lengths = [song_length * n for song_length, n in
|
||||
zip(song_lengths, [tape["no_of_uses"] for tape in data])]
|
||||
|
||||
condition_delta = [f"{1 / use_length:0.5f}" for use_length in use_lengths]
|
||||
affliction_delta = [100 / song_length for song_length in song_lengths]
|
||||
|
||||
logging.info(f"creating jinja environment")
|
||||
# create jinja2 environment
|
||||
j2env = j2.Environment(loader=j2.FileSystemLoader(Path(".")))
|
||||
j2env.globals.update(zip=zip)
|
||||
|
||||
# load the template file
|
||||
template1 = j2env.get_template("./source/sunken_tapes_template.xml")
|
||||
|
||||
if config["use_ita"]:
|
||||
template2 = j2env.get_template("./source/sunken_tapes_style_ita_template.xml")
|
||||
else:
|
||||
template2 = j2env.get_template("./source/sunken_tapes_style_template.xml")
|
||||
|
||||
logging.info(f"rendering the xml files")
|
||||
with open("./build/sunken_tapes.xml", "w+", encoding="utf8") as output_file:
|
||||
# render the template
|
||||
output_file.write(template1.render(tapes=data, config=config,
|
||||
condition_delta=condition_delta,
|
||||
affliction_delta=affliction_delta))
|
||||
|
||||
with open("./build/sunken_tapes_style.xml", "w+", encoding="utf8") as output_file:
|
||||
# render the template
|
||||
output_file.write(template2.render(tapes=data))
|
||||
|
||||
|
||||
def deploy(config):
|
||||
try:
|
||||
os.mkdir('./build')
|
||||
except FileExistsError:
|
||||
pass
|
||||
|
||||
logging.info("Reading tapes.yaml")
|
||||
data_file = Path("./source/tapes.yaml")
|
||||
|
||||
# load yaml file
|
||||
with data_file.open(encoding='utf-8') as fr:
|
||||
data = yaml.load(fr, Loader=yaml.SafeLoader)
|
||||
|
||||
prepare_music(data)
|
||||
prepare_images(data, config)
|
||||
build_xml_code(data, config)
|
||||
|
||||
logging.info(f"removing the old installed mod directory {config['installdir'] + '/Mods/Sunken Tapes/'}")
|
||||
rmfulldir(config["installdir"] + "/Mods/Sunken Tapes/")
|
||||
|
||||
logging.info(f"copying the new build")
|
||||
if Path(config["installdir"]).is_dir():
|
||||
copy_tree("./build/", config["installdir"] + "/Mods/Sunken Tapes/")
|
||||
else:
|
||||
raise FileNotFoundError(
|
||||
f"{config['installdir']} does not exist. Set up the correct Barotrauma installation directory")
|
||||
|
||||
logging.info(f"Done!")
|
After Width: | Height: | Size: 71 KiB |
|
@ -0,0 +1,5 @@
|
|||
import youtube_dl
|
||||
import sys
|
||||
|
||||
if __name__ == "__main__":
|
||||
youtube_dl.main(sys.argv[1:])
|
|
@ -0,0 +1 @@
|
|||
.\utils\python-3.9.7-embed-amd64\python.exe .\main.py
|
|
@ -0,0 +1,241 @@
|
|||
import os
|
||||
import tkinter as tk
|
||||
from tkinter import filedialog as fd
|
||||
from tkinter.messagebox import showinfo, askyesno, askokcancel
|
||||
from tkinter import ttk
|
||||
from pathlib import Path
|
||||
from deploy import download_ffmpeg, download_git, deploy, get_ffmpeg_version, update
|
||||
import logging
|
||||
import sys
|
||||
|
||||
|
||||
def get_curr_screen_geometry():
|
||||
"""
|
||||
Workaround to get the size of the current screen in a multi-screen setup.
|
||||
|
||||
Returns:
|
||||
geometry (str): The standard Tk geometry string.
|
||||
[width]x[height]+[left]+[top]
|
||||
"""
|
||||
root = tk.Tk()
|
||||
root.update_idletasks()
|
||||
root.attributes('-fullscreen', True)
|
||||
root.state('iconic')
|
||||
geometry = root.winfo_geometry()
|
||||
root.destroy()
|
||||
|
||||
return geometry
|
||||
|
||||
|
||||
def create_install_frame(container):
|
||||
def find_barotrauma_directory():
|
||||
first_guess = Path("C:/Program Files (x86)/Steam/steamapps/common/Barotrauma")
|
||||
second_guess = Path("D:/Steam/steamapps/common/Barotrauma")
|
||||
|
||||
if first_guess.is_dir():
|
||||
return first_guess.as_posix()
|
||||
elif second_guess.is_dir():
|
||||
return second_guess.as_posix()
|
||||
else:
|
||||
return False
|
||||
|
||||
def select_barotrauma_directory():
|
||||
return_dir = fd.askdirectory(initialdir="C:/")
|
||||
install_dir.set(return_dir)
|
||||
|
||||
frame = ttk.LabelFrame(container, text='Barotrauma installation directory')
|
||||
|
||||
find_button = ttk.Button(frame, text='Guess',
|
||||
command=lambda: install_dir.set(find_barotrauma_directory()))
|
||||
find_button.pack(side="left", padx=3, pady=3)
|
||||
|
||||
install_dir = tk.StringVar()
|
||||
install_dir.set(find_barotrauma_directory())
|
||||
|
||||
directory_entry = ttk.Entry(frame, width=60, textvariable=install_dir)
|
||||
directory_entry.pack(side="left", padx=3, pady=3, expand=True, fill="x")
|
||||
|
||||
browse_button = ttk.Button(frame, text='Browse', command=select_barotrauma_directory)
|
||||
browse_button.pack(side="left", padx=3, pady=3)
|
||||
|
||||
return frame, install_dir
|
||||
|
||||
|
||||
def create_options_frame(container):
|
||||
frame = ttk.LabelFrame(container, text='Options')
|
||||
|
||||
# Use ITA checkbox
|
||||
use_ita = tk.StringVar()
|
||||
use_ita.set("1")
|
||||
use_ita_check = ttk.Checkbutton(
|
||||
frame,
|
||||
variable=use_ita,
|
||||
text='Use ITA mod',
|
||||
command=lambda: print(use_ita.get()))
|
||||
|
||||
# Buffs checkbox
|
||||
buffs = tk.StringVar()
|
||||
buffs.set("1")
|
||||
buffs_check = ttk.Checkbutton(
|
||||
frame,
|
||||
variable=buffs,
|
||||
text='Buffs',
|
||||
command=lambda: print(buffs.get()))
|
||||
|
||||
for widget in frame.winfo_children():
|
||||
widget.pack(side="top", padx=3, pady=3, fill="x")
|
||||
|
||||
return frame, use_ita, buffs
|
||||
|
||||
|
||||
def create_resolution_frame(container):
|
||||
frame = ttk.LabelFrame(container, text='Resolution')
|
||||
|
||||
def detect_screen_resolution():
|
||||
w, h = get_curr_screen_geometry().split("+")[0].split("x")
|
||||
width.set(w)
|
||||
height.set(h)
|
||||
|
||||
width = tk.StringVar()
|
||||
width.set("1920")
|
||||
width_label = ttk.Label(frame, text='Width:')
|
||||
width_frame = ttk.Entry(frame, width=12, textvariable=width)
|
||||
|
||||
height = tk.StringVar()
|
||||
height.set("1080")
|
||||
height_label = ttk.Label(frame, text='Height:')
|
||||
height_frame = ttk.Entry(frame, width=12, textvariable=height)
|
||||
|
||||
detect_button = ttk.Button(frame, text='Detect', command=detect_screen_resolution)
|
||||
|
||||
for widget in frame.winfo_children():
|
||||
widget.pack(side="left", padx=3, pady=3)
|
||||
|
||||
return frame, width, height
|
||||
|
||||
|
||||
def create_deploy_frame(container, config):
|
||||
def deploy_action():
|
||||
config_values = {"installdir": config["installdir"].get(),
|
||||
"use_ita": config["use_ita"].get() == "1",
|
||||
"buffs": config["buffs"].get() == "1",
|
||||
"resolution_x": int(config["resolution_x"].get()),
|
||||
"resolution_y": int(config["resolution_x"].get())}
|
||||
|
||||
logging.info(f"deploying with config: {config_values}")
|
||||
deploy(config_values)
|
||||
|
||||
showinfo(title='Success!',
|
||||
message=f'Sunken Tapes was successfully installed to:'
|
||||
f'\n{config["installdir"].get()}'
|
||||
f'\n\nThis installer will now close.')
|
||||
|
||||
container.destroy()
|
||||
|
||||
def download_ffmpeg_action():
|
||||
def finish():
|
||||
does_ffmpeg_exists()
|
||||
showinfo(title='Success!',
|
||||
message=f'ffmpeg downloaded. You can now deploy Sunken Tapes:')
|
||||
|
||||
if not Path("./utils/ffmpeg-" + get_ffmpeg_version() + "-full_build/bin/ffmpeg.exe").exists():
|
||||
download_ffmpeg()
|
||||
finish()
|
||||
return
|
||||
else:
|
||||
answer = askyesno(title='ffmpeg already downloaded',
|
||||
message='ffmpeg is already in utils directory!'
|
||||
'\n\nDelete the existing one and download again?')
|
||||
|
||||
if answer:
|
||||
download_ffmpeg(clean=True)
|
||||
finish()
|
||||
else:
|
||||
return
|
||||
|
||||
def update_action():
|
||||
if not Path("./utils/git").exists():
|
||||
answer = askokcancel(
|
||||
title='Confirmation',
|
||||
message='Portable version of git will be downloaded.'
|
||||
'\nThis is needed to check for updates in the repository')
|
||||
if answer:
|
||||
download_git()
|
||||
else:
|
||||
return
|
||||
else:
|
||||
logging.info(f"git already in utils")
|
||||
|
||||
update()
|
||||
|
||||
def does_ffmpeg_exists():
|
||||
if Path("./utils/ffmpeg-" + get_ffmpeg_version() + "-full_build/bin/ffmpeg.exe").exists():
|
||||
deploy_button["state"] = "normal"
|
||||
else:
|
||||
deploy_button["state"] = "disable"
|
||||
|
||||
frame = ttk.LabelFrame(container, text='Install')
|
||||
|
||||
frame_1 = ttk.Frame(frame)
|
||||
|
||||
download_tools_label = ttk.Label(frame_1, text='Download and unpack ffmpeg:')
|
||||
download_tools_label.pack(side="left", padx=3, pady=3)
|
||||
download_tools_button = ttk.Button(frame_1, text='Download', command=download_ffmpeg_action)
|
||||
download_tools_button.pack(side="right", padx=3, pady=3)
|
||||
|
||||
frame_1.pack(side="top", fill="x")
|
||||
|
||||
frame_2 = ttk.Frame(frame)
|
||||
|
||||
update_label = ttk.Label(frame_2, text='Download update from git.kompot.si/jaka/barotrauma-sunken-tapes:')
|
||||
update_label.pack(side="left", padx=3, pady=3)
|
||||
update_button = ttk.Button(frame_2, text='Update', command=update_action)
|
||||
update_button.pack(side="right", padx=3, pady=3)
|
||||
|
||||
frame_2.pack(side="top", fill="x")
|
||||
|
||||
frame_3 = ttk.Frame(frame)
|
||||
|
||||
deploy_label = ttk.Label(frame_3, text='Download songs and deploy mod to Barotrauma Mods directory:')
|
||||
deploy_label.pack(side="left", padx=3, pady=3)
|
||||
deploy_button = ttk.Button(frame_3, text='Deploy', command=deploy_action)
|
||||
deploy_button.pack(side="right", padx=3, pady=3)
|
||||
|
||||
frame_3.pack(side="top", fill="x")
|
||||
|
||||
does_ffmpeg_exists()
|
||||
|
||||
return frame
|
||||
|
||||
|
||||
def create_main_window():
|
||||
# root window
|
||||
root = tk.Tk()
|
||||
root.title('Sunken Tapes')
|
||||
middle_frame = ttk.Frame(root)
|
||||
|
||||
install_frame, install_dir = create_install_frame(root)
|
||||
options_frame, use_ita, buffs = create_options_frame(middle_frame)
|
||||
resolution_frame, width, height = create_resolution_frame(middle_frame)
|
||||
|
||||
config = {"installdir": install_dir,
|
||||
"use_ita": use_ita,
|
||||
"buffs": buffs,
|
||||
"resolution_x": width,
|
||||
"resolution_y": height}
|
||||
|
||||
deploy_frame = create_deploy_frame(root, config)
|
||||
|
||||
install_frame.pack(side="top", fill="x", pady=3, padx=3)
|
||||
options_frame.pack(side="left", fill="y", pady=3, padx=3)
|
||||
resolution_frame.pack(side="left", fill="both", pady=3, padx=3, expand=True)
|
||||
middle_frame.pack(side="top", fill="x")
|
||||
deploy_frame.pack(side="top", fill="x", pady=3, padx=3)
|
||||
|
||||
root.mainloop()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.chdir(Path(__file__).parents[0])
|
||||
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
|
||||
create_main_window()
|
|
@ -0,0 +1,49 @@
|
|||
import os
|
||||
import shutil
|
||||
from distutils.dir_util import copy_tree
|
||||
import subprocess
|
||||
import stat
|
||||
|
||||
|
||||
def rmfulldir(top):
|
||||
for root, dirs, files in os.walk(top, topdown=False):
|
||||
for name in files:
|
||||
filename = os.path.join(root, name)
|
||||
os.chmod(filename, stat.S_IWUSR)
|
||||
os.remove(filename)
|
||||
for name in dirs:
|
||||
os.rmdir(os.path.join(root, name))
|
||||
os.rmdir(top)
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
os.mkdir('./barotrauma-sunken-tapes')
|
||||
except FileExistsError:
|
||||
pass
|
||||
|
||||
copy_tree("./source/", "./barotrauma-sunken-tapes/source")
|
||||
copy_tree("./utils/7z", "./barotrauma-sunken-tapes/utils/7z")
|
||||
copy_tree("./utils/python-3.9.7-embed-amd64", "./barotrauma-sunken-tapes/utils/python-3.9.7-embed-amd64")
|
||||
copy_tree("./.git", "./barotrauma-sunken-tapes/.git")
|
||||
copy_tree("./docs", "./barotrauma-sunken-tapes/docs")
|
||||
shutil.copy("./deploy.py", "./barotrauma-sunken-tapes/deploy.py")
|
||||
shutil.copy("./main.py", "./barotrauma-sunken-tapes/main.py")
|
||||
shutil.copy("./fetch_song.py", "./barotrauma-sunken-tapes/fetch_song.py")
|
||||
shutil.copy("./install.bat", "./barotrauma-sunken-tapes/install.bat")
|
||||
shutil.copy("./README.md", "./barotrauma-sunken-tapes/README.md")
|
||||
shutil.copy("./LICENSE", "./barotrauma-sunken-tapes/LICENSE")
|
||||
shutil.copy("./.gitignore", "./barotrauma-sunken-tapes/.gitignore")
|
||||
|
||||
archive = "7z a -tzip barotrauma-sunken-tapes.zip ./barotrauma-sunken-tapes".split(" ")
|
||||
subprocess.call(archive)
|
||||
|
||||
shutil.copy("./barotrauma-sunken-tapes.zip",
|
||||
"../Nextcloud/barotrauma-sunken-tapes/barotrauma-sunken-tapes.zip")
|
||||
|
||||
os.remove("./barotrauma-sunken-tapes.zip")
|
||||
rmfulldir("./barotrauma-sunken-tapes")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
After Width: | Height: | Size: 1016 KiB |
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<contentpackage name="Sunken Tapes" path="Mods/Sunken Tapes/filelist.xml" gameversion="0.9.1.0" corepackage="false">
|
||||
<Item file="Mods/Sunken Tapes/sunken_tapes.xml" />
|
||||
<UIStyle file="Mods/Sunken Tapes/sunken_tapes_style.xml" />
|
||||
</contentpackage>
|
After Width: | Height: | Size: 282 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 282 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 284 KiB |
After Width: | Height: | Size: 6.2 KiB |
After Width: | Height: | Size: 297 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 130 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 319 KiB |
After Width: | Height: | Size: 6.1 KiB |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 233 KiB |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 261 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 301 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 229 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 308 KiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 297 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 327 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 188 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 224 KiB |
After Width: | Height: | Size: 6.1 KiB |
After Width: | Height: | Size: 248 KiB |
After Width: | Height: | Size: 6.1 KiB |
After Width: | Height: | Size: 213 KiB |
After Width: | Height: | Size: 231 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 222 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 234 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 271 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 260 KiB |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 837 KiB |
After Width: | Height: | Size: 772 KiB |
After Width: | Height: | Size: 215 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 219 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 288 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 187 KiB |
After Width: | Height: | Size: 5.5 KiB |
|
@ -0,0 +1,170 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Items>
|
||||
|
||||
<Item name="Boombox" cargocontaineridentifier="metalcrate" identifier="boombox" category="Equipment" Tags="mediumitem,boombox" scale="0.5" description="" price="850" impactsoundtag="impact_metal_light" isshootable="true">
|
||||
<PreferredContainer primary="abandonedcrewcab" spawnprobability="0.1"/>
|
||||
<PreferredContainer primary="outpostcrewcabinet" spawnprobability="0.1"/>
|
||||
<Price baseprice="500" soldeverywhere="false">
|
||||
<Price locationtype="outpost" multiplier="1" minavailable="1" />
|
||||
<Price locationtype="city" multiplier="0.7" minavailable="1"/>
|
||||
<Price locationtype="research" multiplier="1.5" sold="false"/>
|
||||
<Price locationtype="military" multiplier="1.5" sold="false"/>
|
||||
<Price locationtype="mine" multiplier="1.5" sold="false"/>
|
||||
</Price>
|
||||
<Upgrade gameversion="0.9.2.0" scale="0.5" />
|
||||
<InventoryIcon texture="Mods/Sunken Tapes/icons.png" sourcerect="0,0,64,64" origin="0.5,0.5" />
|
||||
<Sprite texture="Mods/Sunken Tapes/boombox.png" sourcerect="0,0,100,60" depth="0.55" origin="0.5,0.5" />
|
||||
<Body width="100" height="60" />
|
||||
<LightComponent LightColor="0.78,0.04,0.235,0.59" range="10" powerconsumption="0" blinkfrequency="1" IsOn="false" canbeselected="false">
|
||||
</LightComponent>
|
||||
<CustomInterface canbeselected="true" drawhudwhenequipped="true" allowuioverlap="true">
|
||||
<GuiFrame relativesize="0.10,0.07" anchor="CenterLeft" pivot="BottomLeft" relativeoffset="0.006,-0.05" style="ItemUI" />
|
||||
<TickBox text="Play">
|
||||
<StatusEffect type="OnUse" targettype="This" IsOn="true">
|
||||
<Conditional IsOn="false" />
|
||||
<sound file="Mods/Sunken Tapes/sound_effects/boombox_play_cassette.ogg" type="OnUse" range="500" volume="1.0" />
|
||||
</StatusEffect>
|
||||
<!--StatusEffect type="OnUse" targettype="Contained" comparison="And">
|
||||
<Conditional condition="lte 50.0" />
|
||||
<Conditional condition="gt 25.0" />
|
||||
<RequiredItem items="cassette" type="Contained" />
|
||||
<sound file="Content/Sounds/FireSmall.ogg" type="OnUse" range="1000" loop="true" volume="1.0" />
|
||||
</StatusEffect>
|
||||
<StatusEffect type="OnUse" targettype="Contained" comparison="And">
|
||||
<Conditional condition="lte 25.0" />
|
||||
<Conditional condition="gt 10.0" />
|
||||
<RequiredItem items="cassette" type="Contained" />
|
||||
<sound file="Content/Sounds/FireSmall.ogg" type="OnUse" range="1000" loop="true" volume="1.0" />
|
||||
</StatusEffect>
|
||||
<StatusEffect type="OnUse" targettype="Contained">
|
||||
<Conditional condition="lte 10.0" />
|
||||
<RequiredItem items="cassette" type="Contained" />
|
||||
<sound file="Content/Sounds/FireSmall.ogg" type="OnUse" range="1000" loop="true" volume="1.0" />
|
||||
</StatusEffect-->
|
||||
{% for tape in tapes %}
|
||||
<StatusEffect type="OnUse" targettype="Contained" condition="-{{ condition_delta[loop.index0] }}">
|
||||
<RequiredItem items="cassette-{{ tape.identifier }}" type="Contained" />
|
||||
<SpawnItem identifiers="song-{{ tape.identifier }}" spawnposition="ContainedInventory" />
|
||||
</StatusEffect>{% endfor %}
|
||||
|
||||
<StatusEffect type="OnSecondaryUse" targettype="This" IsOn="false" >
|
||||
<Conditional IsOn="true" />
|
||||
<sound file="Mods/Sunken Tapes/sound_effects/boombox_play_cassette.ogg" type="OnUse" range="500" volume="1.0" />
|
||||
<Use />
|
||||
</StatusEffect>
|
||||
</TickBox>
|
||||
</CustomInterface>
|
||||
<Holdable slots="RightHand,LeftHand" selectkey="Use" pickkey="Select" attachable="false" aimable="false" holdpos="5,-65" holdangle="0" aimpos="5,30" handle1="0,30" handle2="0,30" swingamount="20,5" swingspeed="0.5" swingwhenusing="true" msg="ItemMsgPickUpUse">
|
||||
</Holdable>
|
||||
<ItemContainer hideitems="true" drawinventory="true" capacity="1" maxstacksize="1" slotsperrow="6" itempos="0,0" iteminterval="0,0" itemrotation="0" canbeselected="false" containedspritedepth="0.79">
|
||||
<StatusEffect type="OnUse" targettype="Contained" >
|
||||
<Use />
|
||||
</StatusEffect>
|
||||
<Containable items="cassette">
|
||||
</Containable>
|
||||
</ItemContainer>
|
||||
</Item>
|
||||
|
||||
<!-- tape box -->
|
||||
|
||||
<Item name="Cassette Tape Box" identifier="cassette-tape-box" category="Equipment" tags="smallitem,mobilecontainer,tool" cargocontaineridentifier="" showcontentsintooltip="true" Scale="0.5" fireproof="true" description="" impactsoundtag="impact_metal_heavy">
|
||||
<PreferredContainer secondary="wreckstoragecab" spawnprobability="0.06"/>
|
||||
<PreferredContainer primary="outpostcrewcabinet" minamount="0" maxamount="1" spawnprobability="0.2"/>
|
||||
<Deconstruct time="10">
|
||||
<Item identifier="steel" />
|
||||
</Deconstruct>
|
||||
<Fabricate suitablefabricators="fabricator" requiredtime="20">
|
||||
<RequiredSkill identifier="mechanical" level="20" />
|
||||
<Item identifier="steel" />
|
||||
</Fabricate>
|
||||
<Price baseprice="75" >
|
||||
<Price locationtype="outpost" multiplier="1" minavailable="1" />
|
||||
<Price locationtype="city" multiplier="0.9" minavailable="1" />
|
||||
<Price locationtype="research" multiplier="1.25" minavailable="1" />
|
||||
<Price locationtype="military" multiplier="1.25" minavailable="1" />
|
||||
<Price locationtype="mine" multiplier="1.25" minavailable="1" />
|
||||
</Price>
|
||||
<InventoryIcon texture="Content/Items/InventoryIconAtlas.png" sourcerect="640,256,64,64" origin="0.5,0.6" />
|
||||
<Sprite texture="Content/Items/Tools/tools.png" sourcerect="314,1,94,74" origin="0.5,0.5" />
|
||||
<Body width="90" height="60" density="20" />
|
||||
<MeleeWeapon slots="RightHand,LeftHand,Any" controlpose="true" aimpos="45,10" handle1="0,10" handle2="0,10" holdangle="90" reload="1" range="50" combatpriority="6" msg="ItemMsgPickUpSelect">
|
||||
<Attack structuredamage="10" itemdamage="5" stun="0.6" targetimpulse="2">
|
||||
<Affliction identifier="blunttrauma" strength="2" />
|
||||
<Sound file="Content/Items/Weapons/Smack2.ogg" range="800" />
|
||||
</Attack>
|
||||
</MeleeWeapon>
|
||||
<ItemContainer capacity="24" keepopenwhenequipped="true" movableframe="true">
|
||||
<Containable items="cassette" />
|
||||
</ItemContainer>
|
||||
<aitarget sightrange="1000" soundrange="1000" fadeouttime="2" />
|
||||
<Upgrade gameversion="0.10.0.0" scale="0.5" />
|
||||
</Item>
|
||||
|
||||
<!-- Cassette Tapes -->
|
||||
|
||||
{% for tape in tapes %}
|
||||
<Item name="Tape: {{ tape.name }}" identifier="cassette-{{ tape.identifier }}" category="Equipment" maxstacksize="8" Tags="smallitem,cassette" cargocontaineridentifier="metalcrate" scale="0.5" isshootable="true" impacttolerance="1.3">
|
||||
<PreferredContainer primary="abandonedcrewcab" spawnprobability="0.05"/>
|
||||
<PreferredContainer primary="outpostcrewcabinet" minamount="0" maxamount="1" spawnprobability="0.05"/>
|
||||
<Price baseprice="{{ tape.price }}" soldeverywhere="false">{% for location in ["outpost", "city", "research", "military", "mine"] %}
|
||||
<Price locationtype="{{ location }}" multiplier="{{ tape.multipliers[loop.index0] }}" sold="{{ tape.sold[loop.index0] }}" minavailable="1" />{% endfor %}
|
||||
</Price>
|
||||
<InventoryIcon texture="Mods/Sunken Tapes/icons.png" sourcerect="0,{{ loop.index0*41 + 64 }},64,41" origin="0.5,0.5" />
|
||||
<Sprite texture="Mods/Sunken Tapes/icons.png" sourcerect="0,{{ loop.index0*41 + 64 }},64,41" depth="0.6" origin="0.5,0.5" />
|
||||
<Body width="48" height="48" />
|
||||
<Throwable slots="Any,RightHand,LeftHand" holdpos="0,0" handle1="0,0" throwforce="4.0" aimpos="35,-10" msg="ItemMsgPickUpSelect">
|
||||
<StatusEffect type="OnImpact" target="This" Condition="-5.0" disabledeltatime="true">
|
||||
<sound file="Mods/Sunken Tapes/sound_effects/cassette_drop.ogg" range="500" volume="1.0" />
|
||||
</StatusEffect>
|
||||
</Throwable>
|
||||
<CustomInterface canbeselected="false" drawhudwhenequipped="true" allowuioverlap="true">
|
||||
<GuiFrame relativesize="{{ 512.0 / config['resolution_x'] }},{{ 328.0 / config['resolution_y'] }}" anchor="CenterRight" pivot="CenterRight" style="sunken_tapes_cover_{{ tape.identifier }}" />
|
||||
</CustomInterface>
|
||||
<ItemContainer hideitems="true" capacity="1" drawinventory="false" canbeselected="false" canbecombined="true" removecontaineditemsondeconstruct="true">
|
||||
<StatusEffect type="OnNotContained" targettype="Contained">
|
||||
<Use />
|
||||
</StatusEffect>
|
||||
<StatusEffect type="OnContained" targettype="This">
|
||||
<Conditional hastag="!eq boombox" targetcontainer="true" />
|
||||
<Use />
|
||||
</StatusEffect>
|
||||
<StatusEffect type="OnUse" targettype="Contained">
|
||||
<Use />
|
||||
</StatusEffect>
|
||||
<Containable items="song" />
|
||||
</ItemContainer>
|
||||
<Holdable slots="Any,RightHand,LeftHand" msg="ItemMsgPickUpSelect" >
|
||||
<StatusEffect type="OnBroken" target="This">
|
||||
<Remove />
|
||||
</StatusEffect>
|
||||
</Holdable>
|
||||
</Item>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
<!-- SONGS -->
|
||||
|
||||
{% for tape, delta in zip(tapes, affliction_delta) %}
|
||||
<Item name="Song: {{ tape.name }}" identifier="song-{{ tape.identifier }}" Tags="song" category="Misc">
|
||||
<Sprite texture="Content/Items/Electricity/signalcomp.png" depth="0.8" sourcerect="0,160,4,4" origin="0.5,0.5" />
|
||||
<Body width="48" height="48" />
|
||||
<InventoryIcon texture="Content/Items/Electricity/signalcomp.png" sourcerect="0,160,4,4" origin="0.5,0.5" />
|
||||
<ItemComponent>
|
||||
<StatusEffect type="Always" target="This">
|
||||
<sound file="Mods/Sunken Tapes/music/{{ tape.identifier }}.ogg" type="OnUse" range="1000" loop="true" volume="1.0" />
|
||||
</StatusEffect>{% if tape.buffs %}
|
||||
<StatusEffect type="Always" target="NearbyCharacters" range="1000">{% for buff in tape.buffs %}
|
||||
{% if buff == "psychosis" %}<Affliction identifier="{{ buff }}" strength= "{{ '%0.4f' % (delta + 0.1) }}" />{% else %}<Affliction identifier="{{ buff }}" strength= "{{ '%0.4f' % (delta*4 + 1) }}" />{% endif %}{% endfor %}
|
||||
</StatusEffect>{% endif %}
|
||||
<StatusEffect type="OnNotContained" targettype="This">
|
||||
<Remove />
|
||||
</StatusEffect>
|
||||
<StatusEffect type="OnUse" targettype="This">
|
||||
<Remove />
|
||||
</StatusEffect>
|
||||
</ItemComponent>
|
||||
</Item>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
</Items>
|
|
@ -0,0 +1,487 @@
|
|||
- identifier: dmx
|
||||
name: DMX - X Gon Give It To Ya
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=vkOJ9uNj9EY
|
||||
start: 00:00:00
|
||||
end: -1
|
||||
volume: 0
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
price: 500
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, true, false, false, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 6
|
||||
buffs:
|
||||
- strengthen
|
||||
- haste
|
||||
|
||||
- identifier: dmxcut
|
||||
name: DMX Carnage Cut
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=vkOJ9uNj9EY
|
||||
start: 00:00:27
|
||||
end: -1
|
||||
volume: 0
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
price: 650
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, false, false, true, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 6
|
||||
buffs:
|
||||
- strengthen
|
||||
- haste
|
||||
|
||||
- identifier: ddt
|
||||
name: Dragostea Din Tei
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=zxbufWzX1NA
|
||||
start: 00:00:01.4
|
||||
end: -1
|
||||
volume: 0
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
- location: outpostcrewcabinet
|
||||
probability: 0.05
|
||||
price: 400
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [true, false, false, false, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 6
|
||||
buffs: False
|
||||
|
||||
- identifier: java
|
||||
name: Kenny Larkin - Java
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=PoaLz0UK6KY
|
||||
start: 00:01:28
|
||||
end: 00:06:50
|
||||
volume: 2
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
- location: outpostcrewcabinet
|
||||
probability: 0.01
|
||||
price: 550
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, false, true, false, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 6
|
||||
buffs: False
|
||||
|
||||
- identifier: dm
|
||||
name: Menace Ruine - Dark Mother
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=0XpL0LwYC0s
|
||||
start: 00:01:12
|
||||
end: 00:02:49
|
||||
volume: 0
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
price: 1000
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, false, false, false, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 1
|
||||
buffs:
|
||||
- psychosis
|
||||
|
||||
- identifier: swgd
|
||||
name: Sewer Goddess - Chained To The Edge Of Existence
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=GfdfzslZ1GY
|
||||
start: 00:02:20
|
||||
end: 00:04:32
|
||||
volume: 0
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
price: 1000
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, false, false, false, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 1
|
||||
buffs:
|
||||
- psychosis
|
||||
|
||||
- identifier: urfaust
|
||||
name: Urfaust - Die Kalte Teufelsfaust
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=mjHaJq1BTQ4
|
||||
start: 00:00:00
|
||||
end: -1
|
||||
volume: 3
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
price: 1000
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, false, false, false, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 1
|
||||
buffs:
|
||||
- psychosis
|
||||
|
||||
- identifier: rainbowstalin
|
||||
name: Rainbow Stalin
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=zab9cluVJa0
|
||||
start: 00:00:00
|
||||
end: -1
|
||||
volume: 0
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
- location: outpostcrewcabinet
|
||||
probability: 0.01
|
||||
price: 600
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, true, false, false, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 6
|
||||
buffs:
|
||||
- strengthen
|
||||
|
||||
- identifier: nazare
|
||||
name: Альянс - На заре
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=tUBVEKzsZ-k
|
||||
start: 00:00:00
|
||||
end: -1
|
||||
volume: 3
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
- location: outpostcrewcabinet
|
||||
probability: 0.01
|
||||
price: 450
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, true, true, false, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 6
|
||||
buffs: False
|
||||
|
||||
- identifier: shanty1
|
||||
name: Doodle Let Me Go
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=rbAhU913SSk
|
||||
start: 00:00:00
|
||||
end: 00:02:45
|
||||
volume: 0
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
- location: outpostcrewcabinet
|
||||
probability: 0.05
|
||||
price: 500
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [true, false, false, false, true] # outpost, city, research, military, mine
|
||||
no_of_uses: 6
|
||||
buffs: False
|
||||
|
||||
- identifier: shanty2
|
||||
name: Rolling Down To Old Maui
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=P7GC9KsvkDI
|
||||
start: 00:00:00
|
||||
end: 00:03:20
|
||||
volume: 6
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
- location: outpostcrewcabinet
|
||||
probability: 0.05
|
||||
price: 500
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [true, false, false, false, true] # outpost, city, research, military, mine
|
||||
no_of_uses: 6
|
||||
buffs: False
|
||||
|
||||
- identifier: rum
|
||||
name: 15 Men and a Bottle of Rum
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=nzcv5TJkJBA
|
||||
start: 00:00:00
|
||||
end: -1
|
||||
volume: 0
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
- location: outpostcrewcabinet
|
||||
probability: 0.05
|
||||
price: 500
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [true, false, false, false, true] # outpost, city, research, military, mine
|
||||
no_of_uses: 4
|
||||
buffs: False
|
||||
|
||||
- identifier: biosphere
|
||||
name: Biosphere - Daphnis 26
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=l0h4Q-0GV-U
|
||||
start: 00:04:11
|
||||
end: 00:05:51
|
||||
volume: 3
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
- location: outpostcrewcabinet
|
||||
probability: 0.01
|
||||
price: 550
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, false, true, false, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 6
|
||||
buffs: False
|
||||
|
||||
- identifier: bedouin
|
||||
name: Bedouin - Set The Control For The Heart Of The Sun
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=d8vetnC1jYo
|
||||
start: 00:00:00
|
||||
end: -1
|
||||
volume: 3
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
- location: outpostcrewcabinet
|
||||
probability: 0.01
|
||||
price: 550
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, true, false, false, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 4
|
||||
buffs: False
|
||||
|
||||
- identifier: hardbass
|
||||
name: Hardbass
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=BnTW6fZz-1E
|
||||
start: 00:00:00
|
||||
end: -1
|
||||
volume: 0
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
- location: outpostcrewcabinet
|
||||
probability: 0.01
|
||||
price: 650
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, false, false, false, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 6
|
||||
buffs:
|
||||
- strengthen
|
||||
|
||||
- identifier: ira
|
||||
name: Come out and Fight
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=OT0yoo9B2Bc
|
||||
start: 00:00:00
|
||||
end: 00:02:35
|
||||
volume: 2
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
- location: outpostcrewcabinet
|
||||
probability: 0.01
|
||||
price: 450
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, false, false, false, true] # outpost, city, research, military, mine
|
||||
no_of_uses: 6
|
||||
buffs: False
|
||||
|
||||
- identifier: tha
|
||||
name: Aphex Twin - Tha
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=N3G7JPTVVEQ
|
||||
start: 00:00:00
|
||||
end: 00:04:08.8
|
||||
volume: 0
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
- location: outpostcrewcabinet
|
||||
probability: 0.01
|
||||
price: 550
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, false, true, false, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 6
|
||||
buffs: False
|
||||
|
||||
- identifier: immigrantsong
|
||||
name: Led Zeppelin - Immigrant Song
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=y8OtzJtp-EM
|
||||
start: 00:00:00
|
||||
end: -1
|
||||
volume: 3
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
price: 1000
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, false, false, false, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 6
|
||||
buffs: False
|
||||
|
||||
- identifier: redoctober
|
||||
name: The Hunt for Red October
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=YEt41bYQBgE
|
||||
start: 00:01:24
|
||||
end: -1
|
||||
volume: 10
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
- location: outpostcrewcabinet
|
||||
probability: 0.01
|
||||
price: 450
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, false, false, true, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 6
|
||||
buffs: False
|
||||
|
||||
- identifier: shoegazeprincessa
|
||||
name: Шугейз-принцесса
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=j3NG8UScSiA
|
||||
start: 00:00:00
|
||||
end: -1
|
||||
volume: 0
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
- location: outpostcrewcabinet
|
||||
probability: 0.01
|
||||
price: 450
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, true, true, false, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 6
|
||||
buffs: False
|
||||
|
||||
- identifier: rusija
|
||||
name: УБИЙЦЫ - Россия
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=DJVb9yvI3Go
|
||||
start: 00:00:00
|
||||
end: -1
|
||||
volume: 0
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
- location: outpostcrewcabinet
|
||||
probability: 0.01
|
||||
price: 450
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, true, false, false, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 6
|
||||
buffs: False
|
||||
|
||||
- identifier: schritte_08080
|
||||
name: Inka - Schritte (08080 remix)
|
||||
source: ./source/original_audio/schritte_08080.ogg
|
||||
note: Anžiček remix
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
price: 1000
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, false, false, false, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 6
|
||||
buffs:
|
||||
- psychosis
|
||||
|
||||
- identifier: schritte
|
||||
name: Inka - Schritte
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=vkuqR6skYHg
|
||||
start: 00:00:00
|
||||
end: -1
|
||||
volume: 0
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
price: 500
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, true, false, false, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 6
|
||||
buffs: False
|
||||
|
||||
- identifier: wacky_tape
|
||||
name: Neznani Rock Fotri
|
||||
source: ./source/original_audio/wacky_tape.ogg
|
||||
note: Made by a broken cassette player
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
price: 200
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, false, false, false, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 1
|
||||
buffs: False
|
||||
|
||||
- identifier: 08080_minor_threat
|
||||
name: 08080 - Minor Threat
|
||||
source: ./source/original_audio/08080_minor_threat.ogg
|
||||
note: Original song by 08080
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.04
|
||||
- location: outpostcrewcabinet
|
||||
probability: 0.01
|
||||
price: 800
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, false, true, false, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 3
|
||||
buffs: False
|
||||
|
||||
- identifier: 08080_canyons_joyride
|
||||
name: 08080 - Canyon's Joyride
|
||||
source: ./source/original_audio/08080_canyons_joyride.ogg
|
||||
note: Original song by 08080
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.03
|
||||
- location: outpostcrewcabinet
|
||||
probability: 0.01
|
||||
price: 800
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, true, false, false, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 3
|
||||
buffs: False
|
||||
|
||||
- identifier: sigma
|
||||
name: ∑
|
||||
source:
|
||||
url: https://www.youtube.com/watch?v=1-emQo-7O3Y
|
||||
start: 00:00:00
|
||||
end: -1
|
||||
volume: 0
|
||||
note: ""
|
||||
spawn:
|
||||
- location: abandonedcrewcab
|
||||
probability: 0.05
|
||||
price: 200
|
||||
multipliers: [1, 1, 1, 1, 1] # outpost, city, research, military, mine
|
||||
sold: [false, false, false, true, false] # outpost, city, research, military, mine
|
||||
no_of_uses: 1
|
||||
buffs:
|
||||
- psychosis
|