Changeset 8dad966 in network-game for common/Player.cpp


Ignore:
Timestamp:
Jun 3, 2013, 11:05:20 PM (12 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
d03ec0f
Parents:
8a4ed74
Message:

Added server support for player attack animations and cooldowns and firing projectiles for ranged attacks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/Player.cpp

    r8a4ed74 r8dad966  
    1616   this->pos.y = this->target.y = 0;
    1717   this->timeLastUpdated = 0;
     18   this->timeAttackStarted = 0;
     19   this->isAttacking = false;
    1820
    1921   this->playerClass = CLASS_NONE;
     
    2224   this->attackType = ATTACK_NONE;
    2325   this->damage = 0;
     26   this->attackCooldown = 0;
    2427   this->team = 0;   // blue team by default
    2528   this->hasBlueFlag = false;
     
    3841   this->target.y = p.target.y;
    3942   this->timeLastUpdated = p.timeLastUpdated;
     43   this->timeAttackStarted = p.timeAttackStarted;
     44   this->isAttacking = p.isAttacking;
    4045
    4146   this->playerClass = p.playerClass;
     
    4449   this->attackType = p.attackType;
    4550   this->damage = p.damage;
     51   this->attackCooldown = p.attackCooldown;
    4652   this->team = p.team;
    4753   this->hasBlueFlag = p.hasBlueFlag;
     
    5763   this->pos.x = this->target.x = 200;
    5864   this->pos.y = this->target.y = 200;
     65   this->timeLastUpdated = 0;
     66   this->timeAttackStarted = 0;
     67   this->isAttacking = false;
    5968
    6069   this->playerClass = CLASS_NONE;
     
    6372   this->attackType = ATTACK_NONE;
    6473   this->damage = 0;
     74   this->attackCooldown = 0;
    6575   this->team = 0;   // blue team by default
    6676   this->hasBlueFlag = false;
     
    8797      case CLASS_WARRIOR:
    8898         this->playerClass = CLASS_WARRIOR;
    89          this->maxHealth = this->health = 100;
     99         this->maxHealth = this->health = 120;
    90100         this->attackType = ATTACK_MELEE;
    91101         this->damage = 10;
     102         this->attackCooldown = 800;
    92103         break;
    93104      case CLASS_RANGER:
     
    96107         this->attackType = ATTACK_RANGED;
    97108         this->damage = 6;
     109         this->attackCooldown = 1000;
    98110         break;
    99111      case CLASS_NONE:
Note: See TracChangeset for help on using the changeset viewer.