Skip to content

Commit

Permalink
[CodeFactor] Apply fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
code-factor committed Jul 1, 2018
1 parent 67e6f43 commit e01864b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions deathcause.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ def display_death_event(e)
def display_death_unit(u)
str = "The #{u.race_tg.name[0]}"
str << " #{u.name}" if u.name.has_name

if not u.flags2.killed and not u.flags3.ghostly
str << " is not dead yet !"

puts str.chomp(',')
else
death_info = u.counters.death_tg
killer = death_info.killer_tg if death_info

str << " died" if !u.flags2.slaughter
str << " was slaughtered" if u.flags2.slaughter

str << " in year #{death_info.event_year}" if death_info
str << " (cause: #{u.counters.death_cause.to_s.downcase})," if u.counters.death_cause != -1
str << " killed by the #{killer.race_tg.name[0]} #{killer.name}" if killer
Expand Down
2 changes: 1 addition & 1 deletion digfort.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
next if l == ''
tiles << l.split(/[;,]/).map { |t|
t = t.strip
(t[0] == ?") ? t[1..-2] : t
(t[0] == '"') ? t[1..-2] : t
}
}

Expand Down
6 changes: 3 additions & 3 deletions show-unit-syndromes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ def get_effect(logger, ce, ticks, showdisplayeffects)

when "CAN_DO_INTERACTION"
name = "Add interaction"
desc = "#{get_interaction(ce)}"
desc = (get_interaction(ce)).to_s
color = Output::GREEN
when "SKILL_ROLL_ADJUST"
name = "Skill check"
Expand Down Expand Up @@ -854,7 +854,7 @@ def get_effect(logger, ce, ticks, showdisplayeffects)
when "DISPLAY_NAME"
if !showdisplayeffects then return "", Output::DEFAULT end
name = "Set display name"
desc = "#{ce.name}"
desc = (ce.name).to_s
color = Output::DEFAULT
else
name = "Unknown"
Expand Down Expand Up @@ -940,7 +940,7 @@ def get_effect(logger, ce, ticks, showdisplayeffects)
if showrace
logger.log "#{df.world.raws.creatures.all[unit.race].name[0]}#{unit.name == '' ? "" : ": "}#{unit.name}", Output::HIGHLIGHT
else
logger.log "#{unit.name}", Output::HIGHLIGHT
logger.log (unit.name).to_s, Output::HIGHLIGHT
end
end

Expand Down

0 comments on commit e01864b

Please sign in to comment.