Compare commits
3 Commits
a262088e00
...
8aab21eb59
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8aab21eb59 | ||
|
|
46eee731dc | ||
|
|
6855f87d02 |
|
|
@ -1 +1 @@
|
|||
{"authenticated":true,"discord_id":"277898241750859776","discord_name":"mrteels","db_id":2,"display_name":"DN","discord_avatar_url":"https://cdn.discordapp.com/avatars/277898241750859776/7c3446bb51fafd72b1b4c21124b4994f.png"}
|
||||
{"authenticated":true,"discord_id":"277898241750859776","discord_name":"mrteels","db_id":2,"display_name":"Verwirrter Klebschnüffler","discord_avatar_url":"https://cdn.discordapp.com/avatars/277898241750859776/7c3446bb51fafd72b1b4c21124b4994f.png"}
|
||||
|
|
@ -5,8 +5,8 @@ import os
|
|||
from wood import logger
|
||||
|
||||
|
||||
point_inflation = 0.7 # => entspricht %
|
||||
K_FACTOR = 30 # Die "Border" (Maximalpunkte) die ein Sieg gibt.
|
||||
point_inflation = 0.8 # => entspricht %
|
||||
K_FACTOR = 40 # Die "Border" (Maximalpunkte) die ein Sieg gibt.
|
||||
|
||||
# Mach die DB abfrage für die Relevanten Daten. Von hier aus werden die "Aufgaben" und Daten dann an die kleineren Berechnungs Funktionen verteilt.
|
||||
def calculate_match (match_id):
|
||||
|
|
@ -62,8 +62,8 @@ def calculate_match (match_id):
|
|||
l_base = int(base_change*point_inflation)
|
||||
l_khorne = int(calculation.wrath_of_khorne(looser_id, system_id))
|
||||
|
||||
slaanesh = int(calculation.slaanesh_delight())
|
||||
tzeentch = int(calculation.tzeentch_scemes(system_id, winner_score, looser_score))
|
||||
slaanesh = calculation.slaanesh_delight()
|
||||
tzeentch = calculation.tzeentch_schemes(system_id, winner_score, looser_score)
|
||||
|
||||
# ==========================================
|
||||
# 3. Daten Verpacken
|
||||
|
|
@ -93,9 +93,8 @@ def calculate_match (match_id):
|
|||
}
|
||||
}
|
||||
|
||||
logger.log("MATCH CALC", f"Match{match_id} berechnet.")
|
||||
logger.log("MATCH CALC", f"Winner {data_api.get_player_name(winner_id)}: Base {w_base} + Khorne {w_khorne} + Slaanesh {slaanesh} + Tzeentch {tzeentch}")
|
||||
logger.log("MATCH CALC", f"Looser {data_api.get_player_name(looser_id)}: Base {l_base} + Khorne {l_khorne} - Slaanesh {slaanesh} - Tzeentch {tzeentch}")
|
||||
logger.log(f"calc_match ID:{match_id}", f"Winner {data_api.get_player_name(winner_id)}: Base {w_base} + Khorne({w_khorne}) + Slaanesh({slaanesh}) + Tzeentch({tzeentch}) = {calc_results[winner_id]["total"]}")
|
||||
logger.log(f"calc_match ID:{match_id}", f"Looser {data_api.get_player_name(looser_id)}: -Base({l_base}) + Khorne({l_khorne}) - Slaanesh({slaanesh}) - Tzeentch({tzeentch}) = {calc_results[looser_id]["total"]}")
|
||||
data_api.save_calculated_match(calc_results)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -67,11 +67,15 @@ def wrath_of_khorne(player_id, system_id):
|
|||
def slaanesh_delight():
|
||||
return 0
|
||||
|
||||
def tzeentch_scemes(system_id, winner_score, looser_score):
|
||||
|
||||
def tzeentch_schemes(system_id, winner_score, looser_score):
|
||||
sys_data = data_api.get_gamesystem_data(system_id)
|
||||
min_score = sys_data["min_score"]
|
||||
max_score = sys_data["max_score"]
|
||||
|
||||
bonus = int(((max_score*(winner_score-looser_score)))/(max_score*1.1)) #Multiplikatiionsfaktor für die Berechnung.
|
||||
diff_normalized = (winner_score - looser_score) / max_score # 0.0 – 1.0
|
||||
threshold = 0.1 # Bonus startet erst ab 10% Vorsprung
|
||||
|
||||
return 0
|
||||
bonus = int(max(0, diff_normalized - threshold) * 10) # Ergibt 0–9
|
||||
bonus = min(bonus, 9) # Sicherheits-Cap
|
||||
|
||||
return bonus
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user