egezort's mod

  • egezort
    8th Nov 2011 Member 0 Permalink
    @tommig (View Post)
    I will use tmp it will be tricky to code but still a chance
  • cctvdude99
    8th Nov 2011 Member 0 Permalink
    @egezort (View Post)
    And how would tmp be used for that...?
  • tommig
    8th Nov 2011 Member 0 Permalink
    @egezort (View Post)
    I won't be that hard! Why use tmp and not just a chance value?
    Use the code
    if ((r&0xFF) == PT_PLNT && parts[i].life<100) //Plant gives him 5 HP<br/> {
    if (parts[i].life<=95)<br/> parts[i].life += 5;
    else
    parts[i].life = 100;
    kill_part(r>>8);
    }

    Replace PLNT with sugar, and add a chance in
  • egezort
    8th Nov 2011 Member 0 Permalink
    @cctvdude99 (View Post)
    tmp 0 will cause his life down tmp 1 won't do anything tmp 2 will cause him to gain life the randomness will be like quartz
    (when you put quartz tmp is random)
    @tommig (View Post)
    Ok and I am new at coding so I don't know very well and I thought the randomness would be hard
  • tommig
    8th Nov 2011 Member 0 Permalink
    An example of chance from watr.c:

    if ((r&0xFF)==PT_SALT && 1>(rand()%250))
    {
    part_change_type(i,x,y,PT_SLTW);
    part_change_type(r>>8,x+rx,y+ry,PT_SLTW);
    }

    the 1>(rand()%250) means there is a 1 in 250 chance of such and such happening

    Gosh I feel like a pro!
  • egezort
    8th Nov 2011 Member 0 Permalink
    @tommig (View Post)
    wow does it really work if it works you are a pro
  • cctvdude99
    8th Nov 2011 Member 0 Permalink

    tommig:

    Gosh I feel like a pro!


    Big fish small pond much?
  • egezort
    8th Nov 2011 Member 0 Permalink
    ok so I have a mod ,a display and 8 new elements but still I need more
  • egezort
    8th Nov 2011 Member 0 Permalink
    Anyone?
  • airstrike52
    8th Nov 2011 Member 0 Permalink
    @cctvdude99 (View Post)
    More like big di - Wait, no.
    I concur.