obj.floortext.msg_handler = {
  [M_NEXTTICK] = function (id)
     show_floortext(dsb_find_arch(id), id)
  end
}
obj.trigger.no_party_triggerable = true

obj.button_redcross.no_party_clickable = true

obj.stairsdown.no_party_triggerable = false

obj.stairsup.no_party_triggerable = false

obj.teleporter.no_party_triggerable = true

obj.venus = {
	name = "VENUS",
	type="THING",
	class = "MAGIC",
	mass=1,
	icon=gfx.ringa,
	dungeon=gfx.flamitt,
	fits_chest=true,
	def_charge=9999,
	methods = {
	    { "PORTAL", 0, CLASS_WIZARD, method_townportal },
	    { "FIREBALL", 5, { CLASS_WIZARD, SKILL_FIRE }, method_shoot_spell }
	},
	spell_power=250,
	convert_deplete="flamitt_x",
	base_tpower=24
}

function obj.venus:to_l_hand(id, who)
	local a = dsb_get_bonus(who, CLASS_WIZARD, 0)
	local b = dsb_get_bonus(who, CLASS_PRIEST, 0)
	local c = dsb_get_bonus(who, CLASS_NINJA, 0)
	local d = dsb_get_bonus(who, CLASS_FIGHTER, 0)
	local x = dsb_get_maxbar(who, MANA)

	dsb_set_maxbar(who, MANA, x+1500)
	dsb_set_bonus(who, CLASS_WIZARD, 0, a+4)
	dsb_set_bonus(who, CLASS_PRIEST, 0, b+4)
	dsb_set_bonus(who, CLASS_NINJA, 0, c+4)
	dsb_set_bonus(who, CLASS_FIGHTER, 0, d+4)
end

function obj.venus:from_l_hand(id, who)
	local a = dsb_get_bonus(who, CLASS_WIZARD, 0)
	local b = dsb_get_bonus(who, CLASS_PRIEST, 0)
	local c = dsb_get_bonus(who, CLASS_NINJA, 0)
	local d = dsb_get_bonus(who, CLASS_FIGHTER, 0)
	local x = dsb_get_maxbar(who, MANA)

	dsb_set_maxbar(who, MANA, x-1500)
	dsb_set_bonus(who, CLASS_WIZARD, 0, a-4)
	dsb_set_bonus(who, CLASS_PRIEST, 0, b-4)
	dsb_set_bonus(who, CLASS_NINJA, 0, c-4)
	dsb_set_bonus(who, CLASS_FIGHTER, 0, d-4)
end


function obj.venus:to_r_hand(id, who)
	local a = dsb_get_bonus(who, CLASS_WIZARD, 0)
	local b = dsb_get_bonus(who, CLASS_PRIEST, 0)
	local c = dsb_get_bonus(who, CLASS_NINJA, 0)
	local d = dsb_get_bonus(who, CLASS_FIGHTER, 0)
	local x = dsb_get_maxbar(who, MANA)

	dsb_set_maxbar(who, MANA, x+1500)
	dsb_set_bonus(who, CLASS_WIZARD, 0, a+4)
	dsb_set_bonus(who, CLASS_PRIEST, 0, b+4)
	dsb_set_bonus(who, CLASS_NINJA, 0, c+4)
	dsb_set_bonus(who, CLASS_FIGHTER, 0, d+4)
end

function obj.venus:from_r_hand(id, who)
	local a = dsb_get_bonus(who, CLASS_WIZARD, 0)
	local b = dsb_get_bonus(who, CLASS_PRIEST, 0)
	local c = dsb_get_bonus(who, CLASS_NINJA, 0)
	local d = dsb_get_bonus(who, CLASS_FIGHTER, 0)
	local x = dsb_get_maxbar(who, MANA)

	dsb_set_maxbar(who, MANA, x-1500)
	dsb_set_bonus(who, CLASS_WIZARD, 0, a-4)
	dsb_set_bonus(who, CLASS_PRIEST, 0, b-4)
	dsb_set_bonus(who, CLASS_NINJA, 0, c-4)
	dsb_set_bonus(who, CLASS_FIGHTER, 0, d-4)
end

obj.sea = {
	type="WALLITEM",
	class="DECO",
	front=gfx.sea,
	on_click=wallitem_click
}

obj.debian = {
    name="DEBIAN",
	type="THING",
	class="NECK",
	mass=6,
        icon=gfx.debian,
        dungeon=gfx.neck_gold,
	fit_neck = true,
}

function obj.debian:to_neck(id, who)
	local a = dsb_get_maxstat(who,STAT_STR)
	dsb_set_maxstat(who, STAT_STR, a+700)
	dsb_set_stat(who, STAT_STR, a+700)
	local b = dsb_get_maxstat(who,STAT_DEX)
	dsb_set_maxstat(who, STAT_DEX, b+700)
	dsb_set_stat(who, STAT_DEX, b+700)
	local c = dsb_get_maxstat(who,STAT_WIS)
	dsb_set_maxstat(who, STAT_WIS, c+700)
	dsb_set_stat(who, STAT_WIS, c+700)
	local d = dsb_get_maxstat(who,STAT_VIT)
	dsb_set_maxstat(who, STAT_VIT, d+700)
	dsb_set_stat(who, STAT_VIT, d+700)
	dsb_set_light(2, 100)

	
	use_ch_exvar(who)
	ch_exvar[who].debian_equipped = true
	if (ch_exvar[who].nebula_equipped == true) then
	local id = ch_exvar[who].nebulaid
		dsb_qswap(id, obj.nebulax)
		dsb_write({0, 100, 0, }, "A FLOW OF PURE ENERGY IS RUNNING THROUGH YOUR BODY.") end
end

function obj.debian:from_neck(id, who)
	local a = dsb_get_maxstat(who,STAT_STR)
	dsb_set_maxstat(who, STAT_STR, a-700)
	dsb_set_stat(who, STAT_STR, a-700)
	local b = dsb_get_maxstat(who,STAT_DEX)
	dsb_set_maxstat(who, STAT_DEX, b-700)
	dsb_set_stat(who, STAT_DEX, b-700)
	local c = dsb_get_maxstat(who,STAT_WIS)
	dsb_set_maxstat(who, STAT_WIS, c-700)
	dsb_set_stat(who, STAT_WIS, c-700)
	local d = dsb_get_maxstat(who,STAT_VIT)
	dsb_set_maxstat(who, STAT_VIT, d-700)
	dsb_set_stat(who, STAT_VIT, d-700)
	dsb_set_light(2, 0)
	
	use_ch_exvar(who)
    ch_exvar[who].debian_equipped = false
    
	local check = dsb_fetch(CHARACTER, who, INV_R_HAND, 0)
	local checkx = dsb_find_arch(check)
	
	 if (checkx == obj.nebulax) then
	 dsb_write({0, 100, 0, }, "YOU FEEL LIKE YOU'RE BEING CRUSHED BY GRAVITY.")
	 dsb_qswap(check, obj.nebula) end
end


obj.nebula = {
	name="NEBULA",
	type="THING",
	shortdesc="UNIQUE",
	class="GODLY",
	mass=550,
	icon=gfx.nebulicon,
	dungeon=gfx.nebudung,		
	methods = {
	    { "FURY", 9, { CLASS_FIGHTER, SKILL_SWINGING }, method_physattack },
	    { "RESTORE", 9, CLASS_PRIEST, method_heal },
	    { "SPELLSHIELD", 9, { CLASS_PRIEST, SKILL_SHIELDS }, method_shield }
	},
	hits_nonmat=true,
	flying_hits_nonmat=true,	
	base_range=10,
	base_tpower=150,
	monster_def_factor=0.4,
	bonus_power=20,
	impact=25,
	shield_power = 20,
	shield_duration = 100,
	fit_sheath=true,
	hit_sound=snd.dink
}
function obj.nebula:to_r_hand(id, who)
	local a = dsb_get_bonus(who, CLASS_NINJA, 0)
	local b = dsb_get_bonus(who, CLASS_WIZARD, 0)
	local c = dsb_get_bonus(who, CLASS_FIGHTER, 0)
	local d = dsb_get_bonus(who, CLASS_PRIEST, 0)
	dsb_set_bonus(who, CLASS_NINJA, 0, a+2)
	dsb_set_bonus(who, CLASS_WIZARD, 0, b+2)
	dsb_set_bonus(who, CLASS_FIGHTER, 0, c+2)
	dsb_set_bonus(who, CLASS_PRIEST, 0, d+2)
	use_ch_exvar(who)
	local check = dsb_fetch(CHARACTER, who, INV_NECK, 0)
	local checkx = dsb_find_arch(check)
	if (checkx ~= obj.debian) then
	dsb_write({0, 100, 0, }, "YOU FEEL LIKE YOU'RE BEING CRUSHED BY GRAVITY.")end
	ch_exvar[who].nebula_equipped = true
	ch_exvar[who].nebulaid = (id)
	if (ch_exvar[who].debian_equipped == true) then 
		dsb_swap(id, obj.nebulax)
		dsb_write({0, 100, 0, }, "A FLOW OF PURE ENERGY IS RUNNING THROUGH YOUR BODY.") end
    
end

function obj.nebula:from_r_hand(id, who)
	local a = dsb_get_bonus(who, CLASS_NINJA, 0)
	local b = dsb_get_bonus(who, CLASS_WIZARD, 0)
	local c = dsb_get_bonus(who, CLASS_FIGHTER, 0)
	local d = dsb_get_bonus(who, CLASS_PRIEST, 0)
	dsb_set_bonus(who, CLASS_NINJA, 0, a-2)
	dsb_set_bonus(who, CLASS_WIZARD, 0, b-2)
	dsb_set_bonus(who, CLASS_FIGHTER, 0, c-2)
	dsb_set_bonus(who, CLASS_PRIEST, 0, d-2)
	use_ch_exvar(who)
    ch_exvar[who].nebula_equipped = false
    
end

obj.nebulax = {
	name="NEBULA",
	type="THING",
	class="GODLY",
	mass=120,
	icon=gfx.nebulicon,
	dungeon=gfx.nebudung,		
	methods = {
	    { "ASTRAL STRIKE", 9, { CLASS_FIGHTER, SKILL_SWINGING }, method_physattack },
	    { "LIFE FLOW", 9, CLASS_PRIEST, method_heal },
	    { "SPELLSHIELD", 9, { CLASS_PRIEST, SKILL_SHIELDS }, method_shield }
	},
	hits_nonmat=true,
	flying_hits_nonmat=true,	
	base_range=10,
	base_tpower=150,
	monster_def_factor=0.5,
	bonus_power=20,
	impact=25,
	shield_power = 80,
	shield_duration = 1000,
	fit_sheath=true,
	hit_sound=snd.dink
}


function obj.nebulax:from_r_hand(id, who)
	local a = dsb_get_bonus(who, CLASS_NINJA, 0)
	local b = dsb_get_bonus(who, CLASS_WIZARD, 0)
	local c = dsb_get_bonus(who, CLASS_FIGHTER, 0)
	local d = dsb_get_bonus(who, CLASS_PRIEST, 0)
	dsb_set_bonus(who, CLASS_NINJA, 0, a-2)
	dsb_set_bonus(who, CLASS_WIZARD, 0, b-2)
	dsb_set_bonus(who, CLASS_FIGHTER, 0, c-2)
	dsb_set_bonus(who, CLASS_PRIEST, 0, d-2)
    ch_exvar[who].nebula_equipped = false
    dsb_qswap(id, obj.nebula)
    
end

obj.andromeda = {
	name="ANDROMEDA",
	type="THING",
	class="NEBULA",
	mass=2,
	icon=gfx.icons[131],
	dungeon=gfx.gem_green,
	fit_pouch=true,
	hit_sound=snd.dink
}
obj.hydra = {
	name="HYDRA",
	type="THING",
	class="NEBULA",
	mass=2,
	icon=gfx.icons[129],
	dungeon=gfx.gem_blue,
	fit_pouch=true,
	hit_sound=snd.dink
}
obj.nova = {
	name="NOVA",
	type="THING",
	class="WEAPON",
	mass=100,
	icon=gfx.icons[46],
	dungeon=gfx.morningstar,		
	methods = {
	    { "SWING", 0, CLASS_FIGHTER, method_physattack },
	    { "STUN", 2, { CLASS_FIGHTER, SKILL_BASHING }, method_physattack },
	    { "MELEE", 5, { CLASS_FIGHTER, SKILL_BASHING }, method_physattack }
	},	
	base_range=10,
	base_tpower=100,
	impact=15,
	fit_sheath=true,
	hit_sound=snd.dink
}

obj.dragonspine = {
    name="DRAGONSPINE",
    type="THING",
    class="MISSILE",
    shortdesc="LEGENDARY",
    mass=0,
    icon=gfx.icons[52],
	dungeon=gfx.slayer,
	flying_away=gfx.slayer_flying_away,
	flying_toward=gfx.slayer_flying_toward,
	flying_side=gfx.slayer_flying_side,
	fit_quiver=true,
	fit_pouch=true,
	missile_type=MISSILE_ARROW,
	methods = throwable_object_methods,
	base_range=20,
	impact=350,
	monster_def_factor=0.5,
	hit_sound=snd.dink,
	hits_nonmat=true,
	flying_hits_nonmat=true,
	can_stick = true,
	go_thru_bars = true
	}
	
	function obj.dragonspine: on_impact(id, hit_what, hit_ppos, hit_party)
	dsb_set_tint(id, {85, 0, 0, }, 30)
end

obj.applana = {
	name="BANANA",
	type="THING",
	shortdesc="CONSUMABLE",
	class="FOOD",
	mass=4,
	icon=gfx.icons[168],
	dungeon=gfx.apple,
	foodval=1900,
	fit_pouch = true,		
	on_consume=eatdrink
}
obj.guardian = {
	name="THE GUARDIAN",
	type="THING",
	class="CAPE",
	mass=4,
	icon=gfx.guardian,
	dungeon=gfx.clothes_brown,
	fit_neck=true,
	fit_chest=true,
	armor_str = 150,
	sharp_resist = 10,
	to_torso = stat_bonus,
	to_neck = stat_bonus,
	from_torso = stat_bonus_off,
	from_neck = stat_bonus_off,
	stat = STAT_AMA,
	stat_up = 800,
	useless_thrown=true
}	

obj.elvenbow = {
    name="ELVEN BOW",
    type="THING",
    class="WEAPON",
    mass=10,
    icon=gfx.icons[231],
    dungeon=gfx.bow,
	methods = shoot_method,
    base_shot_power=300,
    base_shot_damage=550,
    monster_def_factor=0.2,
    base_delta=4,
	min_delta=1,	    
    need_ammo_type=MISSILE_ARROW,
    fit_sheath = true,
	}
	
	function obj.elvenbow:to_r_hand(id, who)
	local b = dsb_get_bonus(who, CLASS_NINJA, 0)
	dsb_set_bonus(who, CLASS_NINJA, 0, b+3)
end

	function obj.elvenbow:from_r_hand(id, who)
	local b = dsb_get_bonus(who, CLASS_NINJA, 0)
	dsb_set_bonus(who, CLASS_NINJA, 0, b-3)
end
	

obj.Khelbensring = {
	name="KHELBEN'S RING",
	type="THING",
	class="MAGIC",
	shortdesc="LEFT HANDED",
	mass=1,
	icon=gfx.icons[17],
	dungeon=gfx.ring,
	fit_pouch=true,
	}
	
	function obj.Khelbensring:to_l_hand(id, who)
	local b = dsb_get_bonus(who, CLASS_PRIEST, 0)
	dsb_set_maxbar(who, STAMINA, dsb_get_maxbar(who, STAMINA)+400)
	dsb_set_bonus(who, CLASS_PRIEST, 0, b+2)
end

function obj.Khelbensring:from_l_hand(id, who)
	local b = dsb_get_bonus(who, CLASS_PRIEST, 0)
	dsb_set_maxbar(who, STAMINA, dsb_get_maxbar(who, STAMINA)-400)
	dsb_set_bonus(who, CLASS_PRIEST, 0, b-2)
end
	
	obj.elminsterslace = {
    name="CATALYZER",
    type="THING",
	class="NECK",
    mass=2,
    icon=gfx.icons[124],
    dungeon=gfx.neck_black,
    fit_pouch=true,
    fit_neck=true,
}

	function obj.elminsterslace:to_neck(id, who)
	dsb_set_maxbar(who, MANA, dsb_get_maxbar(who, MANA)+400)
	local b = dsb_get_bonus(who, CLASS_WIZARD, 0)
	dsb_set_bonus(who, CLASS_WIZARD, 0, b+2)
end

function obj.elminsterslace:from_neck(id, who)
	dsb_set_maxbar(who, MANA, dsb_get_maxbar(who, MANA)-400)
	local b = dsb_get_bonus(who, CLASS_WIZARD, 0)
	dsb_set_bonus(who, CLASS_WIZARD, 0, b-2)
end

obj.demonic_stone = {
	name="DEMONIC STONE",
	type="THING",
	class="SPELLITEM",
	mass=0,
	icon=gfx.demonic,
	dungeon=gfx.corbum,
	max_throw_power=30
}
obj.marker = {
	type="HAZE",
	renderer_hack="HAZE",
	class="HAZE",
	dungeon=gfx.bluehaze
}

obj.arenaone = {
	name="ARENA ONE",
	type="THING",
	class="SPELLITEM",
	mass=0,
	icon=gfx.icons[197],
	dungeon=gfx.corbum,
	max_throw_power=30,
	no_fit_inventory=true
}
obj.panacea = {
	name="PANACEA",
	type="THING",
	class="SPELLITEM",
	mass=0,
	icon=gfx.icons[197],
	dungeon=gfx.corbum,
	max_throw_power=30
}
obj.marker = {
	type="HAZE",
	renderer_hack="HAZE",
	class="HAZE",
	dungeon=gfx.bluehaze
}
obj.panareturn = {
	name="PANACEA(GLOWS)",
	type="THING",
	class="SPELLITEM",
	shortdesc="LOADED",
	mass=0,
	icon=gfx.panareturn,
	dungeon=gfx.glowing,
	max_throw_power=30
}
obj.arenatwo = {
	name="ARENA TWO",
	type="THING",
	class="SPELLITEM",
	mass=0,
	icon=gfx.icons[197],
	dungeon=gfx.corbum,
	max_throw_power=30,
	no_fit_inventory=true
}
obj.arenathree = {
	name="ARENA THREE",
	type="THING",
	class="SPELLITEM",
	mass=0,
	icon=gfx.icons[197],
	dungeon=gfx.corbum,
	max_throw_power=30,
	no_fit_inventory=true
}
obj.arenafour = {
	name="ARENA FOUR",
	type="THING",
	class="SPELLITEM",
	mass=0,
	icon=gfx.icons[197],
	dungeon=gfx.corbum,
	max_throw_power=30,
	no_fit_inventory=true
}
obj.arenafive = {
	name="ARENA FIVE",
	type="THING",
	class="SPELLITEM",
	mass=0,
	icon=gfx.icons[197],
	dungeon=gfx.corbum,
	max_throw_power=30,
	no_fit_inventory=true
}
obj.arenasix = {
	name="ARENA SIX",
	type="THING",
	class="SPELLITEM",
	mass=0,
	icon=gfx.icons[197],
	dungeon=gfx.corbum,
	max_throw_power=30,
	no_fit_inventory=true
}
obj.arenaseven = {
	name="ARENA SEVEN",
	type="THING",
	class="SPELLITEM",
	mass=0,
	icon=gfx.icons[197],
	dungeon=gfx.corbum,
	max_throw_power=30,
	no_fit_inventory=true
}
obj.arenaeight = {
	name="ARENA EIGHT",
	type="THING",
	class="SPELLITEM",
	mass=0,
	icon=gfx.icons[197],
	dungeon=gfx.corbum,
	max_throw_power=30,
	no_fit_inventory=true
}
obj.arenanine = {
	name="ARENA NINE",
	type="THING",
	class="SPELLITEM",
	mass=0,
	icon=gfx.icons[197],
	dungeon=gfx.corbum,
	max_throw_power=30,
	no_fit_inventory=true
}
obj.arenaten = {
	name="ARENA TEN",
	type="THING",
	class="SPELLITEM",
	mass=0,
	icon=gfx.icons[197],
	dungeon=gfx.corbum,
	max_throw_power=30,
	no_fit_inventory=true
}
obj.gem_bliss = {
    name="GEM OF BLISS",
	type="THING",
	class="WEAPON",
	mass=2,
	icon=gfx.icons[129],
	methods = {
		{ "SQUEEZE", 0, CLASS_PRIEST, method_causefear }
		},
	dungeon=gfx.gem_blue,
	fit_pouch=true,
	hit_sound=snd.dink
}

obj.horn_of_terror = {
    name="HORN OF TERROR",
    type="THING",
    class="MISC",
    mass=8,
    def_charge=1,
    icon=gfx.icons[135],
    dungeon=gfx.horn,
	methods = {
		{ "TERRORIZE", 0, CLASS_PRIEST, method_causefear }
	}, 
    fit_pouch = true,
    fit_sheath = true
}

	function obj.gem_bliss:to_r_hand(id, who)
	local b = dsb_get_bonus(who, CLASS_PRIEST, 0)
	dsb_set_maxbar(who, STAMINA, dsb_get_maxbar(who, STAMINA)+1000)
end

function obj.gem_bliss:from_r_hand(id, who)
	local b = dsb_get_bonus(who, CLASS_PRIEST, 0)
	dsb_set_maxbar(who, STAMINA, dsb_get_maxbar(who, STAMINA)-1000)
end
obj.funnyarrow = {
    name="FUNNY ARROW",
    type="THING",
    class="MISSILE",
    shortdesc="SO FUN",
    mass=0,
    icon=gfx.icons[52],
	dungeon=gfx.slayer,
	flying_away=gfx.slayer_flying_away,
	flying_toward=gfx.slayer_flying_toward,
	flying_side=gfx.slayer_flying_side,
	fit_quiver=true,
	fit_pouch=true,
	missile_type=MISSILE_ARROW,
	methods = throwable_object_methods,
	base_range=30,
	impact=100,
	hit_sound=snd.dink,
	can_stick = true,
	go_thru_bars = true
	}
	function obj.funnyarrow: on_impact(id, hit_what, hit_ppos)
   if (hit_what) then
      local hit_arch = dsb_find_arch(hit_what)
      if (hit_arch.type == "MONSTER") then
         dsb_swap(hit_what, "dragon")
      end
   end
end

obj.carsomyr = {
	name="CARSOMYR",
	type="THING",
	class="WEAPON",
	shortdesc="HOLY SLAYER",
	mass=112,
	icon=gfx.carsomyr,
    dungeon=gfx.sword,
	flying_away=gfx.sword_flying_away,
	flying_toward=gfx.sword_flying_toward,
	flying_side=gfx.sword_flying_side,
	methods = {
	    { "SMITE", 4, { CLASS_FIGHTER, SKILL_STABBING }, method_physattack },
	    { "BERZERK", 6, { CLASS_FIGHTER, SKILL_SWINGING }, method_physattack },
	    { "HEAL", 7, CLASS_PRIEST, method_heal }
	},
	base_range=10,
	base_tpower=115,
	impact=15,
	fit_sheath=true,
	to_r_hand = stat_bonus,
	from_r_hand = stat_bonus_off,
	stat = STAT_STR,
	stat_up = 400,
	hit_sound=snd.dink
	}
	
	obj.chastityserum = {
	name="CHASTITY SERUM",
	type="THING",
	class="POTION",
	shortdesc="CONSUMABLE",
	mass=3,
	icon=gfx.icons[161],
	dungeon=gfx.flask_full,
	fit_pouch=true,
	hit_sound=snd.dink,
	on_consume=drinkpotion,
	namechanger=potion_namechanger
}
function obj.chastityserum.on_consume()
dsb_champion_toparty(3, 6)
dsb_champion_toparty(2, 6)
dsb_champion_toparty(1, 6)
dsb_write({0, 255, 0, }, "HAAAAAAAARRRRRRRR!!") 
end

obj.horn_of_melody = {
    name="HORN OF MELODY",
    type="THING",
    class="MISC",
    mass=8,
    def_charge=1,
    icon=gfx.icons[135],
    dungeon=gfx.horn,
	methods = {
		{ "BLOW HORN", 0, CLASS_PRIEST, method_causefear }
	}, 
    fit_pouch = true,
    fit_sheath = true
}

obj.phantom_scorpion = {
    name="PHANTOSCORP",
    type="MONSTER",
    class="NONMAT",
    group_type=GT_NONMATS,
    size=4,
    col=nonmat_col,
    no_bump=true,
    nonmat=true,
    hover=true,
    no_stopclicks=true,
    instant_turn=true,
    hp=250,
	front=gfx.scorpion_front,
	side=gfx.scorpion_side,
	back=gfx.scorpion_back,
	attack=gfx.scorpion_attack,
    perception=5,
    awareness=4,
    darkvision=true,
    bravery=9,
    act_rate=8,
    attack_delay=6,
	shift_rate=7,
    flip_rate=4,
    quickness=80,
    base_power=200,
    armor=15,
	anti_desew=52,
    anti_fire=360,
    anti_poison=999,
    xp_factor=15,
    msg_handler=monster_msg_handler,
    on_move=monster_step,
    on_attack_close=monster_attack,
    on_incoming_impact=monster_dodge,
	attack_sound=snd.monster_snarl,
	attack_type=ATTACK_PIERCING,
	attack_zonetable=ZT_TORSO_SCORPION,
	attack_show_duration=4,
    death_size=64,
    death_delta=4
}

obj.ms_slice = {
	name="MAGICAL SLICE",
	type="THING",
	shortdesc="LEGENDARY",
	class="FOOD",
	mass=5,
	icon=gfx.icons[172],
	dungeon=gfx.s_slice,
	foodval=500,
	fit_chest = true,		
}
obj.xs_slice = {
	name="NICE SLICE",
	type="THING",
	shortdesc="LEGENDARY",
	class="FOOD",
	mass=5,
	icon=gfx.icons[172],
	dungeon=gfx.s_slice,
	foodval=950,
	fit_chest = true,		
}
function obj.ms_slice:on_consume(id,who)
if (who == Sasha) then 
	local c = dsb_get_maxstat(who,STAT_WIS)
	dsb_set_maxstat(who, STAT_WIS, c+100)
	dsb_sound(base_eat_sound)
	dsb_delete(id)
	dsb_write({255, 255, 255, }, "THAT WAS THE BEST THING I EVER TASTED.") end
	
if (who ~= Sasha) then
	dsb_write ({255, 255, 255, }, "OH PLEASE, LEAVE IT TO ME... IT LOOKS SO DELICIOUS!") end
	end
	
	obj.screamerslicer = {
    name="SCREAMER EDGE",
    type="THING",
    class="WEAPON",
    mass=33,
    icon=gfx.slicer,
    dungeon=gfx.sword,
	flying_away=gfx.sword_flying_away,
	flying_toward=gfx.sword_flying_toward,
	flying_side=gfx.sword_flying_side,
	methods = {
	    { "SLICE !", 1, { CLASS_FIGHTER, SKILL_SWINGING }, method_physattack }
	},
	base_range=10,
	base_tpower=200,
	monster_def_factor=0.5,
	bonus_power=20,
	impact=14,
	fit_sheath=true,
	hit_sound=snd.dink
}
function obj.screamerslicer:on_melee_damage_monster(what, ppos, who, monster_id)
	local checkx = dsb_find_arch(monster_id)
    local a = dsb_get_stat(who, STAT_STR)
	local b = dsb_get_food(who)
	 if (checkx == obj.screamer) then
	 dsb_set_stat(who, STAT_STR, a+40)
	 dsb_set_food(who, b+150) end
	 
	 if (checkx ~= obj.screamer) then
	 dsb_set_stat(who, STAT_STR, a-200)
	 dsb_set_food(who, b-400)
	 dsb_write({0, 255, 0, }, "THE WEAPON ROARS WITH DISGUST : ")
	 dsb_write({0, 255, 0, }, "I'M NOT A WEAPON, I'M A SUBTLE SCREAMER SLICER,")
	 dsb_write({0, 255, 0, }, "YOU FILTHY, DIGUSTING, PITILESS BASTARD !")end
	 dsb_qswap(what, obj.angryslicer)
	 end
	 
	 	obj.angryslicer = {
    name="ANGRY EDGE",
    type="THING",
    class="WEAPON",
    mass=33,
    icon=gfx.angry,
    dungeon=gfx.sword,
	flying_away=gfx.sword_flying_away,
	flying_toward=gfx.sword_flying_toward,
	flying_side=gfx.sword_flying_side,
	methods = {
	    { "APOLOGIZE", 1, { CLASS_FIGHTER, SKILL_SWINGING }, method_apologize }
	},
	base_range=10,
	base_tpower=200,
	monster_def_factor=0.5,
	bonus_power=20,
	impact=14,
	fit_sheath=true,
	hit_sound=snd.dink
}
	 obj.immatarrow = {
    name="IMMAT. ARROW",
    type="THING",
    class="MISSILE",
    shortdesc="IMMATERIAL",
    mass=0,
    icon=gfx.icons[52],
	dungeon=gfx.slayer,
	flying_away=gfx.slayer_flying_away,
	flying_toward=gfx.slayer_flying_toward,
	flying_side=gfx.slayer_flying_side,
	fit_quiver=true,
	fit_pouch=true,
	missile_type=MISSILE_ARROW,
	methods = throwable_object_methods,
	base_range=40,
	impact=100,
	monster_def_factor=0.25,
	hit_sound=snd.dink,
	hits_nonmat=true,
	flying_hits_nonmat=true,
	can_stick = true,
	go_thru_bars = true
}
	
	obj.blackwidow = {
    name="BLACK WIDOW",
    type="THING",
    class="WEAPON",
    mass=5,
    icon=gfx.assa,
	dungeon=gfx.dagger,
	flying_away=gfx.dagger_flying_away,
	flying_toward=gfx.dagger_flying_toward,
	flying_side=gfx.dagger_flying_side,
	fit_quiver=true,
	fit_pouch=true,
	base_tpower=15,
	monster_def_factor=0.2,
	methods = {
		{ "WHIRLWIND", 5, CLASS_NINJA, method_physattack },
		{ "BACKSTAB", 8, CLASS_NINJA, method_physattack },
		{ "ASSASSINATE", 11, CLASS_NINJA, method_physattack }
	},			
	base_range=12,
	impact=19,
	hit_sound=snd.dink,
	to_r_hand = stat_bonus,
	from_r_hand = stat_bonus_off,
	stat = STAT_DEX,
	stat_up = 450,
	can_stick = true,
	go_thru_bars = true
}	
obj.erichto = {
    name="ERICHTO",
	type="MONSTER",
	class="BOSS",
	group_type=GT_WIZARDS,
	size=4,
	col=true,
	no_bump=true,
	smart=true,
	crafty=true,
	hover=true,
	hp=100,
	front=gfx.vexirk2_front,
	side=gfx.vexirk2_side,
	back=gfx.vexirk2_back,
	attack=gfx.vexirk2_attack,
	hover=true,
	perception=9,
	awareness=9,
	bravery=9,
	act_rate=3,
	attack_delay=3,
	shift_rate=26,
	quickness=90,
	base_power=75,
	armor=100,
	anti_fire=150,
	anti_poison=150,
	anti_desew=999,
	xp_factor=19,
	msg_handler=monster_msg_handler,
	on_move=monster_step,
	on_attack_close=monster_attack,
	on_attack_ranged=monster_missile,
	should_attack_ranged=threefourthsranged,
	prefer_ranged=true,
	attack_type=ATTACK_ANTI_MAGIC,
	attack_zonetable=ZT_LEGS,
	attack_show_duration=2,
	missile_type=vexirk_missiles,
	door_opener="zospell",
	door_breaker="fireball",
	missile_power=135,
	on_incoming_impact=monster_dodge,
	on_shot_missile_impact=zo_success_check,
	step_sound=snd.step_footstep,
	hit_height=16,
	death_size=16,
	death_delta=2,
	proj_stick=35
}


obj.debian_keeper = {
    name="DEBIAN KEEPER",
	type="MONSTER",
	class="BOSS",
	size=4,
	col=true,
	no_bump=true,
	smart=true,
	crafty=true,
	pounces=true,
	pounce_eagerness=30,
	counterattack=true,
	hp=400,
	front=gfx.dragon_front,
	side=gfx.dragon_side,
	back=gfx.dragon_back,
	attack=gfx.dragon_attack,
	perception=10,
	awareness=5,
	bravery=7,
	act_rate=5,
	attack_delay=5,
	shift_rate=5,
	flip_rate=13,
	quickness=135,
	base_power=255,
	armor=170,
	anti_fire=120,
	anti_poison=120,
	anti_desew=999,
	xp_factor=15,
	msg_handler=monster_msg_handler,
	on_move=monster_step,
	on_die=setup_food_drop,
	on_attack_close=monster_attack,
	on_attack_ranged=monster_missile,
	should_attack_ranged=halfranged,
	missile_type="fireball",
	door_opener="fireball",
	missile_power=195,
	on_incoming_impact=monster_dodge,
	step_sound=snd.step_dragon,
	attack_sound=snd.monster_roar,
	attack_type=ATTACK_PIERCING,
	attack_zonetable=ZT_TORSO_LOWER,
	food_type="d_steak",
	min_food=8,
	max_food=10,
	hit_height=24,
	death_size=64,
	death_delta=4,
	proj_stick=60
}
obj.evillord = {
    name="EVIL LORD",
	type="MONSTER",
	class="CHAOS",
	size=4,
	col=true,
	no_bump=true,
	smart=true,
	crafty=true,
	hp=5000,
	front=gfx.lordchaos_front,
	side=gfx.lordchaos_side,
	back=gfx.lordchaos_back,
	attack=gfx.lordchaos_attack,
	hover=true,
	perception=8,
	awareness=8,
	darkvision=true,
	bravery=10,
	act_rate=12,
	attack_delay=10,
	shift_rate=26,
	quickness=130,
	base_power=210,
	instant_turn=true,
	armor=450,
	anti_fire=999,
	anti_poison=999,
	anti_desew=999,
	xp_factor=40,
	msg_handler=monster_msg_handler,
	on_move=monster_step,
	on_attack_close=monster_attack,
	on_attack_ranged=monster_missile,
	should_attack_ranged=threefourthsranged,
	prefer_ranged=true,
	attack_type=ATTACK_ANTI_MAGIC,
	attack_zonetable=ZT_TORSO_FEET_HITTABLE,
	missile_type=vexirk_missiles,
	door_opener="zospell",
	on_shot_missile_impact=zo_success_check,
	missile_power=200,
	hit_height=24,
	death_size=64,
	death_delta=4,
	escape=chaos_teleport,
	no_freeze=true,
	sees_invisible=true
}
obj.captain = {
    name="CAPTAIN ARMOR",
	type="MONSTER",
	class="HUMANOID",
	group_type=GT_KNIGHTS,
	size=1,
	col=true,
	no_bump=true,
	smart=true,
	counterattack=true,
	hp=60,
	front=gfx.knight_armour_front,
	side=gfx.knight_armour_side,
	back=gfx.knight_armour_back,
	attack=gfx.knight_armour_attack,
	perception=8,
	awareness=8,
	bravery=15,
	act_rate=5,
	attack_delay=-12,
	shift_rate=11,
	flip_rate=15,
	quickness=120,
	base_power=140,
	armor=190,
	anti_fire=999,
	anti_poison=999,
	anti_desew=999,
	xp_factor=10,
	msg_handler=monster_msg_handler,
	on_move=monster_step,
	on_die=setup_knight_drop,
	on_attack_close=monster_attack,
	on_incoming_impact=monster_dodge,
	step_sound=snd.step_knight,
	attack_sound=snd.swish,
	attack_type=ATTACK_PIERCING,
	attack_zonetable=ZT_TORSO,
	hit_height=24,
	death_size=16,
	death_delta=2
}
obj.passwiz = {
	name="WIZARD PASS",
	type="THING",
	class="MISC",
	mass=1,
	icon=gfx.icons[137],
	dungeon=gfx.rabbits_foot,
	max_throw_power=40,
	to_anywhere=apply_luck,
	from_anywhere=remove_luck,
	fit_pouch=true,
	go_thru_bars=true
}
obj.izual = {
    name="IZUAL",
	type="MONSTER",
	class="BOSS",
	group_type=GT_DEMONS,
	size=1,
	col=true,
	no_bump=true,
	smart=true,
	crafty=true,
	hover=true,
	hp=100,
	front=gfx.demon_front,
	side=gfx.demon_side,
	back=gfx.demon_back,
	attack=gfx.demon_attack,
	perception=7,
	awareness=7,
	darkvision=true,
	bravery=15,
	act_rate=5,
	attack_delay=2,
	shift_rate=12,
	flip_rate=9,
	quickness=120,
	base_power=200,
	armor=120,
	anti_fire=120,
	anti_poison=120,
	anti_desew=999,
	xp_factor=25,
	msg_handler=monster_msg_handler,
	on_move=monster_step,
	on_attack_close=monster_attack,
	on_attack_ranged=monster_missile,
	should_attack_ranged=halfranged,
	missile_type="fireball",
	door_opener="fireball",
	missile_power=250,
	on_incoming_impact=monster_dodge,
	step_sound=snd.step_footstep,
	attack_sound=snd.monster_haa,
	attack_type=ATTACK_PHYSICAL,
	attack_zonetable=ZT_HEAD_OR_TORSO_LOW,
	attack_show_duration=4,
	hit_height=24,
	death_size=24,
	death_delta=4,
	proj_stick=40
}