Skip to content

Commit

Permalink
Merge pull request #176 from obsidian-level-maker/v21
Browse files Browse the repository at this point in the history
V21
  • Loading branch information
GTD-Carthage authored Aug 16, 2024
2 parents 0c06670 + 161e9d8 commit c685e67
Show file tree
Hide file tree
Showing 8 changed files with 2,862 additions and 3,728 deletions.
5,785 changes: 2,358 additions & 3,427 deletions language/TEMPLATE_Obsidian.po

Large diffs are not rendered by default.

344 changes: 82 additions & 262 deletions language/ru.po

Large diffs are not rendered by default.

26 changes: 23 additions & 3 deletions language/update_localization.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
#!/bin/bash

# Updates the "<localization>.po".

PACKAGEERR=""

function check_if_installed {
if ! which $1 > /dev/null; then
[ -z "$2" ] && PACKAGENAME="$1" || PACKAGENAME="$2"
echo "check_if_installed(): Cannot find the \"$1\" program (from the package \"$2\")."
PACKAGEERR="true"
fi
}

check_if_installed sed
check_if_installed date coreutils
check_if_installed msgcat gettext
check_if_installed msguniq gettext

[ -n "$PACKAGEERR" ] && echo && exit 2


[ -z "$1" ] && echo "Usage: $0 <file.po>" && exit 1

if [ -f "$1" ]; then
Expand All @@ -17,10 +37,10 @@ set -e
TEMPLATEFILE="TEMPLATE_Obsidian.po"

echo Updating $LOCZFILE with $TEMPLATEFILE...
msgcat $LOCZFILE $TEMPLATEFILE -o $LOCZFILE.new --use-first --no-wrap
msguniq --no-wrap --use-first $LOCZFILE.new -o $LOCZFILE
msgcat --use-first --no-wrap -o $LOCZFILE.new $LOCZFILE $TEMPLATEFILE
msguniq --use-first --no-wrap -o $LOCZFILE $LOCZFILE.new

sed -i "s=\"PO-Revision-Date:\s=\"PO-Revision-Date: $(date +'%Y-%m-%d %H:%M%z')\\n\"=1" $LOCZFILE
sed -i "0,/PO-Revision-Date/{s=\"PO-Revision-Date:\s.\+=\"PO-Revision-Date: $(date +'%Y-%m-%d %H:%M%z')\\\\n\"=1}" $LOCZFILE
rm $LOCZFILE.new

echo Done!
26 changes: 25 additions & 1 deletion language/update_template.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
#!/bin/bash

# The script collects all of the translatable strings.
# Must be launched from the OBSIDIAN "/language" directory.

PACKAGEERR=""

function check_if_installed {
if ! which $1 > /dev/null; then
[ -z "$2" ] && PACKAGENAME="$1" || PACKAGENAME="$2"
echo "check_if_installed(): Cannot find the \"$1\" program (from the package \"$2\")."
PACKAGEERR="true"
fi
}

check_if_installed sed
check_if_installed date coreutils
check_if_installed msgcat gettext
check_if_installed msguniq gettext

[ -n "$PACKAGEERR" ] && echo && exit 2


LOCALIZATIONDIR="language"
TEMPLATEFILENAME="TEMPLATE_Obsidian.po"

Expand All @@ -27,7 +47,7 @@ echo Removing unnecessary internal lines...
grep -n -B1 -A2 "\s\.\.\s" $INTERMEDFILE | sed -n 's/^\([0-9]\{1,\}\).*/\1d/p' | sed -f - $INTERMEDFILE -i

echo Removing duplicates...
cat $INTERMEDFILE | msguniq --no-wrap --use-first - -o "$INTERMEDFILE"
cat $INTERMEDFILE | msguniq --no-wrap --use-first --unique - -o "$INTERMEDFILE"

echo Writing to the $TEMPLATEFILENAME...
cat <<EOT > $RESULTFILE
Expand All @@ -54,6 +74,10 @@ msgstr ""
# grep -n -r -o "[_][(]\".*\"[)]" | sed -r {s/"^"/"#: "/} | sed -r {s/":_"/"\n"/} | sed -r {s/"\("/"msgid "/} | sed -r {s/"\)$"/"\nmsgstr \"\"\n"/} | sed -r {s/":$"/""/} #
# msguniq --no-wrap --use-first --escape <result file from above commands> -o <target PO file> (may need to use dos2unix depending on platform) #
# ################################################################################################################################################################################################## #
# The file was auto-generated by $0.
# [END OF THE PREFIX SECTION]
EOT

cat $INTERMEDFILE >> $RESULTFILE
Expand Down
220 changes: 220 additions & 0 deletions modules/ctl_doom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,226 @@ OB_MODULES["doom_mon_control"] =
},
}

CTL_DOOM.ID24_MONSTERS =
{
id24_ghoul =
{
id = 3007,
r = 16,
h = 40,
level = 1,
prob = 140,
health = 50,
damage = 3,
attack = "missile",
density = 1.0,
room_size = "any"
},
id24_banshee =
{
id = 3008,
r = 20,
h = 56,
level = 1,
prob = 140,
health = 100,
damage = 128,
attack = "melee",
density = 1.0,
room_size = "any"
},
id24_mindweaver =
{
id = 3009,
r = 64,
h = 64,
level = 1,
prob = 140,
health = 500,
damage = 5.5,
attack = "hitscan",
density = 1.0,
room_size = "any"
},
id24_shocktrooper =
{
id = 3010,
r = 20,
h = 56,
level = 1,
prob = 140,
health = 100,
damage = 10.7,
attack = "missile",
density = 1.0,
room_size = "any"
},
id24_vassago =
{
id = 3011,
r = 24,
h = 64,
level = 1,
prob = 140,
boss_type = "minor",
boss_prob = 50,
health = 1000,
damage = 25,
attack = "missile",
density = 1.0,
room_size = "any"
},
id24_tyrant =
{
id = 3012,
r = 40,
h = 110,
level = 1,
prob = 140,
boss_type = "minor",
boss_prob = 50,
health = 1000,
damage = 125,
attack = "missile",
density = 1.0,
room_size = "any"
},
}

function CTL_DOOM.id24_monster_setup(self)

module_param_up(self)

table.merge_missing(GAME.MONSTERS, CTL_DOOM.ID24_MONSTERS)

for _,opt in pairs(self.options) do

local M = GAME.MONSTERS[string.sub(opt.name, 7)]

if M and PARAM[opt.name] ~= gui.gettext("Default") then
M.prob = PARAM[opt.name] * 100
M.density = M.prob * .006 + .1

-- allow Spectres to be controlled individually
M.replaces = nil

-- loosen some of the normal restrictions
M.skip_prob = nil
M.crazy_prob = nil

if M.prob > 40 then
M.level = 1
M.weap_min_damage = nil
end

if M.prob > 200 then
M.boss_type = nil
end
end
end

end

OB_MODULES["doom_mon_control_id24"] =
{

name = "doom_mon_control_id24",

label = _("ID24 Monster Control"),

game = "doomish",
engine = "idtech_1",
port = "!limit_enforcing",
port2 = "!edge",
where = "experimental",

hooks =
{
setup = CTL_DOOM.id24_monster_setup
},

options =
{
{
name = "float_id24_ghoul",
label = _("Ghoul"),
valuator = "slider",
min = 0,
max = 20,
increment = .02,
default = _("Default"),
nan = _("Default"),
tooltip = _("Control the amount of Ghouls."),
presets = _("0:0 (None at all),.02:0.02 (Scarce),.14:0.14 (Less),.5:0.5 (Plenty),1.2:1.2 (More),3:3 (Heaps),20:20 (INSANE)"),
randomize_group="monsters",
},
{
name = "float_id24_banshee",
label = _("Banshee"),
valuator = "slider",
min = 0,
max = 20,
increment = .02,
default = _("Default"),
nan = _("Default"),
tooltip = _("Control the amount of Banshees."),
presets = _("0:0 (None at all),.02:0.02 (Scarce),.14:0.14 (Less),.5:0.5 (Plenty),1.2:1.2 (More),3:3 (Heaps),20:20 (INSANE)"),
randomize_group="monsters",
},
{
name = "float_id24_mindweaver",
label = _("Mindweaver"),
valuator = "slider",
min = 0,
max = 20,
increment = .02,
default = _("Default"),
nan = _("Default"),
tooltip = _("Control the amount of Mindweavers."),
presets = _("0:0 (None at all),.02:0.02 (Scarce),.14:0.14 (Less),.5:0.5 (Plenty),1.2:1.2 (More),3:3 (Heaps),20:20 (INSANE)"),
randomize_group="monsters",
},
{
name = "float_id24_shocktrooper",
label = _("Shocktrooper"),
valuator = "slider",
min = 0,
max = 20,
increment = .02,
default = _("Default"),
nan = _("Default"),
tooltip = _("Control the amount of Shocktroopers."),
presets = _("0:0 (None at all),.02:0.02 (Scarce),.14:0.14 (Less),.5:0.5 (Plenty),1.2:1.2 (More),3:3 (Heaps),20:20 (INSANE)"),
randomize_group="monsters",
},
{
name = "float_id24_vassago",
label = _("Vassago"),
valuator = "slider",
min = 0,
max = 20,
increment = .02,
default = _("Default"),
nan = _("Default"),
tooltip = _("Control the amount of Vassago."),
presets = _("0:0 (None at all),.02:0.02 (Scarce),.14:0.14 (Less),.5:0.5 (Plenty),1.2:1.2 (More),3:3 (Heaps),20:20 (INSANE)"),
randomize_group="monsters",
},
{
name = "float_id24_tyrant",
label = _("Tyrant"),
valuator = "slider",
min = 0,
max = 20,
increment = .02,
default = _("Default"),
nan = _("Default"),
tooltip = _("Control the amount of Tyrants."),
presets = _("0:0 (None at all),.02:0.02 (Scarce),.14:0.14 (Less),.5:0.5 (Plenty),1.2:1.2 (More),3:3 (Heaps),20:20 (INSANE)"),
randomize_group="monsters",
},
},
}

----------------------------------------------------------------

Expand Down
6 changes: 2 additions & 4 deletions modules/miscellaneous.lua
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,8 @@ function MISC_STUFF.setup(self)
module_param_up(self)

--Brightness sliders
--if not gui.check_simple_mode() then
PARAM["wad_minimum_brightness"] = math.min(PARAM.float_minimum_brightness, PARAM.float_maximum_brightness)
PARAM["wad_maximum_brightness"] = math.max(PARAM.float_minimum_brightness, PARAM.float_maximum_brightness)
--end
PARAM["wad_minimum_brightness"] = math.min(PARAM.float_minimum_brightness, PARAM.float_maximum_brightness)
PARAM["wad_maximum_brightness"] = math.max(PARAM.float_minimum_brightness, PARAM.float_maximum_brightness)
end

function MISC_STUFF.begin_level(self, LEVEL)
Expand Down
Loading

0 comments on commit c685e67

Please sign in to comment.