Conditions | 1 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | # frozen_string_literal: true |
||
4 | def honor(jugador) |
||
5 | honor = 0 # Initialize by 0 |
||
6 | |||
7 | heros.each do |h| |
||
8 | # Increase honor for each player lvl |
||
9 | honor += h.nivel if h.jugador == jugador |
||
10 | # ONLY for MB players |
||
11 | unless ciudad?(jugador).empty? |
||
12 | # Increase honor for each MB player lvl/3 |
||
13 | honor += (h.nivel / 3).to_i if h.ciudad == ciudad?(jugador).first['name'] |
||
14 | end |
||
15 | end |
||
16 | |||
17 | honor |
||
18 | end |
||
19 |