Added About us page, Changed some things with damage calculation, changed some things with links, Changed some HTML Code.

This commit is contained in:
IM23a-spirgif
2024-09-14 23:10:33 +02:00
parent 538187831b
commit b44ff431b2
6 changed files with 70 additions and 22 deletions
+9 -3
View File
@@ -17,15 +17,18 @@ def index():
def get_guns():
updated_guns = []
for gun in guns:
original_damage = gun['damage']
# Calculate RPS, DPS, DPM, avgDPS
rps = gun['rpm'] / 60
dps = gun['damage'] * rps
dps = original_damage * rps
reload_time_min = gun['reload_time'] / 60
dpm = (gun['mag_size'] * gun['damage']) / (reload_time_min + (gun['mag_size'] / gun['rpm']))
dpm = (gun['mag_size'] * original_damage) / (reload_time_min + (gun['mag_size'] / gun['rpm']))
avg_dps = dpm / 60
total_damage = original_damage * gun['damage_multiplier']
# Add calculated stats to the gun data
gun.update({
'total_damage': total_damage,
'rps': rps,
'dps': dps,
'dpm': dpm,
@@ -35,10 +38,12 @@ def get_guns():
return jsonify(updated_guns)
@app.route('/calculator')
def calculator():
return render_template('calculator.html')
@app.route('/about_us')
def about_us():
return render_template('about_us.html')
@@ -61,5 +66,6 @@ def average_dpm_calculation():
dpm = float(dpm_calculation())
return round(dpm / 60, 2)
if __name__ == '__main__':
app.run(debug=True)
app.run(debug=True)