Skip to content

Commit

Permalink
Merge pull request #665 from elanthia-online/staging
Browse files Browse the repository at this point in the history
push staging into master for Lich 5.10.2
  • Loading branch information
mrhoribu authored Sep 4, 2024
2 parents 6a3f17a + bc8e36b commit d8bc392
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 49 deletions.
4 changes: 2 additions & 2 deletions R4LGTK3.iss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
; to support the Lich scripting environment for Simutronics games

#define MyAppName "Ruby4Lich5"
#define MyAppVersion "5.10.1"
#define MyAppVersion "5.10.2"
#define RubyVersion "3.3.4"
#define MyAppPublisher "Elanthia-Online"
#define MyAppURL "https://github.com/elanthia-online/lich-5/"
Expand All @@ -12,7 +12,7 @@
[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId= {{edd9ccd7-33cb-4577-a470-fe8fd087eaed}
AppId= {{edd9ccd7-33cb-4577-a470-fe8fd087eaee}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} Ruby {#RubyVersion} & Lich {#MyAppVersion}
Expand Down
2 changes: 1 addition & 1 deletion lib/crit_tables/disruption_critical_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ module CritRanks
:slowed => false,
:wound_rank => 3,
:secondary_wound => nil,
:regex => /Spine ripped from .*?s's body and thrown to the ground./ } },
:regex => /Spine ripped from .*?'s body and thrown to the ground./ } },
:right_arm =>
{ 1 =>
{ :type => "Disruption",
Expand Down
12 changes: 6 additions & 6 deletions lib/crit_tables/grapple_critical_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ module CritRanks
:wound_rank => 3,
:secondary_wound => nil,
:regex =>
/.*?'s head is cracked as (?:it|she|he) is thrown to the ground./ },
/(?:.*?'s h|H)ead is cracked as (?:it|she|he is thrown|you throw .*?) to the ground./ },
8 =>
{ :type => "Grapple",
:location => "Head",
Expand Down Expand Up @@ -182,7 +182,7 @@ module CritRanks
:slowed => false,
:wound_rank => 3,
:secondary_wound => nil,
:regex => /Head crushed! Resulting death is... messy./ } },
:regex => /Head crushed! Resulting death is... messy./ } },
:neck =>
{ 1 =>
{ :type => "Grapple",
Expand Down Expand Up @@ -854,7 +854,7 @@ module CritRanks
:wound_rank => 2,
:secondary_wound => nil,
:regex =>
/.*? takes a hard fall from being, cracking (?:its|her|his) hip./ },
/.*? (?:takes a hard fall from being|thrown down hard), cracking (?:its|her|his) hip./ },
8 =>
{ :type => "Grapple",
:location => "Abdomen",
Expand Down Expand Up @@ -1626,7 +1626,7 @@ module CritRanks
:wound_rank => 1,
:secondary_wound => nil,
:regex =>
/.*?'s left leg is wrenched hard as it is thrown to the ground./ },
/(?:.*?'s l|L)eft leg is wrenched hard as (?:she|he|it|opponent) is thrown to the ground./ },
8 =>
{ :type => "Grapple",
:location => "Left leg",
Expand Down Expand Up @@ -1704,10 +1704,10 @@ module CritRanks
:wound_rank => 1,
:secondary_wound => nil,
:regex =>
/.*?'s right leg is wrenched hard as it is thrown to the ground./ },
/(?:.*?'s r|R)ight leg is wrenched hard as (?:she|he|it|opponent) is thrown to the ground./ },
8 =>
{ :type => "Grapple",
:location => "Left leg",
:location => "Right leg",
:rank => 8,
:damage => 40,
:position => "PRONE",
Expand Down
20 changes: 10 additions & 10 deletions lib/crit_tables/non_corporeal_critical_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ module CritRanks
:wound_rank => 0,
:secondary_wound => nil,
:regex =>
/.*?'s head wavers as your attack passes right through it./ },
/.*?'s head wavers as (?:your|the) attack passes right through it./ },
6 =>
{ :type => "Non-corporeal",
:location => "Head",
Expand Down Expand Up @@ -206,7 +206,7 @@ module CritRanks
:wound_rank => 0,
:secondary_wound => nil,
:regex =>
/Head disappears in the breeze as a new one forms on .*?'s shoulders./ } },
/Strong attack separates head from shoulders. Head disappears in the breeze as a new one forms on .*?'s shoulders./ } },
:neck =>
{ 0 =>
{ :type => "Non-corporeal",
Expand Down Expand Up @@ -266,7 +266,7 @@ module CritRanks
:slowed => false,
:wound_rank => 0,
:secondary_wound => nil,
:regex => /Ethereal fluids spray forth and quickly vanish into vapor./ },
:regex => /Flashy attack passes through the side of the neck. Ethereal fluids spray forth and quickly vanish into vapor./ },
3 =>
{ :type => "Non-corporeal",
:location => "Neck",
Expand All @@ -285,7 +285,7 @@ module CritRanks
:slowed => false,
:wound_rank => 0,
:secondary_wound => nil,
:regex => /Smoky tendrils rise from neck as your attack sweeps through./ },
:regex => /Smoky tendrils rise from neck as (?:your|the) attack sweeps through./ },
4 =>
{ :type => "Non-corporeal",
:location => "Neck",
Expand Down Expand Up @@ -325,7 +325,7 @@ module CritRanks
:wound_rank => 0,
:secondary_wound => nil,
:regex =>
/To your horror, .*?'s substance flows around the wound without leaving a trace./ },
/Strong attack rips through the neck! To your horror, .*?'s substance flows around the wound without leaving a trace./ },
6 =>
{ :type => "Non-corporeal",
:rank => 6,
Expand Down Expand Up @@ -384,7 +384,7 @@ module CritRanks
:wound_rank => 0,
:secondary_wound => nil,
:regex =>
/The head floats up and settles back in place as easily as a hat./ },
/Brutal blow to the neck sends head flying. The head floats up and settles back in place as easily as a hat. What is this, a haberdashery./ },
9 =>
{ :type => "Non-corporeal",
:location => "Neck",
Expand All @@ -403,7 +403,7 @@ module CritRanks
:slowed => false,
:wound_rank => 0,
:secondary_wound => nil,
:regex => /Vapor rushes from the neck following the blow./ } },
:regex => /Tremendous strike. Vapor rushes from the neck following the blow./ } },
:right_eye =>
{ 0 =>
{ :type => "Non-corporeal",
Expand Down Expand Up @@ -1449,7 +1449,7 @@ module CritRanks
:wound_rank => 0,
:secondary_wound => nil,
:regex =>
/Right shoulder is ripped from (?:its|her|his) socket, then wriggles back into place./ },
/Good hit. Right shoulder is ripped from (?:its|her|his) socket, then wriggles back into place./ },
7 =>
{ :type => "Non-corporeal",
:location => "Right arm",
Expand Down Expand Up @@ -1625,7 +1625,7 @@ module CritRanks
:wound_rank => 0,
:secondary_wound => nil,
:regex =>
/Left shoulder is ripped from (?:its|her|his) socket, then wriggles back into place./ },
/Good hit. Left shoulder is ripped from (?:its|her|his) socket, then wriggles back into place./ },
6 =>
{ :type => "Non-corporeal",
:location => "Left arm",
Expand Down Expand Up @@ -2246,7 +2246,7 @@ module CritRanks
:slowed => false,
:wound_rank => 0,
:secondary_wound => nil,
:regex => /A fine strike pins the left leg for an instant./ },
:regex => /A fine strike (?:pins|immobilizes) the left leg for an instant./ },
5 =>
{ :type => "Non-corporeal",
:location => "Left leg",
Expand Down
2 changes: 1 addition & 1 deletion lib/crit_tables/slash_critical_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ module CritRanks
:slowed => false,
:wound_rank => 1,
:secondary_wound => nil,
:regex => /Feint to the left goes astray as .*? dodges./ },
:regex => /Feint to the left (?:goes astray )?as .*? dodges(?: that way)?./ },
3 =>
{ :type => "Slash",
:location => "Back",
Expand Down
2 changes: 1 addition & 1 deletion lib/effects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def self.display
circle = Spell[sn].circlename
end
effect_out.add_row [sn, title, stext, duration]
existing_spell_nums.delete_if { |s| Spell[s].name =~ /#{stext}/ || stext =~ /#{Spell[s].name}/ || s == sn }
existing_spell_nums.delete_if { |s| Spell[s].name =~ /#{Regexp.escape(stext)}/ || stext =~ /#{Regexp.escape(Spell[s].name)}/ || s == sn }
}
end
effect_out.add_separator unless title == 'Debuffs' && existing_spell_nums.empty?
Expand Down
39 changes: 14 additions & 25 deletions lib/games.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,37 +49,26 @@ def self.clean_dr_serverstring(server_string)

## Fix combat wrapping components - Why, DR, Why?
server_string = server_string.gsub("<pushStream id=\"combat\" /><component id=", "<component id=")
# server_string = server_string.gsub("<pushStream id=\"combat\" /><prompt ","<prompt ")

# Fixes xml with \r\n in the middle of it like:
# We close the first line and in the next segment, we remove the trailing bits
# <component id='room objs'> You also see a granite altar with several candles and a water jug on it, and a granite font.\r\n
# <component id='room extra'>Placed around the interior, you see: some furniture and other bits of interest.\r\n
# <component id='room exits'>Obvious paths: clockwise, widdershins.\r\n

# Followed by in a closing line such as one of these:
# </component>\r\n
# <compass></compass></component>\r\n
# We close the first line and in the next segment, we remove the trailing bits
# Because we can only match line by line, this couldn't be fixed in one matching block...
if server_string == "<component id='room exits'>Obvious paths: clockwise, widdershins.\r\n"
Lich.log "Unclosed component tag detected: #{server_string.inspect}"
server_string = "<component id='room exits'>Obvious paths: <d>clockwise</d>, <d>widdershins</d>.<compass></compass></component>"
Lich.log "Unclosed component tag fixed to: #{server_string.inspect}"
# retry
end
# This is an actual DR line "<compass></compass></component>\r\n" which happens when the above is sent... subbing it out since we fix the tag above.
if server_string == "<compass></compass></component>\r\n"
Lich.log "Extraneous closed tag detected: #{server_string.inspect}"
server_string = ""
Lich.log "Extraneous closed tag fixed: #{server_string.inspect}"
end

# "<component id='room objs'> You also see a granite altar with several candles and a water jug on it, and a granite font.\r\n"
# "<component id='room extra'>Placed around the interior, you see: some furniture and other bits of interest.\r\n
# Followed by in a new line.
# "</component>\r\n"
if server_string =~ /^<component id='room (?:objs|extra)'>[^<]*(?!<\/component>)\r\n/
Lich.log "Open-ended room objects component id tag: #{server_string.inspect}"
server_string.gsub!("\r\n", "</component>")
Lich.log "Open-ended room objects component id tag fixed to: #{server_string.inspect}"
# If the pattern is on the left of the =~ the named capture gets assigned as a variable
if /^<(?<xmltag>dynaStream|component) id='.*'>[^<]*(?!<\/\k<xmltag>>)\r\n$/ =~ server_string
Lich.log "Open-ended #{xmltag} tag: #{server_string.inspect}"
server_string.gsub!("\r\n", "</#{xmltag}>")
Lich.log "Open-ended #{xmltag} tag tag fixed to: #{server_string.inspect}"
end
# "</component>\r\n"
if server_string == "</component>\r\n"

# Remove the now dangling closing tag
if server_string =~ /^(?:(\"|<compass><\/compass>))?<\/(dynaStream|component)>\r\n/
Lich.log "Extraneous closing tag detected and deleted: #{server_string.inspect}"
server_string = ""
end
Expand Down
5 changes: 3 additions & 2 deletions lib/psms/ascension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def self.ascension_lookups
{ long_name: 'two_handed_weapons', short_name: 'twohandedweapon', cost: 0 },
{ long_name: 'unbalance_resistance', short_name: 'resistunbalance', cost: 0 },
{ long_name: 'vacuum_resistance', short_name: 'resistvacuum', cost: 0 },
{ long_name: 'wisdom', short_name: 'wisdom', cost: 0 }]
{ long_name: 'wisdom', short_name: 'wisdom', cost: 0 },
{ long_name: 'transcend_destiny', short_name: 'trandest', cost: 0 }]
end

def Ascension.[](name)
Expand All @@ -94,7 +95,7 @@ def Ascension.affordable?(name)
def Ascension.available?(name)
Ascension.known?(name) and Ascension.affordable?(name) and !Lich::Util.normalize_lookup('Cooldowns', name) and !Lich::Util.normalize_lookup('Debuffs', 'Overexerted')
end

Ascension.ascension_lookups.each { |ascension|
self.define_singleton_method(ascension[:short_name]) do
Ascension[ascension[:short_name]]
Expand Down
2 changes: 1 addition & 1 deletion lib/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Lich5 carveout to better manage semver

LICH_VERSION = '5.10.1'
LICH_VERSION = '5.10.2'
REQUIRED_RUBY = '2.6'
RECOMMENDED_RUBY = '3.2'

0 comments on commit d8bc392

Please sign in to comment.