Exemplo n.º 1
0
    static Quaternion rotationByType(Character shooter, Vector2 dir, CharacterSkillType skillType, int subType = 0)
    {
        int type = shooter.getSkillType(skillType);

        float angle = Vector2.Angle(new Vector2(1f, 0), dir);

        angle = dir.y > 0?angle:-angle;

        switch (type)
        {
        case 152:
            return(Quaternion.Euler(270, 0, 0));

        case 200:
            return(Quaternion.Euler(320, 90 - angle, 90));

        case 204:
            return(Quaternion.Euler(0, 0, 0));

        case 251:
            return(Quaternion.Euler(90, 0, 0));

        case 258:
            return(Quaternion.Euler(0, 90 - angle, 0));

        default:
            return(Quaternion.Euler(0, -angle, 0));
        }
    }
Exemplo n.º 2
0
	public void setData(int modifierType, int modifierSubType, CharacterSkillType skillType, float speed, float existTime, string prefabName) {
		this.modifierType = modifierType;
		this.modifierSubType = modifierSubType;
		this.skillType = skillType;
		this.speed = speed;
		this.existTime = existTime;
		this.prefabName = prefabName;
	}
Exemplo n.º 3
0
 public void setData(int modifierType, int modifierSubType, CharacterSkillType skillType, float speed, float existTime, string prefabName)
 {
     this.modifierType    = modifierType;
     this.modifierSubType = modifierSubType;
     this.skillType       = skillType;
     this.speed           = speed;
     this.existTime       = existTime;
     this.prefabName      = prefabName;
 }
Exemplo n.º 4
0
 public override void hit(Character other, CharacterSkillType skillType, int subType = 0)
 {
     if (this == null || other == null)
     {
         return;
     }
     base.hit(other, skillType, subType);
     other.gotHit(this, 10f);
 }
Exemplo n.º 5
0
 public override void hit(Character other, CharacterSkillType skillType, int subType = 0)
 {
     if (other == null)
     {
         return;
     }
     if (other.tag == "Player")
     {
     }
 }
Exemplo n.º 6
0
    void initByType(Character shooter, CharacterSkillType skillType, int subType = 0)
    {
        int            type = shooter.getSkillType(skillType);
        ProjectileData data = projectileTypes[type].projectileDatas[subType];

        type      = type;
        speed     = data.speed;
        existTime = data.existTime;
        subType   = subType;
    }
Exemplo n.º 7
0
 public SkillEntry(CharacterSkillType type, int level, bool isAllowed)
 {
     this.level = level;
     this.name  = type.ToString();
     if (type == CharacterSkillType.LaborEnd)
     {
         this.name = "Hauling";
     }
     this.type      = type;
     this.isAllowed = isAllowed;
 }
Exemplo n.º 8
0
    static GameObject objectByType(Character shooter, CharacterSkillType skillType, int subType = 0)
    {
        Modifier modifier;

        int        type = shooter.getSkillType(skillType);
        GameObject obj  = null;
        Projectile pro  = null;

        obj = (GameObject)Instantiate(Resources.Load(projectileTypes[type].projectileDatas[subType].prefabName));
        return(obj);
    }
Exemplo n.º 9
0
    static void InitByType(ref Projectile projectile, Character shooter, CharacterSkillType skillType, int subType = 0)
    {
        int            type = shooter.getSkillType(skillType);
        ProjectileData data = projectileTypes[type].projectileDatas[subType];

        projectile.type      = type;
        projectile.speed     = data.speed;
        projectile.existTime = data.existTime;
        projectile.subType   = subType;

        if (type == 251 || type == 258)
        {
            projectile.clearHit = true;
        }
    }
Exemplo n.º 10
0
    public static Projectile ShootProjectile(Character shooter, Vector2 dir, CharacterSkillType skillType, int subType = 0)
    {
        Vector3 pos = shooter.transform.position;

        if (shooter.getSkillType(skillType) != 152)
        {
            pos.x += dir.x * 3f;
            pos.z += dir.y * 3f;
        }
        else
        {
            pos.x -= dir.x * 3f;
            pos.z -= dir.y * 3f;
        }
        return(ShootProjectile(shooter, dir, pos, skillType, subType));
    }
Exemplo n.º 11
0
	public int getSkillType(CharacterSkillType skillType) {
		switch (skillType) {
		case CharacterSkillType.Attack:
			return attackModifier.type;
		case CharacterSkillType.ChargedAttack:
			return chargedAttackModifier.type;
		case CharacterSkillType.Dodge:
			return dodgeModifier.type;
		case CharacterSkillType.Block:
			return blockModifier.type;
		case CharacterSkillType.Active1:
			return ((ActiveModifier)activeSkills[0]).type;
		case CharacterSkillType.Active2:
			return ((ActiveModifier)activeSkills[1]).type;
		}
		return 0;
	}
Exemplo n.º 12
0
    public void init(Character shooter, Vector2 dir, Vector3 pos, CharacterSkillType skillType, int subType = 0)
    {
        transform.position = pos;
        initByType(shooter, skillType, subType);

        hitByThis = new ArrayList();
        shooter   = shooter;
        direction = dir;
        skillType = skillType;

        transform.rotation = rotationByType(shooter, dir, skillType, subType);

        if (type == 204)
        {
            Physics.IgnoreCollision(GetComponent <Collider>(), shooter.GetComponent <Collider>());
        }

        Destroy(this.gameObject, existTime);
    }
Exemplo n.º 13
0
    public int getSkillType(CharacterSkillType skillType)
    {
        switch (skillType)
        {
        case CharacterSkillType.Attack:
            return(attackModifier.type);

        case CharacterSkillType.ChargedAttack:
            return(chargedAttackModifier.type);

        case CharacterSkillType.Dodge:
            return(dodgeModifier.type);

        case CharacterSkillType.Block:
            return(blockModifier.type);

        case CharacterSkillType.Active1:
            return(((ActiveModifier)activeSkills[0]).type);

        case CharacterSkillType.Active2:
            return(((ActiveModifier)activeSkills[1]).type);
        }
        return(0);
    }
Exemplo n.º 14
0
	static Quaternion rotationByType(Character shooter, Vector2 dir, CharacterSkillType skillType, int subType = 0) {
		int type = shooter.getSkillType(skillType);

		float angle = Vector2.Angle(new Vector2(1f, 0), dir); 
		angle = dir.y>0?angle:-angle;

		switch(type) {
		case 152:
			return Quaternion.Euler(270, 0, 0);
		case 200:
			return Quaternion.Euler(320, 90-angle, 90);
		case 204:
			return Quaternion.Euler(0,0,0);
		case 251:
			return Quaternion.Euler(90, 0, 0);
		case 258:
			return Quaternion.Euler(0, 90-angle, 0);
		default:
			return Quaternion.Euler(0, -angle, 0);
		}
			
	}
Exemplo n.º 15
0
	public virtual void hit(Character other, CharacterSkillType skillType, int subType = 0) {

	}
Exemplo n.º 16
0
 Projectile(Character shooter, Vector2 dir, CharacterSkillType type)
 {
     this.shooter   = shooter;
     this.direction = dir;
     this.skillType = type;
 }
Exemplo n.º 17
0
	public void init(Character shooter, Vector2 dir, Vector3 pos, CharacterSkillType skillType, int subType = 0) {
		transform.position = pos;
		initByType(shooter, skillType, subType);

		hitByThis = new ArrayList();
		shooter = shooter;
		direction = dir;
		skillType = skillType;

		transform.rotation = rotationByType(shooter, dir, skillType, subType);

		if(type == 204) {
			Physics.IgnoreCollision(GetComponent<Collider>(), shooter.GetComponent<Collider>());
		}

		Destroy(this.gameObject, existTime);
	}
Exemplo n.º 18
0
 public SkillEntry(CharacterSkillType type, int level, bool isAllowed)
 {
     this.level = level;
     this.name = type.ToString();
     if (type == CharacterSkillType.LaborEnd) this.name = "Hauling";
     this.type = type;
     this.isAllowed = isAllowed;
 }
Exemplo n.º 19
0
 public virtual void hit(Character other, CharacterSkillType skillType, int subType = 0)
 {
 }
Exemplo n.º 20
0
	Projectile(Character shooter, Vector2 dir, CharacterSkillType type) {
		this.shooter = shooter;
		this.direction = dir;
		this.skillType = type;
	}
Exemplo n.º 21
0
    public override void hit(Character other, CharacterSkillType skillType, int subType = 0)
    {
        if (other == null)
        {
            return;
        }
        if (other.tag == "TempEnemy")
        {
            //TempEnemy temp = (TempEnemy) other;
            Character temp = (Character)other;
            switch (skillType)
            {
            case CharacterSkillType.Attack:
                temp.status.hp -= attackModifier.damage[subType];
                if (attackModifier.negativeEffectCount > 0)
                {
                    for (int a = 0; a != attackModifier.negativeEffectCount; ++a)
                    {
                        other.applyTemporaryEffect(attackModifier.negativeEffects[a]);
                    }
                }
                break;

            case CharacterSkillType.ChargedAttack:
                temp.status.hp -= chargedAttackModifier.damage[subType];
                break;

            case CharacterSkillType.Dodge:
                if (dodgeModifier.negativeEffectCount > 0)
                {
                    for (int a = 0; a != dodgeModifier.negativeEffectCount; ++a)
                    {
                        other.applyTemporaryEffect(dodgeModifier.negativeEffects[a]);
                    }
                }
                break;

            case CharacterSkillType.Active1: {
                ActiveModifier mod = (ActiveModifier)activeSkills[0];
                temp.status.hp -= mod.damage[0];
                if (mod.negativeEffectCount > 0)
                {
                    for (int a = 0; a != mod.negativeEffectCount; ++a)
                    {
                        other.applyTemporaryEffect(mod.negativeEffects[a]);
                    }
                }
                break;
            }

            case CharacterSkillType.Active2: {
                ActiveModifier mod = (ActiveModifier)activeSkills[1];
                temp.status.hp -= mod.damage[0];
                if (mod.negativeEffectCount > 0)
                {
                    for (int a = 0; a != mod.negativeEffectCount; ++a)
                    {
                        other.applyTemporaryEffect(mod.negativeEffects[a]);
                    }
                }
                break;
            }
            }
        }
    }
Exemplo n.º 22
0
	public static Projectile ShootProjectile(Character shooter, Vector2 dir, Vector3 pos, CharacterSkillType skillType, int subType = 0) {
		GameObject obj = objectByType(shooter, skillType, subType); //(GameObject)Instantiate(Resources.Load("Prefabs/CubeBullet"), pos, Quaternion.identity);
		obj.transform.position = pos;
		Projectile ans = obj.GetComponent<Projectile>();
		if(ans == null) ans = obj.GetComponentInChildren<Projectile>();
		InitByType(ref ans, shooter, skillType, subType);

		ans.hitByThis = new ArrayList();
		ans.shooter = shooter;
		ans.direction = dir;
		ans.skillType = skillType;

		switch(skillType) {
		case CharacterSkillType.Attack:
			ans.modifier = shooter.attackModifier;
			break;
		case CharacterSkillType.ChargedAttack:
			ans.modifier = shooter.chargedAttackModifier;
			break;
		case CharacterSkillType.Block:
			ans.modifier = shooter.blockModifier;
			break;
		case CharacterSkillType.Dodge:
			ans.modifier = shooter.dodgeModifier;
			break;
		case CharacterSkillType.Active1:
			ans.modifier = (ActiveModifier)shooter.activeSkills[0];
			break;
		case CharacterSkillType.Active2:
			ans.modifier = (ActiveModifier)shooter.activeSkills[1];
			break;
		}

		obj.transform.rotation = rotationByType(shooter, dir, skillType, subType);

		if(ans.type == 204) {
			Physics.IgnoreCollision(ans.GetComponent<Collider>(), shooter.GetComponent<Collider>());
		}

		Destroy(obj, ans.existTime);
		return ans;
	}
Exemplo n.º 23
0
    public static Projectile ShootProjectile(Character shooter, Vector2 dir, Vector3 pos, CharacterSkillType skillType, int subType = 0)
    {
        GameObject obj = objectByType(shooter, skillType, subType);         //(GameObject)Instantiate(Resources.Load("Prefabs/CubeBullet"), pos, Quaternion.identity);

        obj.transform.position = pos;
        Projectile ans = obj.GetComponent <Projectile>();

        if (ans == null)
        {
            ans = obj.GetComponentInChildren <Projectile>();
        }
        InitByType(ref ans, shooter, skillType, subType);

        ans.hitByThis = new ArrayList();
        ans.shooter   = shooter;
        ans.direction = dir;
        ans.skillType = skillType;

        switch (skillType)
        {
        case CharacterSkillType.Attack:
            ans.modifier = shooter.attackModifier;
            break;

        case CharacterSkillType.ChargedAttack:
            ans.modifier = shooter.chargedAttackModifier;
            break;

        case CharacterSkillType.Block:
            ans.modifier = shooter.blockModifier;
            break;

        case CharacterSkillType.Dodge:
            ans.modifier = shooter.dodgeModifier;
            break;

        case CharacterSkillType.Active1:
            ans.modifier = (ActiveModifier)shooter.activeSkills[0];
            break;

        case CharacterSkillType.Active2:
            ans.modifier = (ActiveModifier)shooter.activeSkills[1];
            break;
        }

        obj.transform.rotation = rotationByType(shooter, dir, skillType, subType);

        if (ans.type == 204)
        {
            Physics.IgnoreCollision(ans.GetComponent <Collider>(), shooter.GetComponent <Collider>());
        }

        Destroy(obj, ans.existTime);
        return(ans);
    }
Exemplo n.º 24
0
	public override void hit(Character other, CharacterSkillType skillType, int subType = 0) {
		if(other == null) return;
		if(other.tag == "Player") {
			
		}
	}
Exemplo n.º 25
0
	public static Projectile ShootProjectile(Character shooter, Vector2 dir, CharacterSkillType skillType, int subType = 0) {
		Vector3 pos = shooter.transform.position;
		if(shooter.getSkillType(skillType) != 152) {
			pos.x += dir.x * 3f;
			pos.z += dir.y * 3f;
		} else {
			pos.x -= dir.x * 3f;
			pos.z -= dir.y * 3f;
		}
		return ShootProjectile(shooter, dir, pos, skillType, subType);
	}
Exemplo n.º 26
0
	static GameObject objectByType(Character shooter, CharacterSkillType skillType, int subType = 0) {
		Modifier modifier;

		int type = shooter.getSkillType(skillType);
		GameObject obj = null;
		Projectile pro = null;

		obj = (GameObject)Instantiate(Resources.Load(projectileTypes[type].projectileDatas[subType].prefabName));
		return obj;
	}
Exemplo n.º 27
0
	public override void hit(Character other, CharacterSkillType skillType, int subType = 0) {
		if(other == null) return;
		if(other.tag == "TempEnemy") {
			//TempEnemy temp = (TempEnemy) other;
			Character temp = (Character) other;
			switch(skillType) {
			case CharacterSkillType.Attack:
				temp.status.hp -= attackModifier.damage[subType];
				if(attackModifier.negativeEffectCount > 0) {
					for(int a=0;a!=attackModifier.negativeEffectCount;++a) {
						other.applyTemporaryEffect(attackModifier.negativeEffects[a]);
					}
				}
				break;
			case CharacterSkillType.ChargedAttack: 
				temp.status.hp -= chargedAttackModifier.damage[subType];
				break;
			case CharacterSkillType.Dodge:
				if(dodgeModifier.negativeEffectCount > 0) {
					for(int a=0;a!=dodgeModifier.negativeEffectCount;++a) {
						other.applyTemporaryEffect(dodgeModifier.negativeEffects[a]);
					}
				}
				break;
			case CharacterSkillType.Active1: {
				ActiveModifier mod = (ActiveModifier)activeSkills[0];
				temp.status.hp -= mod.damage[0];
				if(mod.negativeEffectCount > 0) {
					for(int a=0;a!=mod.negativeEffectCount;++a) {
						other.applyTemporaryEffect(mod.negativeEffects[a]);
					}
				}
				break;
				}
			case CharacterSkillType.Active2: {
					ActiveModifier mod = (ActiveModifier)activeSkills[1];
					temp.status.hp -= mod.damage[0];
					if(mod.negativeEffectCount > 0) {
						for(int a=0;a!=mod.negativeEffectCount;++a) {
							other.applyTemporaryEffect(mod.negativeEffects[a]);
						}
					}
					break;
				}
			}
		}
	}
Exemplo n.º 28
0
	void initByType(Character shooter, CharacterSkillType skillType, int subType = 0) {
		int type = shooter.getSkillType(skillType);
		ProjectileData data = projectileTypes[type].projectileDatas[subType];

		type = type;
		speed = data.speed;
		existTime = data.existTime;
		subType = subType;
	}
Exemplo n.º 29
0
	public override void hit (Character other, CharacterSkillType skillType, int subType = 0)
	{
		if(this == null || other == null) return;
		base.hit (other, skillType, subType);
		other.gotHit(this, 5f);
	}
Exemplo n.º 30
0
	static void InitByType(ref Projectile projectile, Character shooter, CharacterSkillType skillType, int subType = 0) {
		int type = shooter.getSkillType(skillType);
		ProjectileData data = projectileTypes[type].projectileDatas[subType];

		projectile.type = type;
		projectile.speed = data.speed;
		projectile.existTime = data.existTime;
		projectile.subType = subType;

		if(type == 251 || type == 258) {
			projectile.clearHit = true;
		}
	}