Caravaneer 2 Wiki
Advertisement

From: IsoEngine.Character[]

public function get learningCapacity() : *
      {
         return this.intelligence / 7;
      }

hence 14.3 % learning capacity per int

public function reduceAP(param1:*) : *
      {
         this.AP -= param1;
         this.generalBattleExperience += param1 * (0.5 + this.learningCapacity * 0.5);
      }

Note : here experience gain is non linear with learning capacity

example : 1 int character vs 10 int character

per 10 AP

first character gets 10*(0.5+0.143*0.5) = 5.715 BattleExperience

second character gets 10*(0.5+1.43*0.5) = 12.15 BattleExperience

From : IsoEngine.School[]

//From:

//private function takePersonBack() :

for(_loc1_ in this.experiences)
         {
            this.selectedTarget[this.experiences[_loc1_].experience] += this.experiences[_loc1_].amount * _loc3_ / 86400 * this.selectedTarget.learningCapacity;
         }

where : loc1 is one experience type & loc3 is game time spent studying

Note : here experience gain is linear with learning Capacity

From : IsoEngine.BattleField[]

//From :

//public function startAttack(param1:*, param2:*) :

Notable Lines :[]

 param1.flamethrowerExperience += param1.weaponModeAP() / 5 * param1.learningCapacity;

Note : here experience gain is linear with learning Capacity & AP spent

//Please add collapse here if you can

  public function Attack(param1:*) : *
      {
         var _loc2_:* = undefined;
         var _loc3_:* = undefined;
         var _loc4_:* = undefined;
         var _loc5_:* = undefined;
         var _loc6_:* = undefined;
         var _loc7_:* = undefined;
         var _loc8_:* = undefined;
         var _loc9_:* = undefined;
         var _loc10_:* = undefined;
         var _loc11_:* = undefined;
         var _loc12_:* = undefined;
         var _loc13_:* = undefined;
         var _loc14_:* = undefined;
         var _loc15_:* = undefined;
         var _loc16_:* = undefined;
         var _loc17_:* = undefined;
         var _loc18_:* = undefined;
         var _loc19_:* = undefined;
         var _loc20_:* = undefined;
         var _loc21_:* = undefined;
         var _loc22_:* = undefined;
         var _loc23_:* = undefined;
         var _loc24_:* = undefined;
         var _loc25_:* = undefined;
         var _loc26_:* = undefined;
         var _loc27_:* = undefined;
         var _loc28_:* = undefined;
         var _loc29_:* = undefined;
         var _loc30_:* = undefined;
         var _loc31_:* = undefined;
         var _loc32_:* = undefined;
         _loc7_ = WeaponsData.detectWeaponSkill(param1.currentWeaponData);
         if(param1.currentWeaponType.category != 0 && param1.currentWeaponType.category != 1)
         {
            this.playAttackSound(param1);
         }
         switch(param1.currentWeaponType.category)
         {
            case 0:
            case 1:
               param1[_loc7_ + "Experience"] += param1.weaponModeAP() / 5;
               param1.closeBattleExperience += param1.learningCapacity;
               this.theAttacked.dodgeExperience += 0.5 * this.theAttacked.learningCapacity;
               if(Math.random() <= this.calculateHitChance(param1,this.theAttacked))
               {
                  this.playAttackSound(param1);
                  _loc15_ = this.calculateHitDamage(param1,this.theAttacked);
                  this.theAttacked.bleeding += _loc15_ * param1.currentWeaponData.openWoundCoeficient * 3;
                  if(this.difficulty == 2)
                  {
                     this.theAttacked.bleeding += _loc15_ * param1.currentWeaponData.openWoundCoeficient * 3;
                  }
                  this.Hit(this.theAttacked,_loc15_,param1.x,param1.y);
                  param1[_loc7_ + "Experience"] += 0.5;
               }
               else
               {
                  this.theAttacked.dodgeExperience += this.theAttacked.learningCapacity;
               }
               break;
            case 2:
               if(param1.currentAmmo.amount > 0)
               {
                  param1.rangedWeaponsExperience += param1.weaponModeAP() / 5 * param1.learningCapacity;
                  param1[_loc7_ + "Experience"] += param1.weaponModeAP() / 5;
                  _loc4_ = this.calculateMaxShotOffset(this.ActList[this.nowActing]);
                  _loc5_ = this.aimAngle - _loc4_ + Math.random() * _loc4_ * 2;
                  if(param1.currentWeaponMode.parallelShots > 1)
                  {
                     _loc16_ = param1.currentWeaponMode.parallelShots;
                  }
                  else
                  {
                     _loc16_ = 1;
                  }
                  _loc3_ = 1;
                  while(_loc3_ <= _loc16_)
                  {
                     if(param1.currentAmmo.amount > 0)
                     {
                        if(param1.currentAmmo.shotgunAmmo && param1.currentAmmoData.pallets > 1)
                        {
                           _loc17_ = this.ActList[this.nowActing].currentWeaponData.spread * (1 + this.ActList[this.nowActing].attachmentsEffects(this.ActList[this.nowActing].currSlot).spread / 10);
                           _loc18_ = _loc5_ - _loc17_ / 2;
                           _loc19_ = _loc17_ / (this.ActList[this.nowActing].currentAmmoData.pallets - 1);
                           _loc2_ = 0;
                           while(_loc2_ < this.ActList[this.nowActing].currentAmmoData.pallets)
                           {
                              this.fireProjectile(_loc18_ + _loc19_ * _loc2_,"bullet");
                              _loc2_++;
                           }
                        }
                        else
                        {
                           this.fireProjectile(_loc5_,"bullet");
                        }
                        if(param1.currentWeaponData.ammo == 17)
                        {
                           --param1.caravan.money;
                        }
                        else
                        {
                           --param1.loadedAmmo[param1.currSlot].amount;
                           this.useCurrentAmmo(param1,1);
                        }
                        this.updateInterface();
                     }
                     _loc3_++;
                  }
               }
               break;
            case 3:
               if(param1.loadedAmmo[param1.currSlot].amount > 0)
               {
                  param1.rangedWeaponsExperience += param1.weaponModeAP() / 5 * param1.learningCapacity;
                  param1[_loc7_ + "Experience"] += param1.weaponModeAP() / 5;
                  _loc4_ = this.calculateMaxShotOffset(this.ActList[this.nowActing]);
                  _loc5_ = this.aimAngle - _loc4_ + Math.random() * _loc4_ * 2;
                  _loc6_ = this.flyingProjectiles.push(new Projectile()) - 1;
                  this.flyingProjectiles[_loc6_].ammoType = this.ActList[this.nowActing].currentAmmo.subCategory;
                  this.flyingProjectiles[_loc6_].explosive = this.ActList[this.nowActing].currentAmmoData.explosive;
                  this.flyingProjectiles[_loc6_].FF = this.ActList[this.nowActing].currentAmmoData.FF;
                  this.flyingProjectiles[_loc6_].explosiveness = this.ActList[this.nowActing].currentAmmoData.explosiveness;
                  this.flyingProjectiles[_loc6_].antiPersonnel = this.ActList[this.nowActing].currentAmmoData.antiPersonnel;
                  this.flyingProjectiles[_loc6_].firedBy = this.ActList[this.nowActing];
                  this.flyingProjectiles[_loc6_].prevX = this.flyingProjectiles[_loc6_].x = param1.x + 21 * Math.sin(_loc5_);
                  this.flyingProjectiles[_loc6_].prevY = this.flyingProjectiles[_loc6_].y = param1.y + 21 * Math.cos(_loc5_);
                  this.flyingProjectiles[_loc6_].z = 40;
                  this.flyingProjectiles[_loc6_].speed = this.ActList[this.nowActing].currentWeaponData.arrowSpeed;
                  this.flyingProjectiles[_loc6_].direction = _loc5_;
                  _loc20_ = 0;
                  _loc21_ = 0;
                  switch(this.ActList[this.nowActing].currentAmmoData.type)
                  {
                     case 4:
                        if(Math.random() < 0.5)
                        {
                           _loc32_ = false;
                           for(_loc2_ in this.DroppedBolts)
                           {
                              if(this.DroppedBolts[_loc2_].type == param1.loadedAmmo[param1.currSlot].type)
                              {
                                 ++this.DroppedBolts[_loc2_].amount;
                                 _loc32_ = true;
                                 break;
                              }
                           }
                           if(!_loc32_)
                           {
                              this.DroppedBolts.push(new Item(param1.loadedAmmo[param1.currSlot].type,1));
                           }
                        }
                        _loc22_ = (_loc26_ = this.map2Screen(Math.sin(_loc5_) * 10,Math.cos(_loc5_) * 10)).x;
                        _loc23_ = _loc26_.y;
                        if(_loc22_ < 0)
                        {
                           _loc20_ = 0 - _loc22_;
                           _loc22_ = 0;
                        }
                        if(_loc23_ < 0)
                        {
                           _loc21_ = 0 - _loc23_;
                           _loc23_ = 0;
                        }
                        _loc24_ = 0 - Math.max(_loc20_,_loc22_) / 2;
                        _loc25_ = 0 - Math.max(_loc21_,_loc23_) / 2;
                        (_loc30_ = new Sprite()).graphics.lineStyle(1,0);
                        _loc30_.graphics.moveTo(_loc20_,_loc21_);
                        _loc30_.graphics.lineTo(_loc22_,_loc23_);
                        (_loc29_ = new BitmapData(Math.round(Math.max(_loc20_,_loc22_)) + 1,Math.round(Math.max(_loc21_,_loc23_)) + 1,true,0)).draw(_loc30_);
                        _loc27_ = new Bitmap(_loc29_);
                        (_loc30_ = new Sprite()).graphics.lineStyle(1,0,0.5);
                        _loc30_.graphics.moveTo(_loc20_,_loc21_);
                        _loc30_.graphics.lineTo(_loc22_,_loc23_);
                        (_loc29_ = new BitmapData(Math.round(Math.max(_loc20_,_loc22_)) + 1,Math.round(Math.max(_loc21_,_loc23_)) + 1,true,0)).draw(_loc30_);
                        _loc28_ = new Bitmap(_loc29_);
                        break;
                     case 6:
                     case 13:
                        if((_loc31_ = Math.round((Math.PI - _loc5_) / (Math.PI / 8))) < 0)
                        {
                           _loc31_ += 16;
                        }
                        (_loc29_ = new BitmapData(15,15,true,0)).copyPixels(this.RocketImage,new Rectangle(0,_loc31_ * 15,15,15),new Point(0,0));
                        _loc27_ = new Bitmap(_loc29_);
                        (_loc29_ = new BitmapData(15,15,true,0)).copyPixels(this.RocketShadow,new Rectangle(0,_loc31_ * 15,15,15),new Point(0,0));
                        _loc28_ = new Bitmap(_loc29_);
                        _loc24_ = -7.5;
                        _loc25_ = -7.5;
                  }
                  _loc27_.x = _loc24_;
                  _loc27_.y = _loc25_;
                  _loc28_.x = _loc24_;
                  _loc28_.y = _loc25_;
                  this.flyingProjectiles[_loc6_].ownContainer = new Sprite();
                  this.flyingProjectiles[_loc6_].ownContainer.addChild(_loc27_);
                  this.flyingProjectiles[_loc6_].Shadow = new Sprite();
                  this.flyingProjectiles[_loc6_].Shadow.addChild(_loc28_);
                  --param1.loadedAmmo[param1.currSlot].amount;
                  this.useCurrentAmmo(param1,1);
                  this.updateInterface();
               }
               break;
            case 5:
               param1.throwExperience += param1.learningCapacity;
               _loc6_ = this.flyingGrenades.push(new Projectile()) - 1;
               this.flyingGrenades[_loc6_].prevX = this.flyingGrenades[_loc6_].x = param1.x;
               this.flyingGrenades[_loc6_].prevY = this.flyingGrenades[_loc6_].y = param1.y;
               this.flyingGrenades[_loc6_].z = this.initialGrenadeHeight * pixelsPerMeter;
               this.flyingGrenades[_loc6_].frame = 1;
               this.flyingGrenades[_loc6_].counter = param1.currentWeaponData.delay * stage.frameRate;
               this.flyingGrenades[_loc6_].firedBy = param1;
               this.flyingGrenades[_loc6_].explosiveness = param1.currentWeaponData.explosiveness;
               this.flyingGrenades[_loc6_].antiPersonnel = param1.currentWeaponData.antiPersonnel;
               this.flyingGrenades[_loc6_].explodeOnImpact = param1.currentWeaponData.explodeOnImpact;
               this.flyingGrenades[_loc6_].flame = param1.currentWeaponData.flame;
               _loc8_ = 1 / param1.throwingAccuracy * 4;
               if(Math.random() < 0.5)
               {
                  _loc8_ = 0 - _loc8_;
               }
               _loc9_ = MathFunctions.CalcDistance(param1.x,param1.y,param1.throwGrenadeAt.x,param1.throwGrenadeAt.y) / pixelsPerMeter * (1 - Math.random() * _loc8_);
               _loc9_ = Math.min(_loc9_,param1.maxThrowDistance(this.initialGrenadeHeight,this.grenadeAngle));
               _loc9_ = Math.max(_loc9_,0);
               _loc10_ = Math.sqrt((this.initialGrenadeHeight + _loc9_ * Math.tan(this.grenadeAngle)) / 4.9);
               _loc11_ = _loc9_ / (Math.cos(this.grenadeAngle) * _loc10_);
               this.flyingGrenades[_loc6_].zSpeed = _loc11_ * Math.sin(this.grenadeAngle);
               _loc12_ = 1 / param1.throwingAccuracy * 5;
               if(Math.random() < 0.5)
               {
                  _loc12_ = 0 - _loc12_;
               }
               _loc13_ = MathFunctions.CalcAngle(param1.x,param1.y,param1.throwGrenadeAt.x,param1.throwGrenadeAt.y) + Math.random() * _loc12_;
               _loc14_ = _loc11_ * Math.cos(this.grenadeAngle);
               this.flyingGrenades[_loc6_].xSpeed = _loc14_ * Math.sin(_loc13_);
               this.flyingGrenades[_loc6_].ySpeed = _loc14_ * Math.cos(_loc13_);
         }
      }

//end collapse

Notable lines :[]

param1.rangedWeaponsExperience += param1.weaponModeAP() / 5 * param1.learningCapacity;

Note : here experience gain is linear with learning Capacity & AP spent

param1.closeBattleExperience += param1.learningCapacity;


Note: here experience gain is linear with learning Capacity Only (and number of hits)

//Please add collapse here if you can

      public function Hit(param1:*, param2:*, param3:* = null, param4:* = null, param5:* = true, param6:* = 1) : *
      {
         var _loc7_:* = undefined;
         var _loc8_:* = undefined;
         var _loc9_:* = undefined;
         var _loc10_:* = undefined;
         var _loc11_:* = undefined;
         var _loc12_:Sound = null;
         var _loc13_:Class = null;
         var _loc14_:* = undefined;
         var _loc15_:* = undefined;
         var _loc16_:* = undefined;
         if(GameData.soundFXOn)
         {
            if(param1.gender == 1)
            {
               _loc13_ = getDefinitionByName("SFXMaleGrunt" + MathFunctions.random(1,10)) as Class;
            }
            else
            {
               _loc13_ = getDefinitionByName("SFXFemaleGrunt" + MathFunctions.random(1,10)) as Class;
            }
            _loc12_ = new _loc13_() as Sound;
            this.playSoundAt(_loc12_,param1.x,param1.y,0.7);
         }
         if(param1.HP > 0)
         {
            if(param6 == 1)
            {
               this.generateMessage(param1,"got hit",param2);
            }
            if(param6 == 2)
            {
               this.generateMessage(param1,"bleeding",param2);
            }
            if(param6 == 3)
            {
               this.generateMessage(param1,"burning",param2);
            }
         }
         if(param3 != null && param4 != null)
         {
            param1.lookAt(param3,param4);
         }
         _loc8_ = MathFunctions.CalcAngle(param3,param4,param1.x,param1.y);
         _loc9_ = Math.min(Math.round(param2 * 4),1000);
         if(param5)
         {
            _loc7_ = 1;
            while(_loc7_ <= _loc9_)
            {
               _loc14_ = Math.pow(Math.random(),2) * 0.8;
               if(Math.random() < 0.5)
               {
                  _loc11_ = _loc8_ - _loc14_;
               }
               else
               {
                  _loc11_ = _loc8_ + _loc14_;
               }
               _loc10_ = Math.pow(Math.random(),2) * (0.8 - _loc14_) * 8;
               param1.bloodDrops.push({
                  "x":param1.x,
                  "y":param1.y,
                  "z":40,
                  "xSpeed":Math.sin(_loc11_) * _loc10_,
                  "ySpeed":Math.cos(_loc11_) * _loc10_,
                  "zSpeed":0,
                  "container":this.generateBloodDrop()
               });
               _loc7_++;
            }
         }
         param1.HP -= param2;
         param1.painExperience += param2 * param1.learningCapacity;
         if(param1.HP / param1.maxHP < param1.painThreshold)
         {
            param1.battleMorale -= param2 * 0.5;
         }
         if(param1.HP <= 0)
         {
            if(param1.animationPhase != 4)
            {
               this.generateMessage(param1,"die");
            }
            param1.applyPhaseAndFrame = {
               "phase":4,
               "frame":1
            };
            _loc15_ = 0;
            for(_loc7_ in this.Characters)
            {
               if(!this.Characters[_loc7_].dead && this.Characters[_loc7_].HP > 0 && this.Characters[_loc7_].band == param1.band)
               {
                  _loc15_++;
               }
            }
            if(param1.band == 2 || param1.band == 1)
            {
               for(_loc7_ in this.Characters)
               {
                  if(!this.Characters[_loc7_].dead && this.Characters[_loc7_].HP > 0)
                  {
                     if(this.Characters[_loc7_].band == param1.band)
                     {
                        this.Characters[_loc7_].battleMorale -= 10 / _loc15_;
                     }
                     else if(this.Characters[_loc7_].band == 2 || this.Characters[_loc7_].band == 1)
                     {
                        this.Characters[_loc7_].battleMorale += 10 / _loc15_;
                     }
                  }
               }
            }
            this.updateInterface();
         }
         else
         {
            _loc16_ = 6;
            if(this.difficulty == 1)
            {
               _loc16_ = 10;
            }
            if(!this.itsAHeadShot && param6 == 1 && !this.damageCaused && param5 && !param1.legDamage && Math.pow(Math.random(),_loc16_) > 1 / Math.pow(param2,0.1))
            {
               param1.legDamage = true;
               this.generateMessage(param1,"leg damage");
               this.damageCaused = true;
            }
            if(!this.succesfulHeadShot && param6 == 1 && !this.damageCaused && param5 && !param1.armDamage && Math.pow(Math.random(),_loc16_) > 1 / Math.pow(param2,0.1))
            {
               param1.armDamage = true;
               this.generateMessage(param1,"arm damage");
               this.damageCaused = true;
            }
            _loc16_ = 8;
            if(this.difficulty == 1)
            {
               _loc16_ = 12;
            }
            if(this.succesfulHeadShot)
            {
               _loc16_ /= 1.5;
            }
            if(!this.damageCaused && param6 == 1 && param5 && !param1.eyeDamage && Math.pow(Math.random(),_loc16_) > 1 / Math.pow(param2,0.1))
            {
               param1.eyeDamage = true;
               this.generateMessage(param1,"eye damage");
               this.damageCaused = true;
            }
            if(param1.animationPhase == 0)
            {
               param1.applyPhaseAndFrame = {
                  "phase":3,
                  "frame":1
               };
            }
            if(param1 == this.ActList[this.nowActing])
            {
               this.updateInterface();
            }
         }
      }

//end collapse

Notable lines :[]

//Please add collapse here if you can

      public function heal(param1:*) : *
      {
         var _loc2_:* = undefined;
         _loc2_ = Math.round(this.ActList[this.nowActing].firstAidSkill / 200 * Item.getDataFromType(this.ActList[this.nowActing].selectedFirstAidType).heal);
         this.generateMessage(param1,"heal",Math.min(_loc2_,Math.ceil(param1.bleeding)));
         this.ActList[this.nowActing].firstAidExperience += this.ActList[this.nowActing].learningCapacity;
         this.ActList[this.nowActing].lookAt(param1.x,param1.y);
         param1.bleeding -= _loc2_;
         if(param1.bleeding < 0.5)
         {
            param1.bleeding = 0;
         }
         this.ActList[this.nowActing].reduceItemFromEquipment(this.ActList[this.nowActing].selectedFirstAidType,1);
         this.ActList[this.nowActing].updateFirstAid();
         this.healingMode = false;
         this.ActList[this.nowActing].reduceAP(this.ActList[this.nowActing].healAP);
         if(this.ActList[this.nowActing].AP <= 0)
         {
            this.ActList[this.nowActing].AP = 0;
            this.nextTurn();
         }
         else
         {
            this.updateInterface();
         }
      }

//end collapse

Notable lines :[]

this.ActList[this.nowActing].firstAidExperience += this.ActList[this.nowActing].learningCapacity;

Note : here experience gain is linear with learning Capacity

 _loc2_ = Math.round(this.ActList[this.nowActing].firstAidSkill / 200 * Item.getDataFromType(this.ActList[this.nowActing].selectedFirstAidType).heal);


extra note : medkit shop rated healing is at 200 First Aid skill and scales linearly with it

From : IsoEngine.Caravan[]

public function distributeExperience(param1:*, param2:*, param3:*) : *
      {
         var _loc4_:* = undefined;
         var _loc5_:* = undefined;
         var _loc6_:* = undefined;
         _loc6_ = new Array();
         for(_loc4_ in this.People)
         {
            if(this.People[_loc4_].category != 4)
            {
               _loc6_.push({
                  "person":this.People[_loc4_],
                  "skill":this.People[_loc4_][param1]
               });
            }
         }
         _loc6_.sortOn("skill",16 | 2);
         for(_loc5_ in _loc6_)
         {
            if(_loc6_[_loc5_].person.category == 3)
            {
               _loc6_[_loc5_].person[param2] += param3 / (_loc5_ + 1) * _loc6_[_loc5_].person.learningCapacity * 0.2;
            }
            else
            {
               _loc6_[_loc5_].person[param2] += param3 / (_loc5_ + 1) * _loc6_[_loc5_].person.learningCapacity;
            }
         }
      }

not translated yet, category 4 appears to be slaves and 3 prisoners

caravan based experiences (doctor,vet,mechanic) are linear with learningCapacity

Feel free to improve this article

Advertisement