Loading

Paste #pykz1xpdb

  1.     def get_engine_cost_points(self):
  2.         # Up to 40 points for power. 1 point per 50hp
  3.         # Power is therefore capped at 2000hp by design, this isn't a hard limit, but raise a warning
  4.         if self.power > 2000:
  5.             utils.echo_message("Consist " + self.id + " has power > 2000hp, which is too much")
  6.         power_cost_points = self.power / 50
  7.  
  8.         # Up to 30 points for speed above up to 90mph. 1 point per 3mph
  9.         if self.speed > 90:
  10.             utils.echo_message("Consist " + self.id + " has speed > 90, which is too much")
  11.         speed_cost_points = min(self.speed, 90) / 3
  12.  
  13.         # Up to 20 points for intro date after 1870. 1 point per 8 years.
  14.         # Intro dates capped at 2030, this isn't a hard limit, but raise a warning
  15.         if self.intro_date > 2030:
  16.             utils.echo_message("Consist " + self.id + " has intro_date > 2030, which is too much")
  17.         date_cost_points = max((self.intro_date - 1870), 0) / 8
  18.  
  19.         return power_cost_points + speed_cost_points + date_cost_points
  20.  
  21.     @property
  22.     def buy_cost(self):
  23.         # type_base_buy_cost_points is an arbitrary adjustment that can be applied on a type-by-type basis,
  24.         return self.get_engine_cost_points() + self.type_base_buy_cost_points
  25.  
  26.     @property
  27.     def running_cost(self):
  28.         consist_capacity_points = min(self.total_capacities[1], 160)
  29.         # type_base_running_cost_points is an arbitrary adjustment that can be applied on a type-by-type basis,
  30.         return self.get_engine_cost_points() + consist_capacity_points + self.type_base_running_cost_points

Comments