﻿function Demon(point, name) {
	
    this.init(point, name);
    this.moveAmount = Demon.baseMoveAmount;
    this.smallMarker = new GMarker(this._curPoint, { icon: Demon.smallMapIcon, zIndexProcess: function(){return -50;} });
    this.setMarkerStanding();
}
Demon.inheritsFrom(Creature);

//Static properties
if(!DEBUG)Demon.baseMoveAmount = .00007;else Demon.baseMoveAmount = .0002;
Demon.maxHealth = 4;
Demon.value = 2; //Value of killing
Demon.damagePower = 2;

//Must use a function for this to create unique gif names
Demon.getDeathIcon = function(){
	var deadIcon = new GIcon(G_DEFAULT_ICON);
	deadIcon.shadow = "";
	deadIcon.image = "http://labs.ribaudio.com/herosquad/img/v2/blockmandie.gif?" + (++Creature.uniqueCount);
	deadIcon.iconSize = new GSize(40, 40);
	deadIcon.iconAnchor = new GPoint(25, 30);
	return deadIcon;
}

//Static icon properties
var smallMapIcon = new GIcon(G_DEFAULT_ICON);
smallMapIcon.image = "http://labs.ribaudio.com/herosquad/img/v2/blockmanmarker.png";
smallMapIcon.shadow = "";
smallMapIcon.iconSize = new GSize(15, 15);
smallMapIcon.iconAnchor = new GPoint(7, 7);
Demon.smallMapIcon = smallMapIcon;

var standingIcon = new GIcon(G_DEFAULT_ICON);
standingIcon.shadow = "http://labs.ribaudio.com/herosquad/img/v2/blockmanstand.png";
standingIcon.shadowSize = new GSize(30, 35);
standingIcon.image = Creature.imgHealth100;
standingIcon.iconSize = new GSize(30, 50);
standingIcon.iconAnchor = new GPoint(18, 34);
Demon.standingIcon = standingIcon;

var walkingIcon = new GIcon(G_DEFAULT_ICON);
walkingIcon.shadow = "http://labs.ribaudio.com/herosquad/img/v2/blockmanwalk.gif";
walkingIcon.shadowSize = new GSize(30, 35);
walkingIcon.image = Creature.imgHealth100;
walkingIcon.iconSize = new GSize(30, 50);
walkingIcon.iconAnchor = new GPoint(18, 34);
Demon.walkingIcon = walkingIcon;


//Instance methods
Demon.prototype.performActionAtTarget = function() {
    this.onExploded.fire();
}