Skip to content

Instantly share code, notes, and snippets.

@yunho0130
Created January 14, 2017 03:00
Show Gist options
  • Save yunho0130/79d1eecf1fdf4bbf58a4d523a1e3af97 to your computer and use it in GitHub Desktop.
Save yunho0130/79d1eecf1fdf4bbf58a4d523a1e3af97 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 14 11:21:47 2017
@author: Yunho
"""
class Monster:
def __init__(self, name, level, element):
self.name = name
self.level = level
self.element = element
print "{}레벨의 {} 몬스터가 {} 속성을 가지고 생성되었습니다".format(self.level, self.name, self.element)
def skill(self):
if self.element == 'fire':
print "화덕구이로 만들겠다 으어어: 9999 데미지"
elif self.element == 'water':
print "물대포 뿌우: 9999 데미지"
elif self.element == 'grass':
print "솔라빔: 9999 데미지"
else:
print "일반공격을 실시 합니다. 10의 데미지를 주었습니다."
mon1 = Monster('불꽃숭이', '99', 'fire')
mon1.skill()
print mon1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment