Example #1
0
 def start(self):
     if self.clear:
         self.clean_the_map()
     else:
         element_sprite = load_sprite_mainsheet("otherbalde01")
         element_sprite2 = load_sprite_mainsheet("otherbalde02")
         element_sprite4 = load_sprite_mainsheet("otherpets01")
         element_sprite3 = load_sprite_mainsheet("othervaso01")
         
         element = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (680,190))
         element2 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (630,170))
         element3 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite3, position = (496,144))
         element4 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (400,200))
         element5 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (680,300))
         element6 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite3, position = (720,144))
         
         element.drop = [generateItem("item02")]
         element2.drop = [generateItem("item01")]
         
         self.stage.add_element(element)
         self.stage.add_element(element2)
         self.stage.add_element(element3)
         self.stage.add_element(element4)
         self.stage.add_element(element5)
         self.stage.add_element(element6)
Example #2
0
 def reward(self):
     reward = [generateItem("item01"),generateItem("item01"),generateItem("item02"),generateItem("item02")]
     #drops = []
     drop_sprite = load_sprite_mainsheet("icon01")
     for item_rw in reward:
         self.stage.add_element(ElementBuilder(type = "DropedBag", stage = self.stage, sprite = drop_sprite, position = (640 + randint(-64, 64), 450 + randint(-64, 64)), item = item_rw))
     self.stage.playback()
Example #3
0
 def start(self):
     if self.clear:
         self.clean_the_map()
     else:
         element_sprite = load_sprite_mainsheet("othervaso01")
         element = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (528,272))
         self.stage.add_element(element)
Example #4
0
    def process(self, time_passed):
        if self.last_use < self.delay:
            return
        self.last_use = 0
        self.entity.acting = "attack"
        #self.entity.last_attack = 0

        beg, end, cost, sound = self.entity.equip_set.weapon.use(
            self.entity.rect.center, self.entity.last_direction)
        if cost > self.entity.mana:
            self.entity.to_talk(10, [u"Não tenho energia suficiente!!"])
            return
        else:
            self.entity.mana -= cost
            #                                                             stage, ent_name, sprite1, position, destination, aspd, atq_damage = 0, magic_damage = 0, sound = None
            attack_effect = ElementBuilder(
                type="AttackEffect",
                stage=self.entity.stage,
                ent_name=self.entity.name,
                sprite=self.entity.equip_set.weapon.sprite,
                position=beg,
                destination=end,
                movspeed=self.entity.equip_set.weapon.bullet_speed,
                atq_damage=self.entity.ad,
                magic_damage=0,
                cost=cost,
                sound=sound,
                direction=self.entity.last_direction)
            #attack_effect = Attack_Effect(self.entity.stage, self.entity.name, self.entity.equip_set.weapon.sprite, beg, end, self.entity.equip_set.weapon.aspd, self.entity.ad, self.entity.ap, sound)

            self.entity.stage.add_element(attack_effect)
Example #5
0
 def pre_reward(self):
     reward = [generateItem("item01"),generateItem("item01"),generateItem("item01"),generateItem("item02"),generateItem("item02"),generateItem("item02"),
               generateItem("item01"),generateItem("item01"),generateItem("item02")
               ]
     
     drop_sprite = load_sprite_mainsheet("icon01")
     for item_rw in reward:
         self.stage.add_element(ElementBuilder(type = "DropedBag", stage = self.stage, sprite = drop_sprite, position = (1432 + randint(-32, 32), 1100 + randint(-32, 32)), item = item_rw))
Example #6
0
 def clean_the_map(self):
     #print "MAPA LIMPO - PORTAL ADICIONADO"
     for element_id in self.stage.config.portals:
         cfgportal = getPortal(element_id)
         sprite = load_sprite_mainsheet(cfgportal.sprite)
         element = ElementBuilder(type = "Portal", stage = self.stage, sprite = sprite, config = cfgportal)
         self.stage.add_element(element)
         self.clear = True
Example #7
0
 def start(self):
     if self.clear:
         self.clean_the_map()
     else:
         element_sprite = load_sprite_mainsheet("otherbalde01")
         element_sprite3 = load_sprite_mainsheet("otherprato01")
         element_sprite4 = load_sprite_mainsheet("otherpets01")
         
         focos = []
         
         focos.append(ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (1500,350)))
         focos.append(ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (1530 + randint(-100, 100),650 + randint(-100, 100))))
         focos.append(ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite3, position = (1230,770)))
         focos.append(ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (1030 + randint(-100, 100),470 + randint(-100, 100))))
         
         focos[0].drop  = [generateItem("item01"),generateItem("item02")]
         for f in focos:
             self.stage.add_element(f)
         
         self.stage.focos_total = len(focos)
Example #8
0
 def process(self, time_passed):
     if self.last_use < self.delay:
         return
     self.last_use = 0
     repel_rect = pygame.Rect((0, 0), (25, 25))
     repel_rect.center = (self.entity.rect.center) + (
         self.entity.last_direction * 15)
     repel_box = ElementBuilder(type="RepelBox",
                                stage=self.entity.stage,
                                rect=repel_rect,
                                speed=self.entity.speed,
                                direction=self.entity.last_direction)
     self.entity.stage.add_element(repel_box)
Example #9
0
 def process(self, time_passed):
     if self.last_use < self.delay:
         return
     self.last_use = 0
     self.entity.acting = "interact"
     interact_rect = pygame.Rect((0, 0), (20, 20))
     interact_rect.center = (self.entity.rect.center) + (
         self.entity.last_direction * 28)
     interactive_box = ElementBuilder(type="InteractiveBox",
                                      entity=self.entity,
                                      sprite=self.sprite,
                                      rect=interact_rect)
     self.entity.stage.add_element(interactive_box)
Example #10
0
 def start(self):
     if self.clear:
         self.clean_the_map()
     else:
         element_sprite = load_sprite_mainsheet("otherpets01")
         element_sprite2 = load_sprite_mainsheet("otherlixeira01")
         element = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (1168,816))
         element2 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (1424,816))
         element3 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (1200 + randint(-100, 100),700 + randint(-100, 100)))
         element4 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (1400 + randint(-100, 100),700 + randint(-100, 100)))
         element5 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (1488,120))
         
         element.drop = [generateItem("item01")]
         element2.drop = [generateItem("item02")]
         
         self.stage.add_element(element)
         self.stage.add_element(element2)
         self.stage.add_element(element3)
         self.stage.add_element(element4)
         self.stage.add_element(element5)
Example #11
0
 def start(self):
     if self.clear:
         self.clean_the_map()
     else:
         element_sprite2 = load_sprite_mainsheet("otherbalde02")
         element_sprite4 = load_sprite_mainsheet("otherpets01")
         element_sprite3 = load_sprite_mainsheet("othervaso02")
         element = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (1600,755))
         element2 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (1200 + randint(-100, 100),200 + randint(-100, 100)))
         element3 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (1350 + randint(-100, 100),225 + randint(-100, 100)))
         element4 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (1400 + randint(-100, 100),200 + randint(-100, 100)))
         element5 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite3, position = (848,752))
         
         element2.drop = [generateItem("item02")]
         element3.drop = [generateItem("item01")]
         
         self.stage.add_element(element)
         self.stage.add_element(element2)
         self.stage.add_element(element3)
         self.stage.add_element(element4)
         self.stage.add_element(element5)
Example #12
0
 def start(self):
     if self.clear:
         self.clean_the_map()
     else:
         element_sprite = load_sprite_mainsheet("otherbalde01")
         element_sprite4 = load_sprite_mainsheet("otherprato01")
         element = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (700,380))
         element2 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (368,570))
         element3 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (368,600))
         element4 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (660,624))
         
         element.drop = [generateItem("item02")]
         element2.drop = [generateItem("item01")]
         
         self.stage.add_element(element)
         self.stage.add_element(element2)
         self.stage.add_element(element3)
         self.stage.add_element(element4)
Example #13
0
 def start(self):
     if self.clear:
         self.clean_the_map()
     else:
         self.stage.playback(self.stage_song)
         element_sprite4 = load_sprite_mainsheet("otherpets01")
         element_sprite5 = load_sprite_mainsheet("othercaixadagua01")
         element_sprite6 = load_sprite_mainsheet("otherbarril01")
         element = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite6, position = (496,720))
         element2 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite6, position = (528,720))
         element3 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite6, position = (560,720))
         element4 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (512,576))
         element5 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (584,576))
         element6 = ElementBuilder(type = "SuperFoco", stage = self.stage, sprite = element_sprite5, position = (670,700))
         
         
         element.drop = [generateItem("item01"),generateItem("item02")]
         
         self.stage.add_element(element)
         self.stage.add_element(element2)
         self.stage.add_element(element3)
         self.stage.add_element(element4)
         self.stage.add_element(element5)
         self.stage.add_element(element6)
Example #14
0
    def start(self):
        if self.clear:
            self.clean_the_map()
            
        else:
            self.stage.playback(self.stage_song)
            self.pre_reward()
            self.stage.vision = 320
            
            element_sprite = load_sprite_mainsheet("otherpets01")
            element_sprite2 = load_sprite_mainsheet("otherpneu01")
            element_sprite3 = load_sprite_mainsheet("otherpneu02")
            element = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (650,325))
            element2 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (620,390))
            element3 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (1100,420))
            element4 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (1000,380))
            element9 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (1180,460))
            element5 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (480,230))
            
            element6 = ElementBuilder(type = "SuperFoco", stage = self.stage, sprite = element_sprite3, position = (1248,160))
            element7 = ElementBuilder(type = "SuperFoco", stage = self.stage, sprite = element_sprite3, position = (1376,160))
            element8 = ElementBuilder(type = "SuperFoco", stage = self.stage, sprite = element_sprite3, position = (1376,288))
            
            
#             element.drop = [generateItem("item01"),generateItem("item02")]
            element5.drop = [generateItem("item01"),generateItem("item02")]
#            element7.drop = [generateItem("item01"),generateItem("item02")]
            element9.drop = [generateItem("item01"),generateItem("item02")]
            
            self.stage.add_element(element)
            self.stage.add_element(element2)
            self.stage.add_element(element3)
            self.stage.add_element(element4)
            self.stage.add_element(element5)
            self.stage.add_element(element6)
            self.stage.add_element(element7)
            self.stage.add_element(element8)
            self.stage.add_element(element9)
Example #15
0
    def start(self):
        if self.clear:
            self.clean_the_map()
        else:
            element_sprite = load_sprite_mainsheet("otherpets01")
            element_sprite2 = load_sprite_mainsheet("othervaso01")
            element_sprite3 = load_sprite_mainsheet("otherbarril01")
            element = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (368,112))
            element2 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (464,112))
            element3 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (496,112))
            element4 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (528,112))
            element5 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (560,112))
            element6 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite3, position = (784,112))
            element7 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (160,192))
            element8 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (170,210))
            element9 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (150,230))
            element10 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (162,250))
            element11 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (168,260))
            element10 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (200,275))
            element11 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (220,290))
            
            
            element.drop = [generateItem("item02")]

            
            element_sprite5 = load_sprite_mainsheet("otherspecial01")
            element20 = ElementBuilder(type = "SpecialItem", stage = self.stage, sprite = element_sprite5, position = (780,580))
            element20.drop = generateWeapon("weapon04")
            
            self.stage.add_element(element)
            self.stage.add_element(element2)
            self.stage.add_element(element3)
            self.stage.add_element(element4)
            self.stage.add_element(element5)
            self.stage.add_element(element6)
            self.stage.add_element(element7)
            self.stage.add_element(element8)
            self.stage.add_element(element9)
            self.stage.add_element(element10)
            self.stage.add_element(element11)
            self.stage.add_element(element20)
Example #16
0
 def start(self):
     if self.clear:
         self.clean_the_map()
     else:
         element_sprite = load_sprite_mainsheet("otherlixeira01")
         element_sprite2 = load_sprite_mainsheet("otherpets01")
         element_sprite3 = load_sprite_mainsheet("otherbarril01")
         element_sprite4 = load_sprite_mainsheet("othervaso01")
         element = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (432,80))
         element2 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite3, position = (912,80))
         element3 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite4, position = (976,80))
         element4 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (1040,80))
         element5 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (1392,496))
         element6 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite, position = (1392,560))
         
         element7 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (872 + randint(-200, 200),512 + randint(-200, 200)))
         element8 = ElementBuilder(type = "Foco", stage = self.stage, sprite = element_sprite2, position = (1028 + randint(-200, 200),522 + randint(-200, 200)))
         
         element8.drop = [generateItem("item01"),generateItem("item02")]
         element7.drop = [generateItem("item02")]
         
         self.stage.add_element(element)
         self.stage.add_element(element2)
         self.stage.add_element(element3)
         self.stage.add_element(element4)
         self.stage.add_element(element5)
         self.stage.add_element(element6)
         self.stage.add_element(element7)
         self.stage.add_element(element8)