• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Answer the question above... TWISTED EDITION!

  • 47,759
    Posts
    3
    Years
    I prayed to our Lord and Savoir, Lord Eevolitus:
    Spoiler:


    And then it suddenly just fell from the sky!

    How often does it need to be repaired?
     

    Aldo

    Survivalist
  • 1,160
    Posts
    5
    Years
    • Seen Jun 8, 2024
    Every single time I use it. I can't just turn it off then expect it to turn on again like the other ones. This is probably the worst investment of my life. Curse that random, masked salesman for selling me something like this. He told me it was the biggest technological advancement of the century, with all sorts of new features and the most powerful CPU and stuff. If anything, my age is advancing twice faster than usual trying to fix this thing...

    Your avatar...it just feels special! Where did you get it?
     

    StCooler

    Mayst thou thy peace discover.
  • 9,320
    Posts
    4
    Years
    • Seen yesterday
    I was walking in the street and then a stranger talked to me. He was a dimension-traveler. He told me that in this dimension, people have Slowpokes instead of dogs. Through his Google Glasses 3000, he knew I was an artist, and he proposed to pay me big money for a new pixel-art picture of Slowpoke with his wife.

    What TV show did you write?
     
  • 33,823
    Posts
    18
    Years
    I wrote a successful TV show called Rawhide, I was only in my 30's at the time too! I was quite fortunate to stumble upon this guy called Clint who kind of stole the show. Good times!

    What did you eat for lunch today?
     
  • 25,111
    Posts
    3
    Years
    • Any pronoun
    • Online now
    By bribing it with money. Why else would they call it a goldfish?

    What is a hidden talent of yours?
     
  • 25,111
    Posts
    3
    Years
    • Any pronoun
    • Online now
    Maybe, like, two bars? Ought to be enough to squeeze out of the cell in Willy Wonka's prison. Did not expect such a harsh response to sampling some of the candy on the tour. Oh, wait, make that four. Should make two trips a year.

    What is your biggest goal in life?
     
  • 2,111
    Posts
    15
    Years
    • Online now
    It's when Ronaldo passed to me and I scored the goal. SIUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU

    When was the last time you cried?
     

    Orion☆

    The Whole Constellation
  • 2,142
    Posts
    2
    Years
    I don't remember, I died like 80 years ago. Now my tears are made of ectoplasm! *starts sniffing and sobbing*

    Do you like dancing?
     
  • 2,111
    Posts
    15
    Years
    • Online now
    import pygame
    from settings import *
    from entity import Entity
    from support import *

    class Enemy(Entity):
    def __init__(self,monster_name,pos,groups,obstacle_sprites,damage_player,trigger_death_particles,add_exp):

    # general setup
    super().__init__(groups)
    self.sprite_type = 'enemy'

    # graphics setup
    self.import_graphics(monster_name)
    self.status = 'idle'
    self.image = self.animations[self.status][self.frame_index]

    # movement
    self.rect = self.image.get_rect(topleft = pos)
    self.hitbox = self.rect.inflate(0,-10)
    self.obstacle_sprites = obstacle_sprites

    # stats
    self.monster_name = monster_name
    monster_info = monster_data[self.monster_name]
    self.health = monster_info['health']
    self.exp = monster_info['exp']
    self.speed = monster_info['speed']
    self.attack_damage = monster_info['damage']
    self.resistance = monster_info['resistance']
    self.attack_radius = monster_info['attack_radius']
    self.notice_radius = monster_info['notice_radius']
    self.attack_type = monster_info['attack_type']

    # player interaction
    self.can_attack = True
    self.attack_time = None
    self.attack_cooldown = 400
    self.damage_player = damage_player
    self.trigger_death_particles = trigger_death_particles
    self.add_exp = add_exp

    # invincibility timer
    self.vulnerable = True
    self.hit_time = None
    self.invincibility_duration = 300

    # sounds
    self.death_sound = pygame.mixer.Sound('../audio/death.wav')
    self.hit_sound = pygame.mixer.Sound('../audio/hit.wav')
    self.attack_sound = pygame.mixer.Sound(monster_info['attack_sound'])
    self.death_sound.set_volume(0.6)
    self.hit_sound.set_volume(0.6)
    self.attack_sound.set_volume(0.6)

    def import_graphics(self,name):
    self.animations = {'idle':[],'move':[],'attack':[]}
    main_path = f'../graphics/monsters/{name}/'
    for animation in self.animations.keys():
    self.animations[animation] = import_folder(main_path + animation)

    def get_player_distance_direction(self,player):
    enemy_vec = pygame.math.Vector2(self.rect.center)
    player_vec = pygame.math.Vector2(player.rect.center)
    distance = (player_vec - enemy_vec).magnitude()

    if distance > 0:
    direction = (player_vec - enemy_vec).normalize()
    else:
    direction = pygame.math.Vector2()

    return (distance,direction)

    def get_status(self, player):
    distance = self.get_player_distance_direction(player)[0]

    if distance <= self.attack_radius and self.can_attack:
    if self.status != 'attack':
    self.frame_index = 0
    self.status = 'attack'
    elif distance <= self.notice_radius:
    self.status = 'move'
    else:
    self.status = 'idle'

    def actions(self,player):
    if self.status == 'attack':
    self.attack_time = pygame.time.get_ticks()
    self.damage_player(self.attack_damage,self.attack_type)
    self.attack_sound.play()
    elif self.status == 'move':
    self.direction = self.get_player_distance_direction(player)[1]
    else:
    self.direction = pygame.math.Vector2()

    def animate(self):
    animation = self.animations[self.status]

    self.frame_index += self.animation_speed
    if self.frame_index >= len(animation):
    if self.status == 'attack':
    self.can_attack = False
    self.frame_index = 0

    self.image = animation[int(self.frame_index)]
    self.rect = self.image.get_rect(center = self.hitbox.center)

    if not self.vulnerable:
    alpha = self.wave_value()
    self.image.set_alpha(alpha)
    else:
    self.image.set_alpha(255)

    def cooldowns(self):
    current_time = pygame.time.get_ticks()
    if not self.can_attack:
    if current_time - self.attack_time >= self.attack_cooldown:
    self.can_attack = True

    if not self.vulnerable:
    if current_time - self.hit_time >= self.invincibility_duration:
    self.vulnerable = True

    def get_damage(self,player,attack_type):
    if self.vulnerable:
    self.hit_sound.play()
    self.direction = self.get_player_distance_direction(player)[1]
    if attack_type == 'weapon':
    self.health -= player.get_full_weapon_damage()
    else:
    self.health -= player.get_full_magic_damage()
    self.hit_time = pygame.time.get_ticks()
    self.vulnerable = False

    def check_death(self):
    if self.health <= 0:
    self.kill()
    self.trigger_death_particles(self.rect.center,self.monster_name)
    self.add_exp(self.exp)
    self.death_sound.play()

    def hit_reaction(self):
    if not self.vulnerable:
    self.direction *= -self.resistance

    def update(self):
    self.hit_reaction()
    self.move(self.speed)
    self.animate()
    self.cooldowns()
    self.check_death()

    def enemy_update(self,player):
    self.get_status(player)
    self.actions(player)


    How do you feel about Harry Potter Sonic Obama backpack?
     
  • 25,111
    Posts
    3
    Years
    • Any pronoun
    • Online now
    Math? Ick. Makes it a personal mission to never use math every day. Managed for...1, 2, 3...wait! Argh! Broke the mathless streak.

    What would your theme song be?
     

    Orion☆

    The Whole Constellation
  • 2,142
    Posts
    2
    Years
    [Loading... Please wait for the calendar to appear on screen.]

    What pizza topping do you like the most?
     
    Back
    Top