PRPL Idea

Started by Prof, November 15, 2016, 03:05:16 PM

Previous topic - Next topic

Prof

A new PRPL Brainstorm. This time revolving around the InitMissile command.

The current/basic code I've come up with so far:


# --MissileTower-- 11/15/2016 9:10:31 PM

$Health:40
$FireRate:75   #in frames E.G. 30 = 1 second, 60 = 2 etc.
$Range:30
$Critical:1 #y/n
$CriticalAmount:10 #of health
$CriticalMul:2
$IsMissionGoal:1
$LatheDamage:0.3

once
Self ->Self
Self SetUnitMaxHealth (<-Health)
Self SetUnitLatheTargets(1)
Self SetUnitMissionGoal(<-IsMissionGoal)
Self SetUnitLatheDamageAmt(<-LatheDamage)
SetTimer0(<-FireRate)
endonce



if(GetTimer0 eq0)
  CurrentCoords <-Range 0 GetAllShipsInRange ->Ships
  <-Ships GetListCount 0 do
      if(<-Ships GetListCount 2 lte)
      4 0 do
             I <-Ships[K] 1 InitMissile
  loop
  endif
  if(<-Ships GetListCount 2 gt <-Ships GetListCount 4 lte and)
    3 0 do
  I <-Ships[K] 1 InitMissile
loop
  endif
  if(<-Ships GetListCount 4 gt)
   2 0 do
  I <-Ships[K] 1 InitMissile
loop
  endif
  loop
  <-Critical 1 eq <-Self.UnitHealth <-CriticalAmount lte and if
    <-FireRate <-CriticalMul mul SetTimer0
  else
    SetTimer0 (<-FireRate)
endif


Ideas and opinions, anyone?

Oblivion

Personally not sure what the command does, or its parameters, guess it creates a missile though.
~Memes have been scientifrically proven to be the very essence of life unto itself~

Prof

I honestly don't even know if it can target ships...

Anyone out there know? Karsten? Planetfall? GoodMoring? Virgil?!