Skip to content

Instantly share code, notes, and snippets.

@maxice8
maxice8 / mkicon.fish
Created January 26, 2023 19:18
find directories recursively holding icons
#!/usr/bin/env fish
if not set -q argv[1]
echo "point to a directory" >&2
exit 1
end
for file in $argv[1] $argv[1]/**
[ -d $file ] || continue
for f in $file/*
test -f $f; and string match -q "*.dds" $f
@maxice8
maxice8 / mkicon.fish
Created January 26, 2023 19:14
find directories recursively holding icons
#!/usr/bin/env fish
if not set -q argv[1]
echo "point to a directory" >&2
exit 1
end
for file in $argv[1]/**
[ -d $file ] || continue
for f in $file/*
test -f $f; and string match -q "*.dds" $f
@maxice8
maxice8 / fish-find-mission-icon-dirs.fish
Created January 26, 2023 19:05
find directories holding mission icons
for file in gfx/interface/missions/**
[ -d $file ] || continue
for f in $file/*
test -f $f
end || continue
echo $file
end
@maxice8
maxice8 / search-and-replace-grant-all-mana.txt
Created January 7, 2023 21:58
Regex to replace all occurrences of add_(adm|dip|mil)_power with grant_all_mana
Search:
^(\s*)add_(adm|dip|mil)_power\s*=\s*([0-9]+).*
\s*add_(adm|dip|mil)_power\s*=\s*[0-9]+.*
\s*add_(adm|dip|mil)_power\s*=\s*[0-9]+.*
Replace:
$1grant_all_mana = {
$1\tmana = $3
@maxice8
maxice8 / ante-bellum-replace.txt
Created January 6, 2023 07:52
Regex to replace all occurrences of change_(adm|dip|mil) with add_monarch_points_or_power
# Search:
^(\s*)change_(adm|dip|mil)\s*=\s*([0-9-]*)
# Replace:
$1change_monarch_points_or_power = {
$1\tpoints = $3
$1\tpower = $2
$1}
@maxice8
maxice8 / -
Created January 4, 2023 04:36
Regex to replace all occurrences of add_accepted_culture from Ante Bellum part 2
^(\s*)if\s*=\s*\{
\s*limit\s*=\s*\{
\s*NOT\s*=\s*\{\s*accepted_culture\s*=\s*([A-Za-z_]*)\s*\}
\s*\}
\s*add_accepted_culture\s*=\s*[A-Za-z_]*
\s*\}
@maxice8
maxice8 / -
Created January 3, 2023 17:42
Regex to replace all occurrences of add_accepted_culture from Ante Bellum
(\s*)if\s*=\s*\{
\s*limit\s*=\s*\{
\s*NOT\s*=\s*\{\s*accepted_culture\s*=\s*([A-Za-z_]*)\s*\}
\s*\}
\s*add_accepted_culture\s*=\s*[A-Za-z_]*
\s*\}
\s*else\s*=\s*\{
\s*add_dip_power\s*=\s*[0-9]*
\s*\}
diff --git a/common/government_reforms/02_government_reforms_republics.txt b/common/government_reforms/02_government_reforms_republics.txt
index 6261e32..4c309f6 100644
--- a/common/government_reforms/02_government_reforms_republics.txt
+++ b/common/government_reforms/02_government_reforms_republics.txt
@@ -13,6 +13,7 @@ republic_mechanic = {
modifiers = {
burghers_influence_modifier = 0.15
vaisyas_influence_modifier = 0.15
+ max_absolutism = -40
}
diff --git a/common/government_reforms/02_government_reforms_republics.txt b/common/government_reforms/02_government_reforms_republics.txt
index 6261e32..4c309f6 100644
--- a/common/government_reforms/02_government_reforms_republics.txt
+++ b/common/government_reforms/02_government_reforms_republics.txt
@@ -13,6 +13,7 @@ republic_mechanic = {
modifiers = {
burghers_influence_modifier = 0.15
vaisyas_influence_modifier = 0.15
+ max_absolutism = -40
}
#!/usr/bin/env rc
# Assume all packages given are already installed
if(test $#* -lt 2) exit 1
module=$1
shift
for(pkg in $*) {
# Get all go binaries by checking for 'Go BuildID='
for(bin in `{apk info -q -L $pkg \
| grep -v '^usr/share' \