示例#1
0
文件: scr.py 项目: murgesku/scird
 def __init__(self, script, name):
     super().__init__(script, name)
     self.end_star: int = 0
     self.angle: int = 0
     self.distance: MinMax[int] = MinMax(0, 0)
     self.relation: MinMax[int] = MinMax(0, 0)
     self.deviation: int = 0
     self.is_hole: bool = False
示例#2
0
 def restore(self, bp):
     self.end_star = int(bp.get_par("EndStar"))
     if self._script.version < 7:
         self.angle = int(bp.get_par("Angle"))
     self.distance = MinMax.from_str(bp.get_par("Distance"), int)
     if self._script.version < 7:
         self.relation = MinMax.from_str(bp.get_par("Relation"), int)
         self.deviation = int(bp.get_par("Deviation"))
     self.is_hole = str_to_bool(bp.get_par("IsHole"))
示例#3
0
 def load(self, s):
     self.end_star = s.get_int()
     if self._script.version < 7:
         self.angle = s.get_int()
     self.distance = MinMax(s.get_int(), s.get_int())
     if self._script.version < 7:
         self.relation = MinMax(s.get_int(), s.get_int())
         self.deviation = s.get_int()
     self.is_hole = s.get_bool()
示例#4
0
文件: scr.py 项目: murgesku/scird
 def restore(self, source):
     end_star = source.get_par("EndStar")
     start = end_star.find('(') + 1
     end = end_star.find(')')
     self.end_star = int(end_star[start:end])
     if self._script.version < 7:
         self.angle = int(source.get_par("Angle"))
     self.distance = MinMax.from_str(source.get_par("Distance"), int)
     if self._script.version < 7:
         self.relation = MinMax.from_str(source.get_par("Relation"), int)
         self.deviation = int(source.get_par("Deviation"))
     self.is_hole = str_to_bool(source.get_par("IsHole"))
示例#5
0
 def restore(self, bp):
     self.planet = bp.get_par("Planet")
     state = bp.get_par("State").split('(', 1)
     self.state = int(state[0].strip())
     self.owner = o_.from_str(bp.get_par("Owner"))
     self.type = t_.from_str(bp.get_par("Type"))
     self.count = MinMax.from_str(bp.get_par("Count"), int)
     self.speed = MinMax.from_str(bp.get_par("Speed"), int)
     self.weapon = w_.from_str(bp.get_par("Weapon"))
     self.cargohook = int(bp.get_par("CargoHook"))
     self.emptyspace = int(bp.get_par("EmptySpace"))
     if self._script.version < 7:
         self.friendship = f_.from_str(bp.get_par("Friendship"))
     self.add_player = str_to_bool(bp.get_par("AddPlayer"))
     if self._script.version < 7:
         self.rating = MinMax.from_str(bp.get_par("Rating"), int)
         self.score = MinMax.from_str(bp.get_par("Score"), int)
     status = bp.get_block("Status")
     self.status = Status(MinMax.from_str(status.get_par("Trader"), int),
                          MinMax.from_str(status.get_par("Warrior"), int),
                          MinMax.from_str(status.get_par("Pirate"), int))
     del status
     self.search_distance = int(bp.get_par("SearchDist"))
     self.dialog = bp.get_par("Dialog")
     self.strength = MinMax.from_str(bp.get_par("Strength"), float)
     self.ruins = bp.get_par("Ruins")
示例#6
0
 def restore(self, bp):
     self.race = r_.from_str(bp.get_par("Race"))
     self.owner = o_.from_str(bp.get_par("Owner"))
     self.economy = e_.from_str(bp.get_par("Economy"))
     self.government = g_.from_str(bp.get_par("Government"))
     self.range = MinMax.from_str(bp.get_par("Range"), int)
     self.dialog = bp.get_par("Dialog")
示例#7
0
 def load(self, s):
     self.race = r_(s.get_uint())
     self.owner = o_(s.get_uint())
     self.economy = e_(s.get_uint())
     self.government = g_(s.get_uint())
     self.range = MinMax(s.get_int(), s.get_int())
     self.dialog = s.get_widestr()
示例#8
0
 def restore(self, bp):
     self.begin = int(bp.get_par("Begin"))
     self.end = int(bp.get_par("End"))
     relations = bp.get_par("Relations").strip('()').split(',')
     self.relations = (rel_.from_str(relations[0].strip()),
                       rel_.from_str(relations[1].strip()))
     self.war_weight = MinMax.from_str(bp.get_par("WarWeight"), float)
示例#9
0
文件: scr.py 项目: murgesku/scird
 def __init__(self, script, name):
     super().__init__(script, name)
     self.race: Race = Race(0)
     self.owner: o_ = o_(0)
     self.economy: e_ = e_(0)
     self.government: g_ = g_(0)
     self.range: MinMax[int] = MinMax(0, 0)
     self.dialog: str = ""
示例#10
0
文件: scr.py 项目: murgesku/scird
 def __init__(self, script, name):
     super().__init__(script, name)
     self.count: int = 0
     self.owner: o_ = o_(0)
     self.type: t_ = t_(0)
     self.is_player: bool = False
     self.speed: MinMax[int] = MinMax(0, 0)
     self.weapon: w_ = w_(0)
     self.cargohook: int = 0
     self.emptyspace: int = 0
     self.rating: MinMax[int] = MinMax(0, 0)
     self.status: Status = Status(MinMax(0, 0),
                                  MinMax(0, 0),
                                  MinMax(0, 0),)
     self.score: MinMax[int] = MinMax(0, 0)
     self.strength: MinMax[float] = MinMax(0.0, 0.0)
     self.ruins: str = ""
示例#11
0
 def load(self, s):
     self.count = s.get_int()
     self.owner = o_(s.get_uint())
     self.type = t_(s.get_uint())
     self.is_player = s.get_bool()
     self.speed = MinMax(s.get_int(), s.get_int())
     self.weapon = w_(s.get_uint())
     self.cargohook = s.get_int()
     self.emptyspace = s.get_int()
     if self._script.version < 7:
         self.rating = MinMax(s.get_int(), s.get_int())
     self.status = Status(MinMax(s.get_int(), s.get_int()),
                          MinMax(s.get_int(), s.get_int()),
                          MinMax(s.get_int(), s.get_int()))
     if self._script.version < 7:
         self.score = MinMax(s.get_int(), s.get_int())
     self.strength = MinMax(s.get_single(), s.get_single())
     self.ruins = s.get_widestr()
示例#12
0
文件: scr.py 项目: murgesku/scird
 def __init__(self, script, name):
     super().__init__(script, name)
     self.planet: str = ""
     self.state: int = 0
     self.owner: o_ = o_(0)
     self.type: t_ = t_(0)
     self.count: MinMax[int] = MinMax(0, 0)
     self.speed: MinMax[int] = MinMax(0, 0)
     self.weapon: w_ = w_(0)
     self.cargohook: int = 0
     self.emptyspace: int = 0
     self.friendship: f_ = f_(0)
     self.add_player: bool = False
     self.rating: MinMax[int] = MinMax(0, 0)
     self.score: MinMax[int] = MinMax(0, 0)
     self.status: Status = Status(MinMax(0, 0),
                                  MinMax(0, 0),
                                  MinMax(0, 0), )
     self.search_distance: int = 0
     self.dialog: str = ""
     self.strength: MinMax[float] = MinMax(0.0, 0.0)
     self.ruins: str = ""
示例#13
0
 def load(self, s):
     self.planet = s.get_widestr()
     self.state = s.get_int()
     self.owner = o_(s.get_uint())
     self.type = t_(s.get_uint())
     self.count = MinMax(s.get_int(), s.get_int())
     self.speed = MinMax(s.get_int(), s.get_int())
     self.weapon = w_(s.get_uint())
     self.cargohook = s.get_int()
     self.emptyspace = s.get_int()
     if self._script.version < 7:
         self.friendship = f_(s.get_uint())
     self.add_player = s.get_bool()
     if self._script.version < 7:
         self.rating = MinMax(s.get_int(), s.get_int())
         self.score = MinMax(s.get_int(), s.get_int())
     self.status = Status(MinMax(s.get_int(), s.get_int()),
                          MinMax(s.get_int(), s.get_int()),
                          MinMax(s.get_int(), s.get_int()))
     self.search_distance = s.get_int()
     self.dialog = s.get_widestr()
     self.strength = MinMax(s.get_single(), s.get_single())
     self.ruins = s.get_widestr()
示例#14
0
 def restore(self, bp):
     self.count = int(bp.get_par("Count"))
     self.owner = o_.from_str(bp.get_par("Owner"))
     self.type = t_.from_str(bp.get_par("Type"))
     self.is_player = str_to_bool(bp.get_par("IsPlayer"))
     self.speed = MinMax.from_str(bp.get_par("Speed"), int)
     self.weapon = w_.from_str(bp.get_par("Weapon"))
     self.cargohook = int(bp.get_par("CargoHook"))
     self.emptyspace = int(bp.get_par("EmptySpace"))
     if self._script.version < 7:
         self.rating = MinMax.from_str(bp.get_par("Rating"), int)
     status = bp.get_block("Status")
     self.status = Status(MinMax.from_str(status.get_par("Trader"), int),
                          MinMax.from_str(status.get_par("Warrior"), int),
                          MinMax.from_str(status.get_par("Pirate"), int))
     del status
     if self._script.version < 7:
         self.score = MinMax.from_str(bp.get_par("Score"), int)
     self.strength = MinMax.from_str(bp.get_par("Strength"), float)
     self.ruins = bp.get_par("Ruins")
示例#15
0
 def load(self, s):
     self.begin = s.get_int()
     self.end = s.get_int()
     self.relations = (rel_(s.get_uint()), rel_(s.get_uint()))
     self.war_weight = MinMax(s.get_single(), s.get_single())
示例#16
0
文件: scr.py 项目: murgesku/scird
 def __init__(self, script, name):
     super().__init__(script, name)
     self.begin: int = 0
     self.end: int = 0
     self.relations: Tuple[rel_, rel_] = (rel_(0), rel_(0))
     self.war_weight: MinMax[float] = MinMax(0.0, 0.0)