| Conditions | 1 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 1 |
| CRAP Score | 1.6296 |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | # Honor calculator, based on char lvl owned by player. |
||
| 2 | 1 | def honor(jugador) |
|
|
|
|||
| 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 |