1 | # Honor calculator, based on char lvl owned by player. |
||
2 | def honor(jugador) |
||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
3 | honor = 0 # Initialize by 0 |
||
4 | |||
5 | heros.each do |h| |
||
6 | # Increase honor for each player lvl |
||
7 | honor += h.nivel if h.jugador == jugador |
||
8 | # ONLY for MB players |
||
9 | unless ciudad?(jugador).empty? |
||
10 | # Increase honor for each MB player lvl/3 |
||
11 | honor += (h.nivel / 3).to_i if h.ciudad == ciudad?(jugador).first['name'] |
||
12 | end |
||
13 | end |
||
14 | |||
15 | honor |
||
16 | end |
||
17 |