forked from suncat/magictower
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbutterflies.py
65 lines (55 loc) · 1.54 KB
/
butterflies.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# coding:utf8
from __future__ import absolute_import
import pygame
import random
from consts import CELL_SIZE
from npc import Npc
from enemy import Enemy
from character import load_images
from msgbox import Msgbox
class Butterfly(Enemy):
images = load_images(["butterfly.png", "butterfly2.png"])
hp = 80
money = 2
exp = 2
feature = 'None'
skill = "NO"
condition = "NORMAL"
class MidButterfly(Butterfly):
images = load_images(["midbutterfly.png", "midbutterfly2.png"])
hp = 150
money = 4
exp = 4
feature = 'None'
skill = "NO"
condition = "NORMAL"
class LargeButterfly(Butterfly):
images = load_images(["largebutterfly.png", "largebutterfly2.png"])
hp = 550
money = 13
exp = 13
feature = 'None'
skill = "NO"
condition = "NORMAL"
class LightButterfly(Butterfly):
images = load_images(["lightbutterfly.png", "lightbutterfly2.png"])
hp = 960
money = 20
exp = 19
feature = 'LIGHT'
skill = "LIGHTNING-BOMB"
condition = "NORMAL"
def do_collide(self, player):
Msgbox("Skill: Lightning-Bomb! Be careful!").show()
miss = random.randint(1, 10)
if miss == 1:
Msgbox("The skill missed!").show()
else:
if player.feature in ["GRASS", "SOIL"]:
player.weaken(120)
elif player.feature in ["WATER", "SKY", "DARK"]:
player.weaken(480)
player.hurt(100)
else:
player.weaken(240)
super(LightButterfly, self).do_collide(player)