2474 elseif tag == 3 then |
2475 elseif tag == 3 then |
2475 col = 0xFFFF00FF -- blue portal |
2476 col = 0xFFFF00FF -- blue portal |
2476 end |
2477 end |
2477 |
2478 |
2478 if (tag == 0) or (tag == 2) then -- i.e ball form |
2479 if (tag == 0) or (tag == 2) then -- i.e ball form |
2479 tempE = AddVisualGear(GetX(gear), GetY(gear), vgtDust, 0, true) |
2480 local remLife = getGearValue(gear,"life") |
2480 SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, 1, nil, col ) |
|
2481 |
|
2482 remLife = getGearValue(gear,"life") |
|
2483 remLife = remLife - 1 |
2481 remLife = remLife - 1 |
2484 setGearValue(gear, "life", remLife) |
2482 setGearValue(gear, "life", remLife) |
2485 |
2483 |
|
2484 -- Destroy portal ball when max. distance reached |
2486 if remLife == 0 then |
2485 if remLife == 0 then |
2487 |
2486 |
2488 tempE = AddVisualGear(GetX(gear)+15, GetY(gear), vgtSmoke, 0, true) |
2487 local tempE = AddVisualGear(GetX(gear)+15, GetY(gear), vgtSmoke, 0, true) |
2489 SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, col) |
2488 SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, nil, col) |
2490 |
2489 |
2491 tempE = AddVisualGear(GetX(gear)-15, GetY(gear), vgtSmoke, 0, true) |
2490 tempE = AddVisualGear(GetX(gear)-15, GetY(gear), vgtSmoke, 0, true) |
2492 SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, col) |
2491 SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, nil, col) |
2493 |
2492 |
2494 tempE = AddVisualGear(GetX(gear), GetY(gear)+15, vgtSmoke, 0, true) |
2493 tempE = AddVisualGear(GetX(gear), GetY(gear)+15, vgtSmoke, 0, true) |
2495 SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, col) |
2494 SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, nil, col) |
2496 |
2495 |
2497 tempE = AddVisualGear(GetX(gear), GetY(gear)-15, vgtSmoke, 0, true) |
2496 tempE = AddVisualGear(GetX(gear), GetY(gear)-15, vgtSmoke, 0, true) |
2498 SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, col) |
2497 SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, nil, col) |
2499 |
|
2500 |
2498 |
2501 PlaySound(sndVaporize) |
2499 PlaySound(sndVaporize) |
2502 DeleteGear(gear) |
2500 DeleteGear(gear) |
2503 |
2501 |
2504 end |
2502 end |